Class AbstractProcessorDecorator<TDef extends IElementDef>
- java.lang.Object
-
- org.webharvest.runtime.processors.AbstractProcessorDecorator<TDef>
-
- Type Parameters:
TDef
- type of definition of decorated processor
- All Implemented Interfaces:
Processor<TDef>
- Direct Known Subclasses:
RunningStatusController
,StoppedOrExitedProcessor
public abstract class AbstractProcessorDecorator<TDef extends IElementDef> extends Object implements Processor<TDef>
Abstract implementation ofProcessor
interface which realizes Decorator design pattern and overrides almost allProcessor
's methods (without #run() method) in the default way. It means that invocation ofProcessor
's method is delegated to decorated processor. This class could be really helpful when only #run() method should be decorated in special way.- Since:
- 2.1-SNAPSHOT
- Version:
- %I%, %G%
- Author:
- mczapiewski
-
-
Field Summary
Fields Modifier and Type Field Description protected Processor<TDef>
decoratedProcessor
-
Constructor Summary
Constructors Constructor Description AbstractProcessorDecorator(Processor<TDef> decoratedProcessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TDef
getElementDef()
Processor
getParentProcessor()
Returns reference to parentProcessor
of this processor.int
getRunningLevel()
Returns information how deep in processors hierarchy is thisProcessor
.void
setElementDef(TDef elementDef)
Sets appropriate element definition to the processor.void
setParentProcessor(Processor parentProcessor)
Sets reference to parentProcessor
.
-
-
-
Field Detail
-
decoratedProcessor
protected final Processor<TDef extends IElementDef> decoratedProcessor
-
-
Method Detail
-
setElementDef
public void setElementDef(TDef elementDef)
Sets appropriate element definition to the processor.- Specified by:
setElementDef
in interfaceProcessor<TDef extends IElementDef>
- Parameters:
elementDef
- the element definition
-
getElementDef
public TDef getElementDef()
- Specified by:
getElementDef
in interfaceProcessor<TDef extends IElementDef>
-
getParentProcessor
public Processor getParentProcessor()
Returns reference to parentProcessor
of this processor.- Specified by:
getParentProcessor
in interfaceProcessor<TDef extends IElementDef>
-
setParentProcessor
public void setParentProcessor(Processor parentProcessor)
Sets reference to parentProcessor
.- Specified by:
setParentProcessor
in interfaceProcessor<TDef extends IElementDef>
-
getRunningLevel
public int getRunningLevel()
Returns information how deep in processors hierarchy is thisProcessor
. Value of the lowest level is1
.- Specified by:
getRunningLevel
in interfaceProcessor<TDef extends IElementDef>
-
-