@Override public LoaderRepositoryConfig unmarshal(Object e) throws Exception { return LoaderRepositoryFactory.parseRepositoryConfig((Element) e); }
/** Create a LoaderRepository instance of type repositoryClassName and * register it under repositoryName if there is not already an instance * registered. * * @param server the MBeanServer to register with * @param repositoryClassName the class which implements LoaderRepository * @param repositoryName the JMX name to register under * @throws JMException thrown on any failure to create or register the repository */ public static synchronized void createLoaderRepository(MBeanServer server, String repositoryClassName, ObjectName repositoryName) throws JMException { LoaderRepositoryConfig config = new LoaderRepositoryConfig(); config.repositoryClassName = repositoryClassName; config.repositoryName = repositoryName; createLoaderRepository(server, config); } /** Create and configure a LoaderRepository instance using the given config
/** Create a LoaderRepository instance of type repositoryClassName and * register it under repositoryName if there is not already an instance * registered. * * @param server the MBeanServer to register with * @param repositoryClassName the class which implements LoaderRepository * @param repositoryName the JMX name to register under * @throws JMException thrown on any failure to create or register the repository */ public static synchronized void createLoaderRepository(MBeanServer server, String repositoryClassName, ObjectName repositoryName) throws JMException { LoaderRepositoryConfig config = new LoaderRepositoryConfig(); config.repositoryClassName = repositoryClassName; config.repositoryName = repositoryName; createLoaderRepository(server, config); } /** Create and configure a LoaderRepository instance using the given config
@Override public LoaderRepositoryConfig unmarshal(Object e) throws Exception { return LoaderRepositoryFactory.parseRepositoryConfig((Element) e); }
@Override public LoaderRepositoryConfig unmarshal(Object e) throws Exception { return LoaderRepositoryFactory.parseRepositoryConfig((Element) e); }
/** * Parse the loader repository config * * @param document the document * @return the config * @throws ConfigurationException for any error */ private LoaderRepositoryConfig parseLoaderRepositoryConfig(Document document) throws ConfigurationException { // Check for a custom loader-repository for scoping NodeList loaders = document.getElementsByTagName("loader-repository"); if( loaders.getLength() > 0 ) { if(loaders.getLength() > 1) throw new ConfigurationException("SAR Deployment cannot have more than one loader-repository entry."); Element loader = (Element) loaders.item(0); try { return LoaderRepositoryFactory.parseRepositoryConfig(loader); } catch (Exception e) { ConfigurationException.rethrowAsConfigurationException("Unable to parse loader repository config", e); } } return null; } }
/** * Parse the loader repository config * * @param document the document * @return the config * @throws ConfigurationException for any error */ private LoaderRepositoryConfig parseLoaderRepositoryConfig(Document document) throws ConfigurationException { // Check for a custom loader-repository for scoping NodeList loaders = document.getElementsByTagName("loader-repository"); if( loaders.getLength() > 0 ) { if(loaders.getLength() > 1) throw new ConfigurationException("SAR Deployment cannot have more than one loader-repository entry."); Element loader = (Element) loaders.item(0); try { return LoaderRepositoryFactory.parseRepositoryConfig(loader); } catch (Exception e) { ConfigurationException.rethrowAsConfigurationException("Unable to parse loader repository config", e); } } return null; } }