@Override public void recycle(IProcessingComponent component, String id) { // If not our wrapper, recycle. if (!(component instanceof CachedProcessingComponent)) { delegate.recycle(component, id); } // The wrapped actual components are recycled in ValueProducer when // they're asked to perform processing. }
@Override public Map<String, Object> call() throws Exception { final Map<String, Object> inputProcessingAttributes = key.inputProcessingAttributes; @SuppressWarnings("unchecked") final Class<? extends IProcessingComponent> componentClass = (Class<? extends IProcessingComponent>) inputProcessingAttributes.get(COMPONENT_CLASS_KEY); final String componentId = (String) inputProcessingAttributes.get(COMPONENT_ID_KEY); IProcessingComponent component = null; try { final Map<String, Object> attributes = Maps.newHashMap(); component = delegate.prepare(componentClass, componentId, key.inputAttributes, attributes); ControllerUtils.performProcessing(component, inputProcessingAttributes, attributes); return attributes; } finally { if (component != null) { delegate.recycle(component, componentId); } } } }
componentManager.recycle(component, configurations[i].componentId);
delegate.recycle(component, componentId);