edu.uci.isr.yancees.server.rmi
Class RemoteYanceesImplementation.NotificationBuffer

java.lang.Object
  extended byjava.lang.Thread
      extended byedu.uci.isr.yancees.server.rmi.RemoteYanceesImplementation.NotificationBuffer
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
RemoteYanceesImplementation

protected class RemoteYanceesImplementation.NotificationBuffer
extends java.lang.Thread

This buffer schedules events to be notified. The aim is to cope with scalability and high throughput, in order to publish a bunch of events at onnce, instead of one at a time. This strategy better utilizes the RMI serialization mechanisms and icreases the throughput of the server. A big buffer will allow the server to handle more publish commands per second. However, it will reduce the latency (the time between production and delivery of an event). A low SLEEP_TIME will not permit the buffer to get full, and will reduce the throughput.

Author:
Roberto Silveira Silva Filho [rsilvafi@ics.uci.edu]

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RemoteYanceesImplementation.NotificationBuffer(RemoteSubscriberInterface remInt, RemoteYanceesImplementation.SubscriberMediator med)
           
 
Method Summary
 void addEventToBuffer(EventInterface event)
          Method used by the clients of this class to enqueue events in the buffer
 EventInterface getEventFromBuffer()
          This method should be called when there is some event on the buffer, otherwise, it returns null
 void run()
          Main logic of this thread
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteYanceesImplementation.NotificationBuffer

public RemoteYanceesImplementation.NotificationBuffer(RemoteSubscriberInterface remInt,
                                                      RemoteYanceesImplementation.SubscriberMediator med)
Method Detail

run

public void run()
Main logic of this thread


addEventToBuffer

public void addEventToBuffer(EventInterface event)
Method used by the clients of this class to enqueue events in the buffer

Parameters:
event -

getEventFromBuffer

public EventInterface getEventFromBuffer()
This method should be called when there is some event on the buffer, otherwise, it returns null

Returns:
null if buffer is empty, the element in FIFO order, in case there is at least one element on it.