private DependencyEngine getDependencyEngine(String id) { for (DependencyEngine dependencyEngine : dependencyEngines) { if (dependencyEngine == null || dependencyEngine.getDependencyEngineId() == null) continue; if (dependencyEngine.getDependencyEngineId().equalsIgnoreCase(id)) return dependencyEngine; } return null; }
public synchronized List<String> getDependencyEngineIds() { List<String> list = new ArrayList<String>(); for (DependencyEngine dependencyEngine : dependencyEngines) { if (dependencyEngine == null || dependencyEngine.getDependencyEngineId() == null) continue; list.add(new String(dependencyEngine.getDependencyEngineId())); } return list; }
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 DependencyEngine get(Arguments arguments) { DependencyEngine dependencyEngine = null; try { dependencyEngine = findEngine(arguments); } catch (DtException ex) { dependencyEngine = getDefaultEngine(); } if (arguments.getDependencyEngineId() != null && arguments.getDependencyEngineId().length() > 0) { if (!(dependencyEngine != null && dependencyEngine.getDependencyEngineId() != null && dependencyEngine .getDependencyEngineId() .equalsIgnoreCase(arguments.getDependencyEngineId()))) { throw new DtException( "unable to find a dependency engine with id: " + arguments.getDependencyEngineId()); } } ; return dependencyEngine; }