|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object xsmeral.pipe.AbstractObjectProcessor xsmeral.pipe.LocalObjectSink<I>
I
- Input object type@ObjectProcessorInterface(in=java.lang.Object.class) public class LocalObjectSink<I>
An object processor in the role of an object sink, usually persists objects.
Can only be placed as the last processor in a processor chain.
Provides default ObjectProcessorInterface
set to Object
s.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface xsmeral.pipe.interfaces.ObjectProcessor |
---|
ObjectProcessor.Status |
Field Summary | |
---|---|
protected ObjectSource<I> |
prev
Reference to the previous processor in chain. |
Fields inherited from class xsmeral.pipe.AbstractObjectProcessor |
---|
canStart, context, status |
Constructor Summary | |
---|---|
LocalObjectSink()
|
Method Summary | |
---|---|
ObjectSource<I> |
getPrev()
Returns the previous processor in chain. |
protected void |
handleStoppedSource()
Called in case the previous processor is stopped during a read operation. |
void |
prev(ObjectSource<I> src)
Sets this processor as the next in the chain, after the given processor. |
protected void |
process()
Called by the processor itself from run() . |
protected I |
read()
Reads one object from the top of the buffer of the previous processor. |
void |
requestStop()
Requests the processor to stop and sets its status to STOPPING . |
Methods inherited from class xsmeral.pipe.AbstractObjectProcessor |
---|
canStart, failStart, failStart, failStart, getContext, getInType, getOutType, getParams, getStatus, initContext, initContextSet, initialize, initializeInternal, initPostContext, initWithContext, postRun, preRun, run, setContext, stop, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface xsmeral.pipe.interfaces.ObjectSink |
---|
getInType |
Field Detail |
---|
protected ObjectSource<I> prev
Constructor Detail |
---|
public LocalObjectSink()
Method Detail |
---|
protected final I read() throws ProcessorStoppedException
SourceStoppedException
- If the previous processor is in
STOPPED
state.
Calls handleStoppedSource()
immediately before throwing.
ProcessorStoppedException
public final void prev(ObjectSource<I> src)
ObjectSink
prev
in interface ObjectSink<I>
src
- The previous processorpublic final ObjectSource<I> getPrev()
ObjectSink
getPrev
in interface ObjectSink<I>
public final void requestStop()
ObjectProcessor
STOPPING
.
There is no limit to the time it takes the processor to stop, it should
however stop as soon as possible.
requestStop
in interface ObjectProcessor
requestStop
in class AbstractObjectProcessor
protected void handleStoppedSource()
read
operation.
protected void process() throws ProcessorStoppedException
run()
.
Should process one object and return.
More information in description of AbstractObjectProcessor
class, section "Running".
This implementation is empty and should be overridden.
process
in class AbstractObjectProcessor
ProcessorStoppedException
- If a neighboring processor has stopped.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |