public EngineResource( String name, EnhancementJobManager jobManager, EnhancementEngineManager engineManager, ChainManager chainManager, ContentItemFactory ciFactory, LayoutConfiguration layoutConfiguration, UriInfo uriInfo) { super(jobManager, engineManager, chainManager, ciFactory, layoutConfiguration, uriInfo); this.name = name; engineRefs = engineManager.getReferences(name); if (engineRefs == null || engineRefs.isEmpty()) { throw new WebApplicationException(Response.Status.NOT_FOUND); } engines = new ArrayList<EnhancementEngine>(engineRefs.size()); for (Iterator<ServiceReference> it = engineRefs.iterator(); it.hasNext();) { EnhancementEngine engine = engineManager.getEngine(it.next()); if (engine == null) { //removed in the meantime it.remove(); } else { engines.add(engine); } } if (engines.isEmpty()) { //in the meantime deactivated ... throw new WebApplicationException(Response.Status.NOT_FOUND); } }
public EngineResource( String name, EnhancementJobManager jobManager, EnhancementEngineManager engineManager, ChainManager chainManager, ContentItemFactory ciFactory, LayoutConfiguration layoutConfiguration, UriInfo uriInfo) { super(jobManager, engineManager, chainManager, ciFactory, layoutConfiguration, uriInfo); this.name = name; engineRefs = engineManager.getReferences(name); if (engineRefs == null || engineRefs.isEmpty()) { throw new WebApplicationException(Response.Status.NOT_FOUND); } engines = new ArrayList<EnhancementEngine>(engineRefs.size()); for (Iterator<ServiceReference> it = engineRefs.iterator(); it.hasNext();) { EnhancementEngine engine = engineManager.getEngine(it.next()); if (engine == null) { //removed in the meantime it.remove(); } else { engines.add(engine); } } if (engines.isEmpty()) { //in the meantime deactivated ... throw new WebApplicationException(Response.Status.NOT_FOUND); } }