Protomatter Classes v1.1.6

com.protomatter.pas.serviceimpl
Class PASWorkServiceImpl

java.lang.Object
  |
  +--com.protomatter.pas.serviceimpl.PASWorkServiceImpl
All Implemented Interfaces:
PASStartup, PASWorkService

public class PASWorkServiceImpl
extends java.lang.Object
implements PASWorkService, PASStartup

The default implementation of the com.protomatter.pas.service.PASWorkService interface.

See Also:
PASWorkService

Fields inherited from interface com.protomatter.pas.service.PASWorkService
JNDI_NAME
 
Constructor Summary
PASWorkServiceImpl()
          Default constructor.
 
Method Summary
 void addWork(java.lang.Runnable r)
          Add work to the "default" work queue.
 void addWork(java.lang.String queue, java.lang.Runnable r)
          Add work to the given work queue.
 int getNumThreads(java.lang.String queue)
          Get the number of threads available in the given queue.
 int getNumWaiters(java.lang.String queue)
          Get the number of threads waiting in the given queue.
 int getNumWorkers(java.lang.String queue)
          Get the number of workers in the given queue.
 int getQueueLength(java.lang.String queue)
          Get the length of the given queue.
 java.util.Enumeration getQueueNames()
          Get the names of available queues.
 java.lang.String startup(java.lang.String name, java.util.Properties pasProps, java.util.Properties myProps, javax.naming.Context context)
          Start work queues.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PASWorkServiceImpl

public PASWorkServiceImpl()
Default constructor.
Method Detail

addWork

public void addWork(java.lang.Runnable r)
Description copied from interface: PASWorkService
Add work to the "default" work queue.
Specified by:
addWork in interface PASWorkService
See Also:
PASWorkService

addWork

public void addWork(java.lang.String queue,
                    java.lang.Runnable r)
Description copied from interface: PASWorkService
Add work to the given work queue.
Specified by:
addWork in interface PASWorkService
See Also:
PASWorkService

getNumWorkers

public int getNumWorkers(java.lang.String queue)
Description copied from interface: PASWorkService
Get the number of workers in the given queue.
Specified by:
getNumWorkers in interface PASWorkService
See Also:
PASWorkService

getNumWaiters

public int getNumWaiters(java.lang.String queue)
Description copied from interface: PASWorkService
Get the number of threads waiting in the given queue.
Specified by:
getNumWaiters in interface PASWorkService
See Also:
PASWorkService

getNumThreads

public int getNumThreads(java.lang.String queue)
Description copied from interface: PASWorkService
Get the number of threads available in the given queue.
Specified by:
getNumThreads in interface PASWorkService
See Also:
PASWorkService

getQueueLength

public int getQueueLength(java.lang.String queue)
Description copied from interface: PASWorkService
Get the length of the given queue.
Specified by:
getQueueLength in interface PASWorkService
See Also:
PASWorkService

getQueueNames

public java.util.Enumeration getQueueNames()
Description copied from interface: PASWorkService
Get the names of available queues.
Specified by:
getQueueNames in interface PASWorkService
See Also:
PASWorkService

startup

public java.lang.String startup(java.lang.String name,
                                java.util.Properties pasProps,
                                java.util.Properties myProps,
                                javax.naming.Context context)
                         throws StartupException
Start work queues. This reads properties for itself, and starts one queue for each property passed to it, the key being the queue name and the value being the number of threads for that queue to have. For instance, startup arguments like this: "queue1=10,queue2=5" would start a work queue named "queue1" with 10 threads and a work queue named "queue2" with 5 threads.
Specified by:
startup in interface PASStartup
Following copied from interface: com.protomatter.pas.init.PASStartup
Parameters:
name - The symbolic name that this class is listed as in the configuration file for PAS.
pasProps - The entire configuraton file for PAS.
myProps - Properties specified in the pas.startupArgs.NAME property.
context - A JNDI context object connected to PAS's JNDI tree.

Protomatter Classes v1.1.6
Copyright 1998-2001 Nate Sammons

Protomatter Classes v1.1.6 http://protomatter.sourceforge.net/1.1.6