/** * Creates a package manager instance. * * @param booter the booter. * @return A package manager. */ public static PackageManager createInstance(final AbstractBoot booter) { PackageManager manager; if (instances == null) { instances = new HashMap(); manager = new PackageManager(booter); instances.put(booter, manager); return manager; } manager = (PackageManager) instances.get(booter); if (manager == null) { manager = new PackageManager(booter); instances.put(booter, manager); } return manager; }
/** * Performs the boot process. */ protected void performBoot() { // configure the classloader from the properties-file. ObjectUtilities.setClassLoaderSource (getConfiguration().getConfigProperty("org.jfree.ClassLoader")); getPackageManager().addModule(DefaultLogModule.class.getName()); getPackageManager().load("org.jfree.jcommon.modules."); getPackageManager().initializeModules(); }
/** * Returns the packageManager instance of the package manager. * * @return The package manager. */ public synchronized PackageManager getPackageManager() { if (this.packageManager == null) { this.packageManager = PackageManager.createInstance(this); } return this.packageManager; }
if (acceptVersion(moduleInfo, module) == false) { dropFailedModule(state); return false; final int moduleContained = containsModule(modules, module); if (moduleContained == RETURN_MODULE_ERROR) { dropFailedModule(state); return false; module.getClass())); final PackageState state = new PackageState(module, PackageState.STATE_ERROR); dropFailedModule(state); return false; final ModuleInfo[] required = module.getRequiredModules(); for (int i = 0; i < required.length; i++) { if (loadModule(required[i], incompleteModules, modules, true) == false) { Log.debug("Indicated failure for module: " + module.getModuleClass()); final PackageState state = new PackageState(module, PackageState.STATE_ERROR); dropFailedModule(state); return false; if (loadModule(optional[i], incompleteModules, modules, true) == false) { Log.debug(new Log.SimpleMessage("Optional module: ", optional[i].getModuleClass(), " was not loaded.")); if (containsModule(modules, module) == RETURN_MODULE_UNKNOWN) {
final Module[] allMods = getAllModules(); final ArrayList activeModules = new ArrayList(); final ArrayList failedModules = new ArrayList(); if (isModuleAvailable(allMods[i])) { activeModules.add(allMods[i]);
/** * Configures the module by loading the configuration properties and * adding them to the package configuration. * * @param subSystem the subsystem. */ public void configure(final SubSystem subSystem) { final InputStream in = ObjectUtilities.getResourceRelativeAsStream ("configuration.properties", getClass()); if (in == null) { return; } try { subSystem.getPackageManager().getPackageConfiguration().load(in); } finally { try { in.close(); } catch (IOException e) { // can be ignored ... } } }
/** * Loads all modules mentioned in the report configuration starting with * the given prefix. This method is used during the boot process of * JFreeReport. You should never need to call this method directly. * * @param modulePrefix the module prefix. */ public void load(final String modulePrefix) { if (this.initSections.contains(modulePrefix)) { return; } this.initSections.add(modulePrefix); final Configuration config = this.booter.getGlobalConfig(); final Iterator it = config.findPropertyKeys(modulePrefix); int count = 0; while (it.hasNext()) { final String key = (String) it.next(); if (key.endsWith(".Module")) { final String moduleClass = config.getConfigProperty(key); if (moduleClass != null && moduleClass.length() > 0) { addModule(moduleClass); count++; } } } Log.debug("Loaded a total of " + count + " modules under prefix: " + modulePrefix); }
final int compare = acceptVersion(moduleRequirement.getMajorVersion(), module.getMajorVersion()); if (compare > 0) { final int compare = acceptVersion(moduleRequirement.getMinorVersion(), module.getMinorVersion()); if (compare > 0) { if (acceptVersion(moduleRequirement.getPatchLevel(), module.getPatchLevel()) > 0) { Log.debug("Did not accept patchlevel: "
if (acceptVersion(moduleInfo, module) == false) { dropFailedModule(state); return false; final int moduleContained = containsModule(modules, module); if (moduleContained == RETURN_MODULE_ERROR) { dropFailedModule(state); return false; module.getClass())); final PackageState state = new PackageState(module, PackageState.STATE_ERROR); dropFailedModule(state); return false; final ModuleInfo[] required = module.getRequiredModules(); for (int i = 0; i < required.length; i++) { if (loadModule(required[i], incompleteModules, modules, true) == false) { Log.debug("Indicated failure for module: " + module.getModuleClass()); final PackageState state = new PackageState(module, PackageState.STATE_ERROR); dropFailedModule(state); return false; if (loadModule(optional[i], incompleteModules, modules, true) == false) { Log.debug(new Log.SimpleMessage("Optional module: ", optional[i].getModuleClass(), " was not loaded.")); if (containsModule(modules, module) == RETURN_MODULE_UNKNOWN) {
final Module[] allMods = getAllModules(); final ArrayList activeModules = new ArrayList(); final ArrayList failedModules = new ArrayList(); if (isModuleAvailable(allMods[i])) { activeModules.add(allMods[i]);
/** * Configures the module by loading the configuration properties and * adding them to the package configuration. * * @param subSystem the subsystem. */ public void configure(final SubSystem subSystem) { final InputStream in = ObjectUtilities.getResourceRelativeAsStream ("configuration.properties", getClass()); if (in == null) { return; } try { subSystem.getPackageManager().getPackageConfiguration().load(in); } finally { try { in.close(); } catch (IOException e) { // can be ignored ... } } }
/** * Loads all modules mentioned in the report configuration starting with * the given prefix. This method is used during the boot process of * JFreeReport. You should never need to call this method directly. * * @param modulePrefix the module prefix. */ public void load(final String modulePrefix) { if (this.initSections.contains(modulePrefix)) { return; } this.initSections.add(modulePrefix); final Configuration config = this.booter.getGlobalConfig(); final Iterator it = config.findPropertyKeys(modulePrefix); int count = 0; while (it.hasNext()) { final String key = (String) it.next(); if (key.endsWith(".Module")) { final String moduleClass = config.getConfigProperty(key); if (moduleClass != null && moduleClass.length() > 0) { addModule(moduleClass); count++; } } } Log.debug("Loaded a total of " + count + " modules under prefix: " + modulePrefix); }
final int compare = acceptVersion(moduleRequirement.getMajorVersion(), module.getMajorVersion()); if (compare > 0) { final int compare = acceptVersion(moduleRequirement.getMinorVersion(), module.getMinorVersion()); if (compare > 0) { if (acceptVersion(moduleRequirement.getPatchLevel(), module.getPatchLevel()) > 0) { Log.debug("Did not accept patchlevel: "
if (acceptVersion(moduleInfo, module) == false) { dropFailedModule(state); return false; final int moduleContained = containsModule(modules, module); if (moduleContained == RETURN_MODULE_ERROR) { dropFailedModule(state); return false; module.getClass())); final PackageState state = new PackageState(module, PackageState.STATE_ERROR); dropFailedModule(state); return false; final ModuleInfo[] required = module.getRequiredModules(); for (int i = 0; i < required.length; i++) { if (loadModule(required[i], incompleteModules, modules, true) == false) { Log.debug("Indicated failure for module: " + module.getModuleClass()); final PackageState state = new PackageState(module, PackageState.STATE_ERROR); dropFailedModule(state); return false; if (loadModule(optional[i], incompleteModules, modules, true) == false) { Log.debug(new Log.SimpleMessage("Optional module: ", optional[i].getModuleClass(), " was not loaded.")); if (containsModule(modules, module) == RETURN_MODULE_UNKNOWN) {
/** * Performs the boot process. */ protected void performBoot() { // configure the classloader from the properties-file. ObjectUtilities.setClassLoaderSource (getConfiguration().getConfigProperty("org.jfree.ClassLoader")); getPackageManager().addModule(DefaultLogModule.class.getName()); getPackageManager().load("org.jfree.jcommon.modules."); getPackageManager().initializeModules(); }
final Module[] allMods = getAllModules(); final ArrayList activeModules = new ArrayList(); final ArrayList failedModules = new ArrayList(); if (isModuleAvailable(allMods[i])) { activeModules.add(allMods[i]);
/** * Configures the module by loading the configuration properties and * adding them to the package configuration. * * @param subSystem the subsystem. */ public void configure(final SubSystem subSystem) { final InputStream in = ObjectUtilities.getResourceRelativeAsStream ("configuration.properties", getClass()); if (in == null) { return; } try { subSystem.getPackageManager().getPackageConfiguration().load(in); } finally { try { in.close(); } catch (IOException e) { // can be ignored ... } } }
/** * Returns the packageManager instance of the package manager. * * @return The package manager. */ public synchronized PackageManager getPackageManager() { if (this.packageManager == null) { this.packageManager = PackageManager.createInstance(this); } return this.packageManager; }
/** * Creates a package manager instance. * * @param booter the booter. * @return A package manager. */ public static PackageManager createInstance(final AbstractBoot booter) { PackageManager manager; if (instances == null) { instances = new HashMap(); manager = new PackageManager(booter); instances.put(booter, manager); return manager; } manager = (PackageManager) instances.get(booter); if (manager == null) { manager = new PackageManager(booter); instances.put(booter, manager); } return manager; }
/** * Loads all modules mentioned in the report configuration starting with * the given prefix. This method is used during the boot process of * JFreeReport. You should never need to call this method directly. * * @param modulePrefix the module prefix. */ public void load(final String modulePrefix) { if (this.initSections.contains(modulePrefix)) { return; } this.initSections.add(modulePrefix); final Configuration config = this.booter.getGlobalConfig(); final Iterator it = config.findPropertyKeys(modulePrefix); int count = 0; while (it.hasNext()) { final String key = (String) it.next(); if (key.endsWith(".Module")) { final String moduleClass = config.getConfigProperty(key); if (moduleClass != null && moduleClass.length() > 0) { addModule(moduleClass); count++; } } } Log.debug("Loaded a total of " + count + " modules under prefix: " + modulePrefix); }