org.jwarp.service.threadpool
Class ThreadPoolService

java.lang.Object
  |
  +--org.jwarp.service.AService
        |
        +--org.jwarp.service.threadpool.ThreadPoolService
All Implemented Interfaces:
IConfigurable, IExceptionProvider, IReferenceable, IService, IThreadPoolService

public class ThreadPoolService
extends AService
implements IThreadPoolService

Interface for the thread pool service.


Field Summary
(package private)  java.util.Hashtable pools
           
 
Fields inherited from class org.jwarp.service.AService
context, createdDate, dependencies, emptyProperties, exceptionListeners, log, resumedDate, serviceName, serviceStatus, serviceType, startedDate, stoppedDate, suspendedDate, systemTicket
 
Fields inherited from interface org.jwarp.service.threadpool.IThreadPoolService
SERVICE_TYPE
 
Fields inherited from interface org.jwarp.service.IService
SERVICE_STATUS_CREATED, SERVICE_STATUS_NOT_AVAILABLE, SERVICE_STATUS_READY, SERVICE_STATUS_RESUMING, SERVICE_STATUS_RUNNING, SERVICE_STATUS_STARTING, SERVICE_STATUS_STOPPED, SERVICE_STATUS_STOPPING, SERVICE_STATUS_SUSPENDED
 
Constructor Summary
ThreadPoolService()
           
 
Method Summary
 void configure(org.jdom.Element config)
          Pass the Configuration to the Configurable class.
 IThreadPool createPool(java.lang.String name, int maxThreads, int initPoolSize, ITicket user)
          Add a server listener to listen to the server's activities.
 IThreadPool getPool(java.lang.String poolName, ITicket user)
          Gets a pool.
 java.util.Iterator getPoolNames()
          This lists all security context's names.
 void removePool(java.lang.String poolName, ITicket user)
          Removes a pool.
 
Methods inherited from class org.jwarp.service.AService
addExceptionListener, checkContext, createLogFromXML, getContext, getCreationDate, getDependencies, getExceptionListeners, getLog, getLogLevel, getName, getReference, getResumedDate, getShutDownDate, getStartDate, getStatus, getSuspendedDate, getType, removeAllExceptionListeners, removeExceptionListener, resume, sendExceptionEvent, setContext, setDependencies, setLogLevel, setName, shutdown, start, suspend
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jwarp.service.IService
checkContext, getDependencies, getLogLevel, getName, getStatus, getType, resume, setContext, setDependencies, setLogLevel, shutdown, start, suspend
 
Methods inherited from interface org.jwarp.common.IExceptionProvider
addExceptionListener, getExceptionListeners, removeAllExceptionListeners, removeExceptionListener
 

Field Detail

pools

java.util.Hashtable pools
Constructor Detail

ThreadPoolService

public ThreadPoolService()
Method Detail

configure

public void configure(org.jdom.Element config)
               throws ConfigurationException
Description copied from interface: IConfigurable
Pass the Configuration to the Configurable class. This method must always be called after the constructor and before any other method.
Specified by:
configure in interface IConfigurable
Overrides:
configure in class AService
Following copied from interface: org.jwarp.service.configuration.IConfigurable
Parameters:
configuration - the class configurations.

getPoolNames

public java.util.Iterator getPoolNames()
This lists all security context's names.
Specified by:
getPoolNames in interface IThreadPoolService
Returns:
The names of all registered security contexts.

createPool

public IThreadPool createPool(java.lang.String name,
                              int maxThreads,
                              int initPoolSize,
                              ITicket user)
                       throws java.lang.SecurityException
Add a server listener to listen to the server's activities.
Specified by:
createPool in interface IThreadPoolService

removePool

public void removePool(java.lang.String poolName,
                       ITicket user)
                throws NotFoundException,
                       NotAvailableException,
                       java.lang.SecurityException
Removes a pool.
Specified by:
removePool in interface IThreadPoolService
Throws:
NotFoundException - If the requested pool could not be found
NotAvailableException - If the requested pool is still running
java.lang.SecurityException - If access id denied

getPool

public IThreadPool getPool(java.lang.String poolName,
                           ITicket user)
                    throws java.lang.SecurityException
Gets a pool.
Specified by:
getPool in interface IThreadPoolService
Parameters:
pool - The pool's name
user - The user ticket
Throws:
NotFoundException - If the requested pool could not be found
java.lang.SecurityException - If access id denied

©   O R C A   S y s t e m s