/** * Removes a dependency after the lifecycle is initialized. * If the dependency was not added after initialization, it will not be * removed. * @param desc dependency to remove * @return true if successful, false if the dependency name is not found, or * does not belong to a runtime dependency. */ protected boolean removeRuntimeDependency(String depName){ if(depName == null){ throw new NullPointerException(); } if(myRuntimeDescriptors == null){ return false; } DependencyDescriptor desc = getRuntimeDescriptor(depName); if(desc == null){ theLogger.log(Level.WARNING, "Could not find optional runtime depenedency {0}", depName); return false; } theLogger.log(Level.INFO, "Removing optional runtime depenedency {0}", depName); myRuntimeDescriptors.remove(desc); myDescriptors.remove(desc); firePropertyChange(PROP_DEPENDENCY_REMOVED, null, desc); return true; }
myDescriptors.add(desc); myRuntimeDescriptors.add(desc); firePropertyChange(PROP_DEPENDENCY_ADDED, null, desc); return true;