org.codehaus.gpars

groovyx.gpars.dataflow.operator
[Java] Class DataflowEventAdapter

java.lang.Object
  groovyx.gpars.dataflow.operator.DataflowEventAdapter
All Implemented Interfaces:
DataflowEventListener

public class DataflowEventAdapter

A default empty implementation of DataflowEventListener

Authors:
Vaclav Pech


Constructor Summary
DataflowEventAdapter()

 
Method Summary
void afterRun(DataflowProcessor processor, java.util.List messages)

Invoked when the fireCustomEvent() method is triggered manually on a dataflow operator/selector.

void afterStart(DataflowProcessor processor)

void afterStop(DataflowProcessor processor)

java.util.List beforeRun(DataflowProcessor processor, java.util.List messages)

Invoked when the operator completes a single run.

java.lang.Object controlMessageArrived(DataflowProcessor processor, DataflowReadChannel channel, int index, java.lang.Object message)

Invoked when a message is being bound to an output channel.

java.lang.Object customEvent(DataflowProcessor processor, java.lang.Object data)

java.lang.Object messageArrived(DataflowProcessor processor, DataflowReadChannel channel, int index, java.lang.Object message)

Invoked when a control message (instances of ControlMessage) becomes available in an input channel.

java.lang.Object messageSentOut(DataflowProcessor processor, DataflowWriteChannel channel, int index, java.lang.Object message)

Invoked when all messages required to trigger the operator become available in the input channels.

boolean onException(DataflowProcessor processor, java.lang.Throwable e)

Invoked when a message becomes available in an input channel.

void registered(DataflowProcessor processor)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

DataflowEventAdapter

DataflowEventAdapter()


 
Method Detail

afterRun

@java.lang.Overridereturn data;
public void afterRun(DataflowProcessor processor, java.util.List messages)
Invoked when the fireCustomEvent() method is triggered manually on a dataflow operator/selector. This implementation returns the original piece of data. When using maxForks, the method may be invoked from threads running the forks.
Parameters:
processor - The reporting dataflow operator/selector
data - The custom piece of data provided as part of the event
Returns:
A value to return from the fireCustomEvent() method to the caller (event initiator)


afterStart

@java.lang.Override* If any of the listeners returns true, the operator will terminate.
public void afterStart(DataflowProcessor processor)


afterStop

@java.lang.Overridepublic boolean onException(final DataflowProcessor processor, final Throwable e) {
public void afterStop(DataflowProcessor processor)


beforeRun

@java.lang.Override
public java.util.List beforeRun(DataflowProcessor processor, java.util.List messages)
Invoked when the operator completes a single run. When using maxForks, the method may be invoked from threads running the forks.
Parameters:
processor - The reporting dataflow operator/selector
messages - The incoming messages that have been processed


controlMessageArrived

@java.lang.Override
public java.lang.Object controlMessageArrived(DataflowProcessor processor, DataflowReadChannel channel, int index, java.lang.Object message)
Invoked when a message is being bound to an output channel. When using maxForks, the method may be invoked from threads running the forks.
Parameters:
processor - The reporting dataflow operator/selector
channel - The output channel to send the message to
index - The index of the output channel within the operator
message - The message to send
Returns:
The original message or a message that should be used instead


customEvent

@java.lang.Override
public java.lang.Object customEvent(DataflowProcessor processor, java.lang.Object data)


messageArrived

@java.lang.Overridepublic Object controlMessageArrived(final DataflowProcessor processor, final DataflowReadChannel channel, final int index, final Object message) {
public java.lang.Object messageArrived(DataflowProcessor processor, DataflowReadChannel channel, int index, java.lang.Object message)
        
Invoked when a control message (instances of ControlMessage) becomes available in an input channel.
Parameters:
processor - The reporting dataflow operator/selector
channel - The input channel holding the message
index - The index of the input channel within the operator
message - The incoming message
Returns:
The original message or a message that should be used instead


messageSentOut

@java.lang.Override}
public java.lang.Object messageSentOut(DataflowProcessor processor, DataflowWriteChannel channel, int index, java.lang.Object message)
Invoked when all messages required to trigger the operator become available in the input channels.
Parameters:
processor - The reporting dataflow operator/selector
messages - The incoming messages
Returns:
The original list of messages or a modified/new list of messages that should be used instead


onException

@java.lang.Overridepublic Object messageArrived(final DataflowProcessor processor, final DataflowReadChannel channel, final int index, final Object message) {
public boolean onException(DataflowProcessor processor, java.lang.Throwable e)
        
Invoked when a message becomes available in an input channel.
Parameters:
processor - The reporting dataflow operator/selector
channel - The input channel holding the message
index - The index of the input channel within the operator
message - The incoming message
Returns:
The original message or a message that should be used instead


registered

@java.lang.Override* @param processor The reporting dataflow operator/selector
public void registered(DataflowProcessor processor)


 

Copyright © 2008–2013 Václav Pech. All Rights Reserved.