edu.uci.isr.yancees.server.plugin.protocol.polling
Class PollProtocolPlugin.PollingMechanism

java.lang.Object
  extended byjava.lang.Thread
      extended byedu.uci.isr.yancees.server.plugin.protocol.polling.PollProtocolPlugin.PollingMechanism
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
PollProtocolPlugin

protected class PollProtocolPlugin.PollingMechanism
extends java.lang.Thread

Implements a thread that periodically polls all the pull plug-ins under the provides subscriber interface and publishes the output of this plug-in using the events stored in the pull plug-ins.


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
PollProtocolPlugin.PollingMechanism(SubscriberInterface rsi)
           
PollProtocolPlugin.PollingMechanism(SubscriberInterface rsi, int interval)
           
 
Method Summary
 GenericEvent[] collectPullEvents()
          Colelcts all the evens stored in pull plug-ins for the current subscriber
 void pausePolling()
           
 void resumePolling()
           
 void run()
          Infinite loop that collects the events for the current subscriber, periodically, according to the pollInterval.
 void setPollInterval(int interval)
           
 void terminate()
           
 
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

PollProtocolPlugin.PollingMechanism

public PollProtocolPlugin.PollingMechanism(SubscriberInterface rsi,
                                           int interval)

PollProtocolPlugin.PollingMechanism

public PollProtocolPlugin.PollingMechanism(SubscriberInterface rsi)
Method Detail

run

public void run()
Infinite loop that collects the events for the current subscriber, periodically, according to the pollInterval. It publishes the output using the appropriate plug-in method.


collectPullEvents

public GenericEvent[] collectPullEvents()
Colelcts all the evens stored in pull plug-ins for the current subscriber

Returns:
the list of events stored in the server (pull notificatoin plug-ins) for the current subscriber.

pausePolling

public void pausePolling()

resumePolling

public void resumePolling()

setPollInterval

public void setPollInterval(int interval)

terminate

public void terminate()