Пример #1
0
 public DependencyEnginePool(DependencyEngine... dependencyEngines) {
   if (dependencyEngines != null) {
     for (DependencyEngine dependencyEngine : dependencyEngines) {
       if (dependencyEngine.getDependencyEngineId() == null)
         dependencyEngine.setDependencyEngineId(dependencyEngine.getClass().getSimpleName());
       add(dependencyEngine.getDependencyEngineId(), dependencyEngine);
     }
   }
 }
Пример #2
0
 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);
 }