wt.queue
Class StandardQueueService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.queue.StandardQueueService
All Implemented Interfaces:
Manager, NetFactor, QueueService, Serializable

public class StandardQueueService
extends StandardManager
implements QueueService, Serializable

Standard implementation of the QueueService interface.

Use the newStandardQueueService static factory method(s), not the StandardQueueService constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: false

See Also:
Serialized Form

Nested Class Summary
(package private)  class StandardQueueService.AllManagersStartedEventListener
           
 
Field Summary
private  StandardQueueService.AllManagersStartedEventListener allManagersStartedListener
           
private static String CLASSNAME
           
private static long DEFAULT_INTERVAL
          Default wait/sleep interval to be used for all created queues.
private static boolean EXECUTE_QUEUES
           
private static int MAX_PROCESS_QUEUES
           
private static int MAX_SCHEDULE_QUEUES
           
private static String PROCESS_Q
           
private static String Q_RESOURCE
           
private  QueueMonitorHelper queueMonitorHelper
           
private static String RESOURCE
           
private static String SCHEDULE_Q
           
private  StandardQueueMonitor standardQueueMonitor
           
private static boolean VERBOSE
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardQueueService()
           
 
Method Summary
private  int countQueues(Class type)
           
 ProcessingQueue createQueue(String queue_name)
          Creates a new queue given its name.
 ProcessingQueue createQueue(String queue_name, String host)
          Creates a new queue given its name.
 ScheduleQueue createScheduleQueue(String queue_name)
          

Supported API: false
 ScheduleQueue createScheduleQueue(String queue_name, String host)
          

Supported API: false
 void deleteEntries(ProcessingQueue queue)
          Deletes all entries of a specified tree.
 void deleteEntries(ProcessingQueue queue, String status_code)
          Deletes all entries that have the status code specified.
 void deleteEntries(ScheduleQueue queue)
          

Supported API: false
 void deleteEntries(ScheduleQueue queue, String status_code)
          

Supported API: false
 void deleteEntry(QueueInfo qi, QueueEntryInfo qei)
          

Supported API: false
 ProcessingQueue deleteQueue(ProcessingQueue queue)
          Deletes the queue given its name.
 ScheduleQueue deleteQueue(ScheduleQueue queue)
          

Supported API: false
 void enableQueue(ProcessingQueue queue, boolean desired)
          

Supported API: false
 void enableQueue(ScheduleQueue queue, boolean desired)
          

Supported API: false
 void executeEntry(QueueEntry entry)
          Execute the entry passed as argument.
 boolean executeQueues()
           
 String getConceptualClassname()
          Deprecated.  
 long getInterval(ProcessingQueue queue)
          Retrieves the waiting/sleeping interval of the queue passed as argument.
 ProcessingQueue getQueue(String queue_name)
          

Supported API: false
 WtQueue getQueue(String queue_name, Class queue_type)
          

Supported API: false
 boolean isActive(ProcessingQueue queue)
          Retuns 'true' if queue has been started (and not stoppped).
 boolean isActive(ScheduleQueue queue)
          

Supported API: false
static StandardQueueService newStandardQueueService()
          

Supported API: false
protected  void performStartupProcess()
          Performs start up initialization -- creating the thread table in this case.
 Enumeration queueEntries(ProcessingQueue queue)
          Returns all queue entries as an enumeration.
 Enumeration queueEntries(ProcessingQueue queue, String status_code)
          Returns all existing queue entries that are in the state passed as argument.
 Enumeration queueEntries(ProcessingQueue queue, Vector status_codes)
          

Supported API: false
 Enumeration queueEntries(ScheduleQueue queue)
          

Supported API: false
 Enumeration queueEntries(ScheduleQueue queue, String status_code)
          

Supported API: false
 Enumeration queues()
          Returns all existing queues (active or not).
 Enumeration queues(Class queue_type)
          

Supported API: false
 void resetQueueEntry(ProcessingQueue queue, String entry_num)
          

Supported API: false
 void resetQueueEntry(ScheduleQueue queue)
          

Supported API: false
 void setExceptionRetries(WtQueue queue, String retries)
          

Supported API: false
 void setFailureNotificationEmail(WtQueue queue, String email)
          

Supported API: false
 void setInterval(ProcessingQueue queue, long interval)
          Establishes the wait/sleep interval for a specific queue.
 void setPollingInterval(WtQueue queue, String interval)
          

Supported API: false
 void setQueueExecutionHost(ProcessingQueue queue, String host)
          

Supported API: false
 void setQueueExecutionHost(ScheduleQueue queue, String host)
          

Supported API: false
 void setSuspendDuration(WtQueue queue, String duration)
          

Supported API: false
 void startAllQueues()
          Starts all existing queues.
 void startProcessing(ProcessingQueue queue)
          Starts immediate processing for a specified queue.
 void startProcessing(ScheduleQueue queue)
          

Supported API: false
 void startQueue(ProcessingQueue queue)
          Starts a specific queue.
 void startQueue(ScheduleQueue queue)
          

Supported API: true
 void startQueueProcessing(String queueName)
          

Supported API: false
 void stopAllQueues()
          Stops all existing queues.
 void stopQueue(ProcessingQueue queue)
          Stops a specific queue.
 void stopQueue(ScheduleQueue queue)
          

Supported API: true
 void updateQueueEntry(WtQueue queue, UpdateEntry entryInfo)
          

Supported API: false
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, registerEvents, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

DEFAULT_INTERVAL

private static final long DEFAULT_INTERVAL
Default wait/sleep interval to be used for all created queues. This value can be overwritten by the setInterval method.


VERBOSE

private static boolean VERBOSE

EXECUTE_QUEUES

private static boolean EXECUTE_QUEUES

MAX_PROCESS_QUEUES

private static int MAX_PROCESS_QUEUES

MAX_SCHEDULE_QUEUES

private static int MAX_SCHEDULE_QUEUES

standardQueueMonitor

private StandardQueueMonitor standardQueueMonitor

queueMonitorHelper

private QueueMonitorHelper queueMonitorHelper

allManagersStartedListener

private StandardQueueService.AllManagersStartedEventListener allManagersStartedListener

Q_RESOURCE

private static final String Q_RESOURCE
See Also:
Constant Field Values

PROCESS_Q

private static final String PROCESS_Q
See Also:
Constant Field Values

SCHEDULE_Q

private static final String SCHEDULE_Q
See Also:
Constant Field Values
Constructor Detail

StandardQueueService

public StandardQueueService()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

newStandardQueueService

public static StandardQueueService newStandardQueueService()
                                                    throws WTException


Supported API: false

Returns:
StandardQueueService
Throws:
WTException

performStartupProcess

protected void performStartupProcess()
                              throws ManagerException
Performs start up initialization -- creating the thread table in this case.

Supported API: false

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

queues

public Enumeration queues()
                   throws WTException
Returns all existing queues (active or not).

Supported API: true

Specified by:
queues in interface QueueService
Returns:
Enumeration
Throws:
WTException

queues

public Enumeration queues(Class queue_type)
                   throws WTException


Supported API: false

Specified by:
queues in interface QueueService
Parameters:
queue_type -
Returns:
Enumeration
Throws:
WTException

getQueue

public ProcessingQueue getQueue(String queue_name)
                         throws WTException


Supported API: false

Specified by:
getQueue in interface QueueService
Parameters:
queue_name -
Returns:
ProcessingQueue
Throws:
WTException

getQueue

public WtQueue getQueue(String queue_name,
                        Class queue_type)
                 throws WTException


Supported API: false

Specified by:
getQueue in interface QueueService
Parameters:
queue_name -
queue_type -
Returns:
WtQueue
Throws:
WTException

startAllQueues

public void startAllQueues()
                    throws WTException
Starts all existing queues.

Supported API: true

Specified by:
startAllQueues in interface QueueService
Throws:
WTException

stopAllQueues

public void stopAllQueues()
                   throws WTException
Stops all existing queues.

Supported API: true

Specified by:
stopAllQueues in interface QueueService
Throws:
WTException

enableQueue

public void enableQueue(ProcessingQueue queue,
                        boolean desired)
                 throws WTException


Supported API: false

Specified by:
enableQueue in interface QueueService
Parameters:
queue -
desired -
Throws:
WTException

enableQueue

public void enableQueue(ScheduleQueue queue,
                        boolean desired)
                 throws WTException


Supported API: false

Specified by:
enableQueue in interface QueueService
Parameters:
queue -
desired -
Throws:
WTException

createQueue

public ProcessingQueue createQueue(String queue_name)
                            throws WTException
Creates a new queue given its name.

Supported API: false

Specified by:
createQueue in interface QueueService
Parameters:
queue_name -
Returns:
ProcessingQueue
Throws:
WTException

createScheduleQueue

public ScheduleQueue createScheduleQueue(String queue_name)
                                  throws WTException


Supported API: false

Specified by:
createScheduleQueue in interface QueueService
Parameters:
queue_name -
Returns:
ScheduleQueue
Throws:
WTException

deleteQueue

public ProcessingQueue deleteQueue(ProcessingQueue queue)
                            throws WTException
Deletes the queue given its name.

Supported API: false

Specified by:
deleteQueue in interface QueueService
Parameters:
queue -
Returns:
ProcessingQueue
Throws:
WTException

deleteQueue

public ScheduleQueue deleteQueue(ScheduleQueue queue)
                          throws WTException


Supported API: false

Specified by:
deleteQueue in interface QueueService
Parameters:
queue -
Returns:
ScheduleQueue
Throws:
WTException

isActive

public boolean isActive(ProcessingQueue queue)
                 throws WTException
Retuns 'true' if queue has been started (and not stoppped).

Supported API: false

Specified by:
isActive in interface QueueService
Parameters:
queue -
Returns:
boolean
Throws:
WTException

isActive

public boolean isActive(ScheduleQueue queue)
                 throws WTException


Supported API: false

Specified by:
isActive in interface QueueService
Parameters:
queue -
Returns:
boolean
Throws:
WTException

getInterval

public long getInterval(ProcessingQueue queue)
                 throws WTException
Retrieves the waiting/sleeping interval of the queue passed as argument. The interval is given in seconds.

Supported API: false

Specified by:
getInterval in interface QueueService
Parameters:
queue -
Returns:
long
Throws:
WTException

startQueue

public void startQueue(ProcessingQueue queue)
                throws WTException
Starts a specific queue.

Supported API: true

Specified by:
startQueue in interface QueueService
Parameters:
queue -
Throws:
WTException

startQueue

public void startQueue(ScheduleQueue queue)
                throws WTException


Supported API: true

Specified by:
startQueue in interface QueueService
Parameters:
queue -
Throws:
WTException

stopQueue

public void stopQueue(ProcessingQueue queue)
               throws WTException
Stops a specific queue.

Supported API: true

Specified by:
stopQueue in interface QueueService
Parameters:
queue -
Throws:
WTException

stopQueue

public void stopQueue(ScheduleQueue queue)
               throws WTException


Supported API: true

Specified by:
stopQueue in interface QueueService
Parameters:
queue -
Throws:
WTException

setInterval

public void setInterval(ProcessingQueue queue,
                        long interval)
                 throws WTException
Establishes the wait/sleep interval for a specific queue. The interval is given in seconds and it overwrites the default interval set through wt.properties file.

Supported API: false

Specified by:
setInterval in interface QueueService
Parameters:
queue -
interval -
Throws:
WTException

deleteEntries

public void deleteEntries(ProcessingQueue queue)
                   throws WTException
Deletes all entries of a specified tree.

Supported API: false

Specified by:
deleteEntries in interface QueueService
Parameters:
queue -
Throws:
WTException

deleteEntries

public void deleteEntries(ScheduleQueue queue)
                   throws WTException


Supported API: false

Specified by:
deleteEntries in interface QueueService
Parameters:
queue -
Throws:
WTException

deleteEntries

public void deleteEntries(ProcessingQueue queue,
                          String status_code)
                   throws WTException
Deletes all entries that have the status code specified.

Supported API: false

Specified by:
deleteEntries in interface QueueService
Parameters:
queue -
status_code -
Throws:
WTException

deleteEntries

public void deleteEntries(ScheduleQueue queue,
                          String status_code)
                   throws WTException


Supported API: false

Specified by:
deleteEntries in interface QueueService
Parameters:
queue -
status_code -
Throws:
WTException

queueEntries

public Enumeration queueEntries(ProcessingQueue queue)
                         throws WTException
Returns all queue entries as an enumeration.

Supported API: false

Specified by:
queueEntries in interface QueueService
Parameters:
queue -
Returns:
Enumeration
Throws:
WTException

queueEntries

public Enumeration queueEntries(ScheduleQueue queue)
                         throws WTException


Supported API: false

Specified by:
queueEntries in interface QueueService
Parameters:
queue -
Returns:
Enumeration
Throws:
WTException

queueEntries

public Enumeration queueEntries(ProcessingQueue queue,
                                String status_code)
                         throws WTException
Returns all existing queue entries that are in the state passed as argument.

Supported API: false

Specified by:
queueEntries in interface QueueService
Parameters:
queue -
status_code -
Returns:
Enumeration
Throws:
WTException

queueEntries

public Enumeration queueEntries(ProcessingQueue queue,
                                Vector status_codes)
                         throws WTException


Supported API: false

Specified by:
queueEntries in interface QueueService
Parameters:
queue -
status_codes -
Returns:
Enumeration
Throws:
WTException

queueEntries

public Enumeration queueEntries(ScheduleQueue queue,
                                String status_code)
                         throws WTException


Supported API: false

Specified by:
queueEntries in interface QueueService
Parameters:
queue -
status_code -
Returns:
Enumeration
Throws:
WTException

startProcessing

public void startProcessing(ProcessingQueue queue)
                     throws WTException
Starts immediate processing for a specified queue.

Supported API: false

Specified by:
startProcessing in interface QueueService
Parameters:
queue -
Throws:
WTException

startProcessing

public void startProcessing(ScheduleQueue queue)
                     throws WTException


Supported API: false

Specified by:
startProcessing in interface QueueService
Parameters:
queue -
Throws:
WTException

executeEntry

public void executeEntry(QueueEntry entry)
                  throws WTException
Execute the entry passed as argument.

Supported API: true

Specified by:
executeEntry in interface QueueService
Parameters:
entry -
Throws:
WTException

setQueueExecutionHost

public void setQueueExecutionHost(ProcessingQueue queue,
                                  String host)
                           throws WTException


Supported API: false

Specified by:
setQueueExecutionHost in interface QueueService
Parameters:
queue -
host -
Throws:
WTException

setQueueExecutionHost

public void setQueueExecutionHost(ScheduleQueue queue,
                                  String host)
                           throws WTException


Supported API: false

Specified by:
setQueueExecutionHost in interface QueueService
Parameters:
queue -
host -
Throws:
WTException

createQueue

public ProcessingQueue createQueue(String queue_name,
                                   String host)
                            throws WTException
Creates a new queue given its name.

Supported API: false

Specified by:
createQueue in interface QueueService
Parameters:
queue_name -
host -
Returns:
ProcessingQueue
Throws:
WTException

createScheduleQueue

public ScheduleQueue createScheduleQueue(String queue_name,
                                         String host)
                                  throws WTException


Supported API: false

Specified by:
createScheduleQueue in interface QueueService
Parameters:
queue_name -
host -
Returns:
ScheduleQueue
Throws:
WTException

resetQueueEntry

public void resetQueueEntry(ProcessingQueue queue,
                            String entry_num)
                     throws WTException


Supported API: false

Specified by:
resetQueueEntry in interface QueueService
Parameters:
queue -
entry_num -
Throws:
WTException

resetQueueEntry

public void resetQueueEntry(ScheduleQueue queue)
                     throws WTException


Supported API: false

Specified by:
resetQueueEntry in interface QueueService
Parameters:
queue -
Throws:
WTException

deleteEntry

public void deleteEntry(QueueInfo qi,
                        QueueEntryInfo qei)
                 throws WTException


Supported API: false

Specified by:
deleteEntry in interface QueueService
Parameters:
qi -
qei -
Throws:
WTException

updateQueueEntry

public void updateQueueEntry(WtQueue queue,
                             UpdateEntry entryInfo)
                      throws WTException


Supported API: false

Specified by:
updateQueueEntry in interface QueueService
Parameters:
queue -
entryInfo -
Throws:
WTException

setPollingInterval

public void setPollingInterval(WtQueue queue,
                               String interval)
                        throws WTException


Supported API: false

Specified by:
setPollingInterval in interface QueueService
Parameters:
queue -
interval -
Throws:
WTException

setSuspendDuration

public void setSuspendDuration(WtQueue queue,
                               String duration)
                        throws WTException


Supported API: false

Specified by:
setSuspendDuration in interface QueueService
Parameters:
queue -
duration -
Throws:
WTException

setExceptionRetries

public void setExceptionRetries(WtQueue queue,
                                String retries)
                         throws WTException


Supported API: false

Specified by:
setExceptionRetries in interface QueueService
Parameters:
queue -
retries -
Throws:
WTException

setFailureNotificationEmail

public void setFailureNotificationEmail(WtQueue queue,
                                        String email)
                                 throws WTException


Supported API: false

Specified by:
setFailureNotificationEmail in interface QueueService
Parameters:
queue -
email -
Throws:
WTException

startQueueProcessing

public void startQueueProcessing(String queueName)
                          throws WTException


Supported API: false

Specified by:
startQueueProcessing in interface QueueService
Parameters:
queueName -
Throws:
WTException

executeQueues

public boolean executeQueues()

countQueues

private int countQueues(Class type)
                 throws WTException
Throws:
WTException