org.carrot2.core
Interface IProcessingComponentManager

All Known Implementing Classes:
CachingProcessingComponentManager, PoolingProcessingComponentManager, SimpleProcessingComponentManager

public interface IProcessingComponentManager

A component management strategy used by a Controller.


Method Summary
 void dispose()
          Called upon disposal of the controller.
 void init(IControllerContext context, Map<String,Object> attributes, ProcessingComponentConfiguration... configurations)
          Called upon initialization of the Controller.
 IProcessingComponent prepare(Class<? extends IProcessingComponent> clazz, String id, Map<String,Object> inputAttributes, Map<String,Object> outputAttributes)
          Prepares a component for processing.
 void recycle(IProcessingComponent component, String id)
          Called after processing completed.
 

Method Detail

init

void init(IControllerContext context,
          Map<String,Object> attributes,
          ProcessingComponentConfiguration... configurations)
Called upon initialization of the Controller.

Parameters:
context - controller context
attributes - global initialization attributes provided to the controller
configurations - component configurations provided to the controller

prepare

IProcessingComponent prepare(Class<? extends IProcessingComponent> clazz,
                             String id,
                             Map<String,Object> inputAttributes,
                             Map<String,Object> outputAttributes)
Prepares a component for processing. Specific managers may simply instantiate a new component object, fetch a component from a pool or wrap a component prepared by a delegate manager etc.

Parameters:
clazz - class of the component to prepare
id - Identifier of the component to prepare. May be null.
inputAttributes - input attributes for all components requested to perform processing. Both Init- and Processing-time attributes will be provided. Managers must not modify this map.
outputAttributes - storage for output attributes

recycle

void recycle(IProcessingComponent component,
             String id)
Called after processing completed. This method is called regardless of whether the processing completed successfully or with an error.

Parameters:
component - Component instance returned from prepare(java.lang.Class, java.lang.String, java.util.Map, java.util.Map).
id - The same identifier of the component as used in the call to prepare(java.lang.Class, java.lang.String, java.util.Map, java.util.Map). May be null.

dispose

void dispose()
Called upon disposal of the controller.



Copyright (c) Dawid Weiss, Stanislaw Osinski