Package org.jpos.util
Class ThreadPool
- java.lang.Object
-
- java.lang.ThreadGroup
-
- org.jpos.util.ThreadPool
-
- All Implemented Interfaces:
java.lang.Thread.UncaughtExceptionHandler
,Configurable
,Loggeable
,LogSource
,ThreadPoolMBean
public class ThreadPool extends java.lang.ThreadGroup implements LogSource, Loggeable, Configurable, ThreadPoolMBean
Deprecated.Used Executor frameworkImplements a ThreadPool with the ability to run simple Runnable tasks as well as Jobs (supervised Runnable tasks)- Since:
- 1.1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ThreadPool.Supervised
Deprecated.
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_THREADS
Deprecated.
-
Constructor Summary
Constructors Constructor Description ThreadPool()
Deprecated.Default constructor for ThreadPoolThreadPool(int poolSize, int maxPoolSize)
Deprecated.ThreadPool(int poolSize, int maxPoolSize, java.lang.String name)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
close()
Deprecated.void
dump(java.io.PrintStream p, java.lang.String indent)
Deprecated.void
execute(java.lang.Runnable action)
Deprecated.int
getActiveCount()
Deprecated.int
getAvailableCount()
Deprecated.int
getIdleCount()
Deprecated.int
getJobCount()
Deprecated.Logger
getLogger()
Deprecated.int
getMaxPoolSize()
Deprecated.int
getPendingCount()
Deprecated.int
getPoolSize()
Deprecated.java.lang.String
getRealm()
Deprecated.static ThreadPool
getThreadPool(java.lang.String name)
Deprecated.Retrieves a thread pool from NameRegistrar given its name, unique identifier.void
setConfiguration(Configuration cfg)
Deprecated.void
setLogger(Logger logger, java.lang.String realm)
Deprecated.void
supervise()
Deprecated.-
Methods inherited from class java.lang.ThreadGroup
activeCount, activeGroupCount, allowThreadSuspension, checkAccess, destroy, enumerate, enumerate, enumerate, enumerate, getMaxPriority, getName, getParent, interrupt, isDaemon, isDestroyed, list, parentOf, resume, setDaemon, setMaxPriority, stop, suspend, toString, uncaughtException
-
-
-
-
Field Detail
-
DEFAULT_MAX_THREADS
public static final int DEFAULT_MAX_THREADS
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ThreadPool
public ThreadPool(int poolSize, int maxPoolSize)
Deprecated.- Parameters:
poolSize
- starting pool sizemaxPoolSize
- maximum number of threads on this pool
-
ThreadPool
public ThreadPool(int poolSize, int maxPoolSize, java.lang.String name)
Deprecated.- Parameters:
name
- pool namepoolSize
- starting pool sizemaxPoolSize
- maximum number of threads on this pool
-
ThreadPool
public ThreadPool()
Deprecated.Default constructor for ThreadPool
-
-
Method Detail
-
close
public void close()
Deprecated.
-
execute
public void execute(java.lang.Runnable action) throws BlockingQueue.Closed
Deprecated.- Throws:
BlockingQueue.Closed
-
dump
public void dump(java.io.PrintStream p, java.lang.String indent)
Deprecated.
-
getJobCount
public int getJobCount()
Deprecated.- Specified by:
getJobCount
in interfaceThreadPoolMBean
- Returns:
- number of jobs processed by this pool
-
getPoolSize
public int getPoolSize()
Deprecated.- Specified by:
getPoolSize
in interfaceThreadPoolMBean
- Returns:
- number of running threads
-
getMaxPoolSize
public int getMaxPoolSize()
Deprecated.- Specified by:
getMaxPoolSize
in interfaceThreadPoolMBean
- Returns:
- max number of active threads allowed
-
getActiveCount
public int getActiveCount()
Deprecated.- Returns:
- number of active threads
-
getIdleCount
public int getIdleCount()
Deprecated.- Specified by:
getIdleCount
in interfaceThreadPoolMBean
- Returns:
- number of idle threads
-
getAvailableCount
public int getAvailableCount()
Deprecated.- Returns:
- number of available threads
-
getPendingCount
public int getPendingCount()
Deprecated.- Specified by:
getPendingCount
in interfaceThreadPoolMBean
- Returns:
- number of Pending jobs
-
supervise
public void supervise()
Deprecated.
-
getRealm
public java.lang.String getRealm()
Deprecated.
-
setConfiguration
public void setConfiguration(Configuration cfg) throws ConfigurationException
Deprecated.- Specified by:
setConfiguration
in interfaceConfigurable
- Parameters:
cfg
- Configuration object- Throws:
ConfigurationException
-
getThreadPool
public static ThreadPool getThreadPool(java.lang.String name) throws NameRegistrar.NotFoundException
Deprecated.Retrieves a thread pool from NameRegistrar given its name, unique identifier.- Parameters:
name
- Name of the thread pool to retrieve, must be the same as the name property of the thread-pool tag in the QSP config file- Returns:
- returns the retrieved instance of thread pool
- Throws:
NameRegistrar.NotFoundException
- thrown when there is not a thread-pool registered under this name.
-
-