org.carrot2.core
Class SimpleController

java.lang.Object
  extended by org.carrot2.core.SimpleController
All Implemented Interfaces:
IController

Deprecated. Please use ControllerFactory.createSimple() to obtain a Controller equivalent to this one. Controllers can be further tuned with custom IProcessingComponentManagers. This class will be removed in the 3.4.0 release of Carrot2.

public final class SimpleController
extends Object
implements IController

A simple controller implementing the life cycle described in IProcessingComponent.

This controller is useful for one-time processing either with existing component instances or classes of components to be created for processing. In case component classes are used, for each query the controller creates, initializes and destroys instances of all components involved in the processing. For long-running applications (e.g. web applications) please consider the ControllerFactory.createCachingPooling(Class...), which offers processing component pooling and result caching.

Thread-safety of processing on instantiated component ( process(Map, Object...)) instances is not enforced in any way and must be assured externally. Processing on component classes ( process(Map, Class...)) is thread safe, but there is an additional overhead of creating new component instances for each query (which may or may not be a performance issue, this depends on a given component).


Constructor Summary
SimpleController()
          Deprecated.  
 
Method Summary
 void dispose()
          Deprecated. Shuts down this controller.
 void init(Map<String,Object> initAttributes)
          Deprecated. Initializes this controller.
 void init(Map<String,Object> attributes, ProcessingComponentConfiguration... configurations)
          Deprecated.  
 ProcessingResult process(Map<String,Object> attributes, Class<?>... processingComponentClasses)
          Deprecated. Performs processing according to the life cycle specified in IProcessingComponent.
 ProcessingResult process(Map<String,Object> attributes, Object... processingComponentClassesOrIds)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleController

public SimpleController()
Deprecated. 
Method Detail

init

public void init(Map<String,Object> initAttributes)
          throws ComponentInitializationException
Deprecated. 
Description copied from interface: IController
Initializes this controller. This method must complete successfully before any calls are made to the IController.process(Map, Class...) method.

Specified by:
init in interface IController
Parameters:
initAttributes - Init-time attributes for components instantiated in IController.process(Map, Class...).
Throws:
ComponentInitializationException

init

public void init(Map<String,Object> attributes,
                 ProcessingComponentConfiguration... configurations)
          throws ComponentInitializationException
Deprecated. 
Specified by:
init in interface IController
Throws:
ComponentInitializationException

process

public ProcessingResult process(Map<String,Object> attributes,
                                Class<?>... processingComponentClasses)
                         throws ProcessingException
Deprecated. 
Description copied from interface: IController
Performs processing according to the life cycle specified in IProcessingComponent.

Specified by:
process in interface IController
Parameters:
attributes - attributes to be used during processing. Input attributes will be transferred from this map to the corresponding fields. Output attributes will be collected and stored in this map, so the map must be modifiable. Keys of the map are computed based on the key parameter of the Attribute annotation.
processingComponentClasses - classes of components to be involved in processing in the order they should be arranged in the pipeline.
Throws:
ProcessingException

process

public ProcessingResult process(Map<String,Object> attributes,
                                Object... processingComponentClassesOrIds)
                         throws ProcessingException
Deprecated. 
Specified by:
process in interface IController
Throws:
ProcessingException

dispose

public void dispose()
Deprecated. 
Description copied from interface: IController
Shuts down this controller. No calls to IController.process(Map, Class...) must be made after invoking this method.

Specified by:
dispose in interface IController


Copyright (c) Dawid Weiss, Stanislaw Osinski