groovyx.gpars.dataflow.operator
Class PoisonPill

java.lang.Object
  extended by groovyx.gpars.dataflow.operator.PoisonPill
All Implemented Interfaces:
ControlMessage
Direct Known Subclasses:
CountingPoisonPill, ImmediateCountingPoisonPill

public class PoisonPill
extends java.lang.Object
implements ControlMessage

Represents the poison for dataflow operators. After receiving the poison a dataflow operator will send the poisson to all its output channels and terminate. Non=immediate poison will allow selectors to keep processing all remaining inputs until these get also poisoned. There§s no difference in behavior between immediate and non=immediate poison pills when obtained bz an operator.

Author:
Vaclav Pech Date: Oct 6, 2010

Field Summary
private  boolean immediate
           
private static PoisonPill immediateInstance
           
private static PoisonPill ourInstance
           
 
Constructor Summary
PoisonPill()
           
PoisonPill(boolean immediate)
           
 
Method Summary
(package private)  void countDown()
           
static PoisonPill getImmediateInstance()
          Retrieves an immediate poison pill instance
static PoisonPill getInstance()
          Retrieves a non-immediate poison pill instance
 boolean isImmediate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ourInstance

private static final PoisonPill ourInstance

immediateInstance

private static final PoisonPill immediateInstance

immediate

private final boolean immediate
Constructor Detail

PoisonPill

PoisonPill()

PoisonPill

PoisonPill(boolean immediate)
Method Detail

getInstance

public static PoisonPill getInstance()
Retrieves a non-immediate poison pill instance

Returns:
The shared singleton non-immediate poison pill instance

getImmediateInstance

public static PoisonPill getImmediateInstance()
Retrieves an immediate poison pill instance

Returns:
The shared singleton immediate poison pill instance

isImmediate

public final boolean isImmediate()

countDown

void countDown()

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