gov.sns.ca
Class PendDaemon

java.lang.Object
  |
  +--gov.sns.ca.PendDaemon
All Implemented Interfaces:
java.lang.Runnable

public class PendDaemon
extends java.lang.Object
implements java.lang.Runnable

This class maintains a single instance of a daemon thread that continually polls channel access. This is primarily useful for process variable monitors where channel access needs to be polled to catch incoming events. Since there need only be only daemon running to do this for any number of monitors PendDaemon maintains a reference count on the number of processes requesting polling. Any process desiring polling should call the static start() method; once polling is not longer needed the process must then call the release() method, which decrements the reference count.


Field Summary
static double s_dblDefDurPoll
           
static long s_lngDefInterval
           
 
Method Summary
static void release()
          Remove dependency reference and terminate daemon if final reference
 void run()
          Periodically poll channel access until run flag clears
static void setInterval(long lngInterval)
          Set the interval between channel access polling (PendEvent)
static void start()
          Start the polling daemon and/or add a dependency reference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_lngDefInterval

public static long s_lngDefInterval

s_dblDefDurPoll

public static double s_dblDefDurPoll
Method Detail

start

public static void start()
Start the polling daemon and/or add a dependency reference


release

public static void release()
Remove dependency reference and terminate daemon if final reference


setInterval

public static void setInterval(long lngInterval)
Set the interval between channel access polling (PendEvent)

Parameters:
lngInterval - polling interval in milliseconds

run

public void run()
Periodically poll channel access until run flag clears

Specified by:
run in interface java.lang.Runnable