bamboo.lss
Class DustDevilSink

java.lang.Object
  extended by bamboo.lss.DustDevilSink
All Implemented Interfaces:
SinkIF

public class DustDevilSink
extends Object
implements SinkIF

Part of faking out Sandstorm.

Version:
$Id: DustDevilSink.java,v 1.5 2004/07/15 19:14:57 srhea Exp $
Author:
Sean C. Rhea

Field Summary
protected  EventHandlerIF handler
           
protected  int hash_code
           
protected static org.apache.log4j.Logger logger
           
protected static int next_hash_code
           
protected  long next_key
           
protected  Map prepares
           
static byte[] reserve
           
protected  Thread thread
           
 
Constructor Summary
DustDevilSink(EventHandlerIF h, Thread t)
          Create a new sink that sends all events to the given EventHandlerIF; the thread t is a guard--the functions of this class may not be called from any other thread.
 
Method Summary
protected  void check_thread()
           
 void enqueue_abort(Object key)
           
 void enqueue_commit(Object key)
           
 boolean enqueue_lossy(QueueElementIF event)
           
 void enqueue_many(QueueElementIF[] events)
           
 Object enqueue_prepare(QueueElementIF[] e)
           
 void enqueue(QueueElementIF event)
           
 EnqueuePredicateIF getEnqueuePredicate()
           
 EventHandlerIF getHandler()
           
 int hashCode()
           
 void setEnqueuePredicate(EnqueuePredicateIF pred)
           
 int size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

reserve

public static byte[] reserve

logger

protected static org.apache.log4j.Logger logger

next_hash_code

protected static int next_hash_code

hash_code

protected final int hash_code

thread

protected final Thread thread

handler

protected final EventHandlerIF handler

prepares

protected Map prepares

next_key

protected long next_key
Constructor Detail

DustDevilSink

public DustDevilSink(EventHandlerIF h,
                     Thread t)
Create a new sink that sends all events to the given EventHandlerIF; the thread t is a guard--the functions of this class may not be called from any other thread. This restriction prevents programming errors. This constructor is not thread safe; since these objects should only be created within the DustDevil, that shouldn't be a problem.

Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class Object

enqueue

public void enqueue(QueueElementIF event)
             throws SinkException
Specified by:
enqueue in interface SinkIF
Throws:
SinkException

enqueue_lossy

public boolean enqueue_lossy(QueueElementIF event)
Specified by:
enqueue_lossy in interface SinkIF

enqueue_many

public void enqueue_many(QueueElementIF[] events)
                  throws SinkException
Specified by:
enqueue_many in interface SinkIF
Throws:
SinkException

enqueue_prepare

public Object enqueue_prepare(QueueElementIF[] e)
                       throws SinkException
Specified by:
enqueue_prepare in interface SinkIF
Throws:
SinkException

enqueue_commit

public void enqueue_commit(Object key)
Specified by:
enqueue_commit in interface SinkIF

enqueue_abort

public void enqueue_abort(Object key)
Specified by:
enqueue_abort in interface SinkIF

setEnqueuePredicate

public void setEnqueuePredicate(EnqueuePredicateIF pred)
Specified by:
setEnqueuePredicate in interface SinkIF

getEnqueuePredicate

public EnqueuePredicateIF getEnqueuePredicate()
Specified by:
getEnqueuePredicate in interface SinkIF

size

public int size()
Specified by:
size in interface SinkIF

toString

public String toString()
Overrides:
toString in class Object

getHandler

public EventHandlerIF getHandler()

check_thread

protected void check_thread()