|
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.CachingController
ControllerFactory.createCachingPooling(Class...) 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 CachingController
A controller implementing the life cycle described in IProcessingComponent with
support for component pooling and, optionally, data caching.
Calls to process(Map, Class...) are thread-safe, although some care should be
given to initialization: init(Map) should be called before other threads are
allowed to see this object and dispose() should be called after all threads
leave process(Map, Class...).
Notice for IProcessingComponent developers: if data caching is used (see
CachingController(Class...)), values of Output attributes produced by
the components whose output is to be cached (e.g., the Document instances in
case IDocumentSource output is cached) may be accessed concurrently and
therefore must be thread-safe.
| Constructor Summary | |
|---|---|
CachingController(Class<? extends IProcessingComponent>... cachedComponentClasses)
Deprecated. Creates a new caching controller. |
|
CachingController(IParameterizedPool<IProcessingComponent,String> componentPool,
Class<? extends IProcessingComponent>... cachedComponentClasses)
Deprecated. Creates a new caching controller with a custom implementation of the component pool. |
|
| 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 CachingController(Class<? extends IProcessingComponent>... cachedComponentClasses)
cachedComponentClasses - classes of components whose output should be cached
by the controller. If a superclass is provided here, e.g.
IDocumentSource, all its subclasses will be subject to caching.
If IProcessingComponent is provided here, output of all
components will be cached.
public CachingController(IParameterizedPool<IProcessingComponent,String> componentPool,
Class<? extends IProcessingComponent>... cachedComponentClasses)
componentPool - the component pool to be used by the controllercachedComponentClasses - classes of components whose output should be cached
by the controller. If a superclass is provided here, e.g.
IDocumentSource, all its subclasses will be subject to caching.
If IProcessingComponent is provided here, output of all
components will be cached.| 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 | ||||||||