org.carrot2.core
Class SimpleProcessingComponentManager

java.lang.Object
  extended by org.carrot2.core.SimpleProcessingComponentManager
All Implemented Interfaces:
IProcessingComponentManager

public class SimpleProcessingComponentManager
extends Object
implements IProcessingComponentManager

An IProcessingComponentManager that creates a new component for each processing request.


Constructor Summary
SimpleProcessingComponentManager()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleProcessingComponentManager

public SimpleProcessingComponentManager()
Method Detail

init

public void init(IControllerContext context,
                 Map<String,Object> attributes,
                 ProcessingComponentConfiguration... configurations)
Description copied from interface: IProcessingComponentManager
Called upon initialization of the Controller.

Specified by:
init in interface IProcessingComponentManager
Parameters:
context - controller context
attributes - global initialization attributes provided to the controller
configurations - component configurations provided to the controller

prepare

public IProcessingComponent prepare(Class<? extends IProcessingComponent> clazz,
                                    String id,
                                    Map<String,Object> inputAttributes,
                                    Map<String,Object> outputAttributes)
Description copied from interface: IProcessingComponentManager
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.

Specified by:
prepare in interface IProcessingComponentManager
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

public void recycle(IProcessingComponent component,
                    String id)
Description copied from interface: IProcessingComponentManager
Called after processing completed. This method is called regardless of whether the processing completed successfully or with an error.

Specified by:
recycle in interface IProcessingComponentManager
Parameters:
component - Component instance returned from IProcessingComponentManager.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 IProcessingComponentManager.prepare(java.lang.Class, java.lang.String, java.util.Map, java.util.Map). May be null.

dispose

public void dispose()
Description copied from interface: IProcessingComponentManager
Called upon disposal of the controller.

Specified by:
dispose in interface IProcessingComponentManager


Copyright (c) Dawid Weiss, Stanislaw Osinski