public void parseConfiguration( final AbstractBoot boot ) throws IOException { final String domain = boot.getConfigurationDomain(); final Module[] activeModules = boot.getPackageManager().getActiveModules(); for ( int i = 0; i < activeModules.length; i++ ) { final Module activeModule = activeModules[ i ]; final InputStream resourceAsStream = activeModule.getClass().getResourceAsStream( "config-description.xml" ); if ( resourceAsStream != null ) { try { parse( resourceAsStream, domain ); } finally { resourceAsStream.close(); } } } } }
/** * Constructs a ConfigDescriptionEditor that is initially invisible. */ public ConfigDescriptionEditor( final AbstractBoot boot ) { if ( boot != null ) { boot.start(); this.configurationToEdit = boot.getGlobalConfig(); } init(); }
final AbstractBoot boot = loadBooter( projectInformation.getBootClass() ); if ( boot != null ) { boot.start(); while ( boot.isBootDone() == false && boot.isBootFailed() == false ) { try { boot.wait(); if ( boot.isBootFailed() ) { this.bootFailed = boot.getBootFailureReason(); LOGGER.error( "Dependent project failed to boot up: " + projectInformation.getBootClass() + " failed to boot: ", this.bootFailed );
/** * Helper method for serialization. * * @param in the input stream from where to read the serialized object. * @throws java.io.IOException when reading the stream fails. * @throws ClassNotFoundException if a class definition for a serialized object could not be found. */ private void readObject( final ObjectInputStream in ) throws IOException, ClassNotFoundException { in.defaultReadObject(); final boolean readParent = in.readBoolean(); if ( readParent ) { parentConfiguration = (Configuration) in.readObject(); } else { if ( booterClass != null ) { final AbstractBoot boot = AbstractBoot.loadBooter( booterClass.getName(), booterClass ); parentConfiguration = boot.getGlobalConfig(); } else { parentConfiguration = null; } } }
if ( isBootDone() ) { return; if ( isBootFailed() ) { LOGGER.error( getClass() + " failed to boot: " + bootFailed.getMessage() ); while ( isBootInProgress() ) { try { wait(); if ( isBootDone() ) { notifyAll(); return; final ProjectInformation info = getProjectInfo(); if ( info != null ) { performBootDependencies( info.getLibraries() ); performBootDependencies( info.getOptionalLibraries() ); performBoot(); if ( LOGGER.isInfoEnabled() ) { if ( info != null ) {
/** * Returns the global configuration as extended configuration. * * @return the extended configuration. */ public synchronized ExtendedConfiguration getExtendedConfig() { if ( extWrapper == null ) { extWrapper = new ExtendedConfigurationWrapper( getGlobalConfig() ); } return extWrapper; }
/** * Create a new and uninitialized module node factory. */ public ModuleNodeFactory( final AbstractBoot packageManager ) { this.packageManager = packageManager; messages = Messages.getInstance(); activeModules = packageManager.getPackageManager().getAllModules(); Arrays.sort( activeModules, new ModuleSorter() ); globalNodes = new ArrayList<ConfigTreeModuleNode>(); localNodes = new ArrayList<ConfigTreeModuleNode>(); configEntryLookup = new HashMap<String, ConfigDescriptionEntry>(); }
/** * Loads the specified booter implementation. * * @param classname the class name. * @return The boot class. */ protected AbstractBoot loadBooter( final String classname ) { return loadBooter( classname, getClass() ); }
public void load( final boolean append ) throws IOException { final String configurationDomain = packageManager.getConfigurationDomain(); final ConfigurationDomain domain = ConfigurationMetaData.getInstance().createDomain( configurationDomain );
public String getConfigurationDomain() { return getProjectInfo().getProductId(); }
if (isBootDone()) if (isBootFailed()) while (isBootInProgress()) if (isBootDone()) final ProjectInformation info = getProjectInfo(); if (info != null) performBootDependencies(info.getLibraries()); performBootDependencies(info.getOptionalLibraries()); performBoot(); if (LOGGER.isInfoEnabled())
/** * Helper method for serialization. * * @param in the input stream from where to read the serialized object. * @throws java.io.IOException when reading the stream fails. * @throws ClassNotFoundException if a class definition for a serialized * object could not be found. */ private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); final boolean readParent = in.readBoolean(); if (readParent) { parentConfiguration = (Configuration) in.readObject(); } else { if (booterClass != null) { final AbstractBoot boot = AbstractBoot.loadBooter(booterClass.getName(), booterClass); parentConfiguration = boot.getGlobalConfig(); } else { parentConfiguration = null; } } }
/** * Returns the global configuration as extended configuration. * * @return the extended configuration. */ public synchronized ExtendedConfiguration getExtendedConfig() { if (extWrapper == null) { extWrapper = new ExtendedConfigurationWrapper(getGlobalConfig()); } return extWrapper; }
rootProperty.load( staticConfig, source ); globalConfig.insertConfiguration( rootProperty ); globalConfig.insertConfiguration( getPackageManager().getPackageConfiguration() );
/** * Loads the specified booter implementation. * * @param classname the class name. * @return The boot class. */ protected AbstractBoot loadBooter(final String classname) { return loadBooter(classname, getClass()); }
public String getConfigurationDomain() { return getProjectInfo().getProductId(); }
final AbstractBoot boot = loadBooter(projectInformation.getBootClass()); if (boot != null) boot.start(); while (boot.isBootDone() == false && boot.isBootFailed() == false) if (boot.isBootFailed()) this.bootFailed = boot.getBootFailureReason(); LOGGER.error("Dependent project failed to boot up: " + projectInformation.getBootClass() + " failed to boot: ", this.bootFailed);
/** * Constructs a ConfigDescriptionEditor that is initially invisible. */ public ConfigDescriptionEditor( final String booterClass ) { final AbstractBoot boot = ObjectUtilities.loadAndInstantiate( booterClass, ConfigDescriptionEditor.class, AbstractBoot.class ); if ( boot != null ) { boot.start(); this.configurationToEdit = boot.getGlobalConfig(); } init(); }
public void parseConfiguration(final AbstractBoot boot) throws IOException { final String domain = boot.getConfigurationDomain(); final Module[] activeModules = boot.getPackageManager().getActiveModules(); for (int i = 0; i < activeModules.length; i++) { final Module activeModule = activeModules[i]; final InputStream resourceAsStream = activeModule.getClass().getResourceAsStream("config-description.xml"); if (resourceAsStream != null) { try { parse(resourceAsStream, domain); } finally { resourceAsStream.close(); } } } } }
public synchronized ObjectFactory getObjectFactory() { try { if ( objectFactory == null ) { final String configProperty = getGlobalConfig().getConfigProperty( ObjectFactoryBuilder.class.getName(), DefaultObjectFactoryBuilder.class.getName() ); final ObjectFactoryBuilder objectFactoryBuilder = ObjectUtilities.loadAndInstantiate( configProperty, getClass(), ObjectFactoryBuilder.class ); objectFactory = objectFactoryBuilder.createObjectFactory( this ); } return objectFactory; } catch ( Throwable t ) { throw new IllegalStateException( "ObjectFactory is not configured properly", t ); } } }