org.codehaus.gpars

groovyx.gpars.dataflow.operator.component
[Java] Class ProcessorPauseResume

java.lang.Object
  groovyx.gpars.dataflow.operator.DataflowEventAdapter
      groovyx.gpars.dataflow.operator.component.ProcessorPauseResume

public final class ProcessorPauseResume
extends DataflowEventAdapter

A listener to dataflow operators and selectors allowing them to be paused and resumed.

Authors:
Vaclav Pech


Field Summary
private boolean paused

 
Constructor Summary
ProcessorPauseResume()

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

void pause()

Pauses the operator so that it blocks the next time it attempts to process a message.

void resume()

Resumes the operator so that it can start processing messages again.

 
Methods inherited from class DataflowEventAdapter
afterRun, afterStart, afterStop, beforeRun, controlMessageArrived, customEvent, messageArrived, messageSentOut, onException, registered
 

Field Detail

paused

private boolean paused


 
Constructor Detail

ProcessorPauseResume

ProcessorPauseResume()


 
Method Detail

beforeRun

@Override
public java.util.List beforeRun(DataflowProcessor processor, java.util.List messages)


pause

public void pause()
Pauses the operator so that it blocks the next time it attempts to process a message. The operator's thread will be blocked, so care should be taken in order not to exhaust all available operator threads when pausing multiple operators.


resume

public void resume()
Resumes the operator so that it can start processing messages again.


 

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