|
Carrot2 v3.6.0-SNAPSHOT
API Documentation |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.carrot2.core.CachingProcessingComponentManager
public class CachingProcessingComponentManager
An IProcessingComponentManager that implements processing results caching
functionality.
This manager wraps some delegate manager (e.g. a
SimpleProcessingComponentManager or a PoolingProcessingComponentManager
) and wraps the components the delegate with a functionality that either returns the
results from cache or performs the processing if the result are not yet cached.
| Constructor Summary | |
|---|---|
CachingProcessingComponentManager(IProcessingComponentManager delegate,
Class<? extends IProcessingComponent>... cachedComponentClasses)
Creates a CachingProcessingComponentManager. |
|
| Method Summary | |
|---|---|
void |
dispose()
Called upon disposal of the controller. |
Map<String,Object> |
getStatistics()
Called when the controller is requested to provide current statistics. |
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 |
|---|
public CachingProcessingComponentManager(IProcessingComponentManager delegate,
Class<? extends IProcessingComponent>... cachedComponentClasses)
CachingProcessingComponentManager.
delegate - the manager to handle the preparation of the actual processing
component instancescachedComponentClasses - 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(IControllerContext context,
Map<String,Object> attributes,
ProcessingComponentConfiguration... configurations)
IProcessingComponentManagerController.
init in interface IProcessingComponentManagercontext - controller contextattributes - global initialization attributes provided to the controllerconfigurations - component configurations provided to the controller
public IProcessingComponent prepare(Class<? extends IProcessingComponent> clazz,
String id,
Map<String,Object> inputAttributes,
Map<String,Object> outputAttributes)
IProcessingComponentManager
prepare in interface IProcessingComponentManagerclazz - class of the component to prepareid - 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
public void recycle(IProcessingComponent component,
String id)
IProcessingComponentManager
recycle in interface IProcessingComponentManagercomponent - Component instance returned from IProcessingComponentManager.prepare(java.lang.Class extends org.carrot2.core.IProcessingComponent>, 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 extends org.carrot2.core.IProcessingComponent>, java.lang.String, java.util.Map, java.util.Map) . May be null.public void dispose()
IProcessingComponentManager
dispose in interface IProcessingComponentManagerpublic Map<String,Object> getStatistics()
|
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 | ||||||||