for ( int i = 0; i < activeModules.size(); i++ ) { final Module mod = activeModules.get( i ); p.print( new PadMessage( mod.getModuleClass(), 70 ) ); p.print( " [" ); p.print( mod.getSubSystem() ); p.println( "]" ); p.print( " Version: " ); p.print( mod.getMajorVersion() ); p.print( "-" ); p.print( mod.getMinorVersion() ); p.print( "-" ); p.print( mod.getPatchLevel() ); p.print( " Producer: " ); p.println( mod.getProducer() ); p.print( " Description: " ); p.println( mod.getDescription() );
/** * Defines the currently edited module and initializes an module editor for that module. * * @param module the module that should be edited. * @param config the report configuration that supplies the values for the module. * @param entries a list of entries which should be edited. */ public void editModule( final Module module, final HierarchicalConfiguration config, final ConfigDescriptionEntry[] entries ) { final Object[] params = new Object[ 4 ]; params[ 0 ] = module.getName(); params[ 1 ] = module.getMajorVersion(); params[ 2 ] = module.getMinorVersion(); params[ 3 ] = module.getPatchLevel(); moduleNameField.setText( moduleNameFormat.format( params ) ); producerField.setText( module.getProducer() ); descriptionArea.setText( module.getDescription() ); editorArea.removeAll(); moduleEditor = EditorFactory.getInstance().getModule( module, config, entries ); if ( moduleEditor != null ) { editorArea.add( moduleEditor.getComponent() ); moduleEditor.reset(); } invalidate(); }
this.module.configure( subSystem ); this.state = STATE_CONFIGURED; return true; } catch ( NoClassDefFoundError noClassDef ) { LOGGER.warn( "Unable to load module classes for " + this.module.getName() + ':' + noClassDef.getMessage() ); this.state = STATE_ERROR; } catch ( Exception e ) { if ( LOGGER.isDebugEnabled() ) { LOGGER.warn( "Unable to configure the module " + this.module.getName(), e ); } else if ( LOGGER.isWarnEnabled() ) { LOGGER.warn( "Unable to configure the module " + this.module.getName() );
/** * Returns a basic string representation of this SortModule. This should be used for debugging purposes only. * * @return a string representation of this module. * @see Object#toString() */ public String toString() { final StringBuilder buffer = new StringBuilder( 100 ); buffer.append( "SortModule: " ); buffer.append( this.position ); buffer.append( ' ' ); buffer.append( this.state.getModule().getName() ); buffer.append( ' ' ); buffer.append( this.state.getModule().getModuleClass() ); return buffer.toString(); }
this.module.initialize( subSystem ); this.state = STATE_INITIALIZED; return true; } catch ( NoClassDefFoundError noClassDef ) { LOGGER.warn( "Unable to load module classes for " + this.module.getName() + ':' + noClassDef.getMessage() ); this.state = STATE_ERROR; } catch ( ModuleInitializeException me ) { if ( LOGGER.isDebugEnabled() ) { LOGGER.warn( "Unable to initialize the module " + this.module.getName(), me ); } else if ( LOGGER.isWarnEnabled() ) { LOGGER.warn( "Unable to initialize the module " + this.module.getName() ); if ( LOGGER.isDebugEnabled() ) { LOGGER.warn( "Unable to initialize the module " + this.module.getName(), e ); } else if ( LOGGER.isWarnEnabled() ) { LOGGER.warn( "Unable to initialize the module " + this.module.getName() );
return true; if ( module.getMajorVersion() == null ) { LOGGER.warn( "Module " + module.getName() + " does not define a major version." ); } else { final int compare = acceptVersion( moduleRequirement.getMajorVersion(), module.getMajorVersion() ); if ( compare > 0 ) { return false; if ( module.getMinorVersion() == null ) { LOGGER.warn( "Module " + module.getName() + " does not define a minor version." ); } else { final int compare = acceptVersion( moduleRequirement.getMinorVersion(), module.getMinorVersion() ); if ( compare > 0 ) { return false; if ( module.getPatchLevel() == null ) { LOGGER.debug( "Module " + module.getName() + " does not define a patch level." ); } else { if ( acceptVersion( moduleRequirement.getPatchLevel(), module.getPatchLevel() ) > 0 ) { LOGGER.debug( "Did not accept patchlevel: " + moduleRequirement.getPatchLevel() + " - " + module.getPatchLevel() ); return false;
LOGGER.warn( "Module " + module.getName() + ": required version: " + moduleInfo + ", but found Version: \n" + module ); final PackageState state = new PackageState( module, PackageState.STATE_ERROR ); if ( moduleContained == RETURN_MODULE_ERROR ) { LOGGER.debug( "Indicated failure for module: " + module.getModuleClass() ); final PackageState state = new PackageState( module, PackageState.STATE_ERROR ); dropFailedModule( state ); final ModuleInfo[] required = module.getRequiredModules(); for ( int i = 0; i < required.length; i++ ) { if ( loadModule( required[ i ], incompleteModules, modules, true ) == false ) { LOGGER.debug( "Indicated failure for module: " + module.getModuleClass() ); final PackageState state = new PackageState( module, PackageState.STATE_ERROR ); dropFailedModule( state ); final ModuleInfo[] optional = module.getOptionalModules(); for ( int i = 0; i < optional.length; i++ ) { if ( loadModule( optional[ i ], incompleteModules, modules, true ) == false ) {
( final Module childMod, final HashMap<String, SortModule> moduleMap ) { final ArrayList<String> collector = new ArrayList<String>(); final ModuleInfo[] requiredModules = childMod.getRequiredModules(); for ( int i = 0; i < requiredModules.length; i++ ) { final SortModule dependentModule = moduleMap.get( requiredModules[ i ].getModuleClass() ); collector.add( dependentModule.getState().getModule().getSubSystem() ); final ModuleInfo[] optionalModules = childMod.getOptionalModules(); for ( int i = 0; i < optionalModules.length; i++ ) { final Object o = moduleMap.get( optionalModules[ i ].getModuleClass() ); continue; collector.add( dependentModule.getState().getModule().getSubSystem() );
/** * Checks whether the module is configurable. A module is considered configurable if all dependencies exist and * are initialized. * * @param state the package state that should be checked. * @return true, if the module can be configured, false otherwise. */ private boolean isInitializable(final PackageState state) { final ModuleInfo[] requiredModules = state.getModule().getRequiredModules(); for (int i = 0; i < requiredModules.length; i++) { final ModuleInfo module = requiredModules[i]; final String key = module.getModuleClass(); final PackageState dependentState = modulesByClass.get(key); if (dependentState == null) { LOGGER.warn("Required dependency '" + key + "' for module '" + state.getModule().getModuleClass() + " not found."); return false; } if (dependentState.getState() != PackageState.STATE_INITIALIZED) { LOGGER.warn("Required dependency '" + key + "' for module '" + state.getModule().getModuleClass() + " not initializable."); return false; } } return true; }
/** * Compares this object with the given other object for equality. * * @param o the other object to be compared * @return true, if the other object is also a PackageState containing the same module, false otherwise. * @see Object#equals(Object) */ public boolean equals( final Object o ) { if ( this == o ) { return true; } if ( !( o instanceof PackageState ) ) { return false; } final PackageState packageState = (PackageState) o; if ( !this.module.getModuleClass().equals( packageState.module.getModuleClass() ) ) { return false; } return true; }
/** * Checks, whether a module is a base module of an given module. * * @param mod the module which to check * @param mi the module info of the suspected base module. * @return true, if the given module info describes a base module of the given module, false otherwise. */ private static boolean isBaseModule( final Module mod, final ModuleInfo mi ) { final ModuleInfo[] requiredModules = mod.getRequiredModules(); for ( int i = 0; i < requiredModules.length; i++ ) { if ( requiredModules[ i ].getModuleClass().equals( mi.getModuleClass() ) ) { return true; } } final ModuleInfo[] optionalModules = mod.getOptionalModules(); for ( int i = 0; i < optionalModules.length; i++ ) { if ( optionalModules[ i ].getModuleClass().equals( mi.getModuleClass() ) ) { return true; } } return false; }
if ( LOGGER.isDebugEnabled() ) { LOGGER.debug( "Conf: " + new PadMessage( mod.getModule().getModuleClass(), 70 ) + " [" + mod.getModule().getSubSystem() + ']' ); if ( LOGGER.isDebugEnabled() ) { LOGGER.debug( "Init: " + new PadMessage( mod.getModule().getModuleClass(), 70 ) + " [" + mod.getModule().getSubSystem() + ']' ); times.add( new BootTimeEntry( mod.getModule().getModuleClass(), stopWatch.getElapsedTime() ) );
/** * Creates a new module node for the given module object and report configuration. * * @param module the module for which to build a tree node. */ public ConfigTreeModuleNode( final Module module ) { super( module.getName() ); this.assignedKeys = new ArrayList<ConfigDescriptionEntry>(); this.module = module; configurationPrefix = ModuleNodeFactory.getPackage( this.module.getClass() ); }
if (module.getMajorVersion() == null) LOGGER.warn("Module " + module.getName() + " does not define a major version."); module.getMajorVersion()); if (compare > 0) if (module.getMinorVersion() == null) LOGGER.warn("Module " + module.getName() + " does not define a minor version."); module.getMinorVersion()); if (compare > 0) if (module.getPatchLevel() == null) LOGGER.debug("Module " + module.getName() + " does not define a patch level."); module.getPatchLevel()) > 0) + module.getPatchLevel()); return false;
LOGGER.warn("Module " + module.getName() + ": required version: " + moduleInfo + ", but found Version: \n" + module); final PackageState state = new PackageState(module, PackageState.STATE_ERROR); LOGGER.debug("Indicated failure for module: " + module.getModuleClass()); final PackageState state = new PackageState(module, PackageState.STATE_ERROR); dropFailedModule(state); final ModuleInfo[] required = module.getRequiredModules(); for (int i = 0; i < required.length; i++) LOGGER.debug("Indicated failure for module: " + module.getModuleClass()); final PackageState state = new PackageState(module, PackageState.STATE_ERROR); dropFailedModule(state); final ModuleInfo[] optional = module.getOptionalModules(); for (int i = 0; i < optional.length; i++)
final ModuleInfo[] requiredModules = childMod.getRequiredModules(); for (int i = 0; i < requiredModules.length; i++) collector.add(dependentModule.getState().getModule().getSubSystem()); final ModuleInfo[] optionalModules = childMod.getOptionalModules(); for (int i = 0; i < optionalModules.length; i++) continue; collector.add(dependentModule.getState().getModule().getSubSystem());
/** * Checks whether the module is configurable. A module is considered configurable if all dependencies exist and are * initialized. * * @param state the package state that should be checked. * @return true, if the module can be configured, false otherwise. */ private boolean isInitializable( final PackageState state ) { final ModuleInfo[] requiredModules = state.getModule().getRequiredModules(); for ( int i = 0; i < requiredModules.length; i++ ) { final ModuleInfo module = requiredModules[ i ]; final String key = module.getModuleClass(); final PackageState dependentState = modulesByClass.get( key ); if ( dependentState == null ) { LOGGER.warn( "Required dependency '" + key + "' for module '" + state.getModule().getModuleClass() + " not found." ); return false; } if ( dependentState.getState() != PackageState.STATE_INITIALIZED ) { LOGGER.warn( "Required dependency '" + key + "' for module '" + state.getModule().getModuleClass() + " not initializable." ); return false; } } return true; }
/** * Returns a basic string representation of this SortModule. This * should be used for debugging purposes only. * * @return a string representation of this module. * @see Object#toString() */ public String toString() { final StringBuilder buffer = new StringBuilder(100); buffer.append("SortModule: "); buffer.append(this.position); buffer.append(' '); buffer.append(this.state.getModule().getName()); buffer.append(' '); buffer.append(this.state.getModule().getModuleClass()); return buffer.toString(); }
this.module.initialize(subSystem); this.state = STATE_INITIALIZED; return true; LOGGER.warn("Unable to load module classes for " + this.module.getName() + ':' + noClassDef.getMessage()); this.state = STATE_ERROR; LOGGER.warn("Unable to initialize the module " + this.module.getName(), me); LOGGER.warn("Unable to initialize the module " + this.module.getName()); LOGGER.warn("Unable to initialize the module " + this.module.getName(), e); LOGGER.warn("Unable to initialize the module " + this.module.getName());
/** * Compares this object with the given other object for equality. * * @param o the other object to be compared * @return true, if the other object is also a PackageState containing * the same module, false otherwise. * @see Object#equals(Object) */ public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof PackageState)) { return false; } final PackageState packageState = (PackageState) o; if (!this.module.getModuleClass().equals(packageState.module.getModuleClass())) { return false; } return true; }