public DependencyEnginePool(DependencyEngine... dependencyEngines) { if (dependencyEngines != null) { for (DependencyEngine dependencyEngine : dependencyEngines) { if (dependencyEngine.getDependencyEngineId() == null) dependencyEngine.setDependencyEngineId(dependencyEngine.getClass().getSimpleName()); add(dependencyEngine.getDependencyEngineId(), dependencyEngine); } } }
public synchronized void add(String id, DependencyEngine dependencyEngine) { if (id == null || id.length() == 0) { throw new DtException("Unable to load the dependency engine. Id not specified."); } if (getDependencyEngine(id) != null) { throw new DtException( "Unable to load the dependency engine. Dependency engine with id=" + id + " already exists."); } dependencyEngine.setDependencyEngineId(id); addDependencyEngine(dependencyEngine); }