wt.queue
Class QueueWatcher

java.lang.Object
  extended bywt.queue.QueueWatcher

public class QueueWatcher
extends Object

This class holds the threads and state associated with running a particular queue


Field Summary
private static long DEFAULT_INTERVAL
           
(package private)  WtQueue q
           
(package private)  boolean queueEnabled
           
private  QueueMonitorHelper queueMonitorHelper
           
(package private)  String queueName
           
private static boolean REFRESH_VERBOSE
           
(package private)  Thread runner
           
private static boolean RUNNER_CHECK
           
(package private)  boolean startRunner
           
(package private)  boolean thisHost
           
private static boolean UPDATE_VERBOSE
           
private static boolean VERBOSE
           
 
Constructor Summary
QueueWatcher(WtQueue queue, boolean enabled, boolean host)
          Constructor

Supported API: false
 
Method Summary
 boolean activeRunnerThread()
          returns the active state of the process thread

Supported API: false
 String getName()
          returns the queue name

Supported API: false
private  QueueMonitorHelper getQMHelper()
          Method which establishes and return an instance of QueueMonitorHelper

Supported API: false
 WtQueue getQueue()
          returns the queue instance held by this QueueWatcher

Supported API: false
 boolean getQueueEnabled()
          returns the queues enabled status for this watcher

Supported API: false
 Thread getRunner()
          returns the process thread associated with this queue

Supported API: false
 boolean getStartRunner()
          get start runner thread enable flag
 boolean getThisQueueHost()
          returns a boolean indicating whether this queue is run on this host

Supported API: false
 boolean okToMonitor()
          Test to see if its ok to monitor this queue

Supported API: false
private  void refreshQueueWatcher(WtQueue queue)
          Synchronized method which refreshes the queue instance held by this queue watcher

Supported API: false
 void setQueueEnabled(boolean enable)
          sets the queues enabled status for this watcher

Supported API: false
private  void setQueueState(WtQueue queue, String state)
          method which sets and saves a queues running state

Supported API: false
 void startProcessing()
          method which wakes up the process thread for this queue

Supported API: false
 void startQueue()
          starts this queue by creating and starting a process thread for the queue.
 void startQueueRunner(boolean value)
          set start runner thread enable flag
 void stopQueue()
          stops the queue eliminating the associated process thred

Supported API: false
 void updateState(WtQueue queue)
          update a queues state information

Supported API: false
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERBOSE

private static boolean VERBOSE

UPDATE_VERBOSE

private static boolean UPDATE_VERBOSE

REFRESH_VERBOSE

private static boolean REFRESH_VERBOSE

RUNNER_CHECK

private static boolean RUNNER_CHECK

DEFAULT_INTERVAL

private static long DEFAULT_INTERVAL

queueMonitorHelper

private QueueMonitorHelper queueMonitorHelper

queueName

String queueName

q

WtQueue q

queueEnabled

boolean queueEnabled

thisHost

boolean thisHost

runner

Thread runner

startRunner

boolean startRunner
Constructor Detail

QueueWatcher

public QueueWatcher(WtQueue queue,
                    boolean enabled,
                    boolean host)
Constructor

Supported API: false

Parameters:
queue -
enabled -
host -
Method Detail

refreshQueueWatcher

private void refreshQueueWatcher(WtQueue queue)
                          throws WTException
Synchronized method which refreshes the queue instance held by this queue watcher

Supported API: false

Throws:
WTException

getQMHelper

private QueueMonitorHelper getQMHelper()
Method which establishes and return an instance of QueueMonitorHelper

Supported API: false

Returns:
QueueMonitorHelper

okToMonitor

public boolean okToMonitor()
Test to see if its ok to monitor this queue

Supported API: false

Returns:
boolean

setQueueEnabled

public void setQueueEnabled(boolean enable)
sets the queues enabled status for this watcher

Supported API: false


getQueueEnabled

public boolean getQueueEnabled()
returns the queues enabled status for this watcher

Supported API: false

Returns:
boolean

getThisQueueHost

public boolean getThisQueueHost()
returns a boolean indicating whether this queue is run on this host

Supported API: false

Returns:
boolean

getName

public String getName()
returns the queue name

Supported API: false

Returns:
String

getQueue

public WtQueue getQueue()
returns the queue instance held by this QueueWatcher

Supported API: false

Returns:
WtQueue

getRunner

public Thread getRunner()
returns the process thread associated with this queue

Supported API: false

Returns:
WtQueue

activeRunnerThread

public boolean activeRunnerThread()
returns the active state of the process thread

Supported API: false

Returns:
WtQueue

startQueueRunner

public void startQueueRunner(boolean value)
set start runner thread enable flag


getStartRunner

public boolean getStartRunner()
get start runner thread enable flag


startQueue

public void startQueue()
                throws WTException
starts this queue by creating and starting a process thread for the queue. Currently process threads are either Polling or Scheduled

Supported API: false

Throws:
WTException

stopQueue

public void stopQueue()
               throws WTException
stops the queue eliminating the associated process thred

Supported API: false

Throws:
WTException

updateState

public void updateState(WtQueue queue)
                 throws WTException
update a queues state information

Supported API: false

Throws:
WTException

startProcessing

public void startProcessing()
                     throws WTException
method which wakes up the process thread for this queue

Supported API: false

Throws:
WTException

setQueueState

private void setQueueState(WtQueue queue,
                           String state)
                    throws WTException
method which sets and saves a queues running state

Supported API: false

Parameters:
queue -
state -
Throws:
WTException