|
Carrot2 v3.3.0
API Documentation |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.carrot2.core.SimpleController
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
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 |
|---|
public SimpleController()
| Method Detail |
|---|
public void init(Map<String,Object> initAttributes)
throws ComponentInitializationException
IControllerIController.process(Map, Class...) method.
init in interface IControllerinitAttributes - Init-time attributes for components instantiated in
IController.process(Map, Class...).
ComponentInitializationException
public void init(Map<String,Object> attributes,
ProcessingComponentConfiguration... configurations)
throws ComponentInitializationException
init in interface IControllerComponentInitializationException
public ProcessingResult process(Map<String,Object> attributes,
Class<?>... processingComponentClasses)
throws ProcessingException
IControllerIProcessingComponent.
process in interface IControllerattributes - 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.
ProcessingException
public ProcessingResult process(Map<String,Object> attributes,
Object... processingComponentClassesOrIds)
throws ProcessingException
process in interface IControllerProcessingExceptionpublic void dispose()
IControllerIController.process(Map, Class...) must be
made after invoking this method.
dispose in interface IController
|
Please refer to project documentation at
http://project.carrot2.org |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||