/** * 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; }
/** * Checks, whether the reader contains a next line. Returns false if the end * of the stream has been reached. * * @return true, if there is a next line to read, false otherwise. * @throws IOException if an error occures. */ public boolean hasNext() throws IOException { if (this.buffer == null) { this.buffer = readLine(); } return this.buffer != null; }
/** * Returns the modules subsystem. If this module is not part of an subsystem * then return the modules name, but never null. * * @return the name of the subsystem. */ public String getSubSystem() { if (this.subsystem == null) { return getName(); } return this.subsystem; }
/** * Checks, whether a certain module is available. * * @param moduleDescription the module description of the desired module. * @return true, if the module is available and the version of the module * is compatible, false otherwise. */ public boolean isModuleAvailable(final ModuleInfo moduleDescription) { final PackageState[] packageStates = (PackageState[]) this.modules.toArray(new PackageState[this.modules.size()]); for (int i = 0; i < packageStates.length; i++) { final PackageState state = packageStates[i]; if (state.getModule().getModuleClass().equals(moduleDescription.getModuleClass())) { return (state.getState() == PackageState.STATE_INITIALIZED); } } return false; }
/** * Checks, whether the next line in the reader is a value line. * * @param reader from where to read the lines. * @return true, if the next line is a value line, false otherwise. * @throws IOException if an IO error occurs. */ private boolean isNextLineValueLine (final ReaderHelper reader) throws IOException { if (reader.hasNext() == false) { return false; } final String firstLine = reader.next(); if (firstLine == null) { return false; } if (parseKey(firstLine) != null) { reader.pushBack(firstLine); return false; } reader.pushBack(firstLine); return true; }
/** * Adds a module to the package manager. * Once all modules are added, you have to call initializeModules() * to configure and initialize the new modules. * * @param modClass the module class */ public synchronized void addModule(final String modClass) { final ArrayList loadModules = new ArrayList(); final ModuleInfo modInfo = new DefaultModuleInfo (modClass, null, null, null); if (loadModule(modInfo, new ArrayList(), loadModules, false)) { for (int i = 0; i < loadModules.size(); i++) { final Module mod = (Module) loadModules.get(i); this.modules.add(new PackageState(mod)); } } }
/** * Returns a basic string representation of this SortModule. This * should be used for debugging purposes only. * @see java.lang.Object#toString() * * @return a string representation of this module. */ public String toString () { final StringBuffer buffer = new StringBuffer(); 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(); }
/** * Returns an array of the currently active modules. The module definition * returned contain all known modules, including buggy and unconfigured * instances. * * @return the modules. */ public Module[] getAllModules() { final Module[] mods = new Module[this.modules.size()]; for (int i = 0; i < this.modules.size(); i++) { final PackageState state = (PackageState) this.modules.get(i); mods[i] = state.getModule(); } return mods; }
/** * Checks, whether a certain module is available. * * @param moduleDescription the module description of the desired module. * @return true, if the module is available and the version of the module * is compatible, false otherwise. */ public boolean isModuleAvailable(final ModuleInfo moduleDescription) { final PackageState[] packageStates = (PackageState[]) this.modules.toArray(new PackageState[this.modules.size()]); for (int i = 0; i < packageStates.length; i++) { final PackageState state = packageStates[i]; if (state.getModule().getModuleClass().equals(moduleDescription.getModuleClass())) { return (state.getState() == PackageState.STATE_INITIALIZED); } } return false; }
/** * Adds a module to the package manager. * Once all modules are added, you have to call initializeModules() * to configure and initialize the new modules. * * @param modClass the module class */ public synchronized void addModule(final String modClass) { final ArrayList loadModules = new ArrayList(); final ModuleInfo modInfo = new DefaultModuleInfo (modClass, null, null, null); if (loadModule(modInfo, new ArrayList(), loadModules, false)) { for (int i = 0; i < loadModules.size(); i++) { final Module mod = (Module) loadModules.get(i); this.modules.add(new PackageState(mod)); } } }
/** * Returns a basic string representation of this SortModule. This * should be used for debugging purposes only. * @see java.lang.Object#toString() * * @return a string representation of this module. */ public String toString () { final StringBuffer buffer = new StringBuffer(); 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(); }
/** * 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; }
/** * Checks, whether the reader contains a next line. Returns false if the end * of the stream has been reached. * * @return true, if there is a next line to read, false otherwise. * @throws IOException if an error occures. */ public boolean hasNext() throws IOException { if (this.buffer == null) { this.buffer = readLine(); } return this.buffer != null; }
/** * Returns the modules subsystem. If this module is not part of an subsystem * then return the modules name, but never null. * * @return the name of the subsystem. */ public String getSubSystem() { if (this.subsystem == null) { return getName(); } return this.subsystem; }
/** * Checks, whether a certain module is available. * * @param moduleDescription the module description of the desired module. * @return true, if the module is available and the version of the module * is compatible, false otherwise. */ public boolean isModuleAvailable(final ModuleInfo moduleDescription) { final PackageState[] packageStates = (PackageState[]) this.modules.toArray(new PackageState[this.modules.size()]); for (int i = 0; i < packageStates.length; i++) { final PackageState state = packageStates[i]; if (state.getModule().getModuleClass().equals(moduleDescription.getModuleClass())) { return (state.getState() == PackageState.STATE_INITIALIZED); } } return false; }
/** * Adds a module to the package manager. * Once all modules are added, you have to call initializeModules() * to configure and initialize the new modules. * * @param modClass the module class */ public synchronized void addModule(final String modClass) { final ArrayList loadModules = new ArrayList(); final ModuleInfo modInfo = new DefaultModuleInfo (modClass, null, null, null); if (loadModule(modInfo, new ArrayList(), loadModules, false)) { for (int i = 0; i < loadModules.size(); i++) { final Module mod = (Module) loadModules.get(i); this.modules.add(new PackageState(mod)); } } }
/** * Returns a basic string representation of this SortModule. This * should be used for debugging purposes only. * @see java.lang.Object#toString() * * @return a string representation of this module. */ public String toString () { final StringBuffer buffer = new StringBuffer(); 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(); }
/** * 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; }
/** * Checks, whether the reader contains a next line. Returns false if the end * of the stream has been reached. * * @return true, if there is a next line to read, false otherwise. * @throws IOException if an error occures. */ public boolean hasNext() throws IOException { if (this.buffer == null) { this.buffer = readLine(); } return this.buffer != null; }
/** * Returns the modules subsystem. If this module is not part of an subsystem * then return the modules name, but never null. * * @return the name of the subsystem. */ public String getSubSystem() { if (this.subsystem == null) { return getName(); } return this.subsystem; }