org.huihoo.jfox.pool.thread
Class SimpleThreadPool
org.huihoo.jfox.service.ComponentSupport
|
+--org.huihoo.jfox.pool.thread.SimpleThreadPool
- All Implemented Interfaces:
- Component, ComponentSupportMBean, Loggable, ObjectPoolMBean, Persistentable, java.io.Serializable, SimpleThreadPoolMBean, ThreadPool
- public class SimpleThreadPool
- extends ComponentSupport
- implements SimpleThreadPoolMBean, ThreadPool
- Author:
- Young Yang
- See Also:
- Serialized Form
|
Method Summary |
void |
clear()
Clears any objects sitting idle in the pool, releasing any associated resources |
protected void |
doDestroy()
do actually destory action |
protected void |
doInit()
do actually create action |
java.lang.String |
getObjectClass()
get the pooled object's class type, it return by object pool's factory |
ObjectFactory |
getObjectFactory()
get the factory use to create new instances |
int |
getRest()
get the count of rest object |
int |
getWorking()
get the count of working object |
void |
runThread(Threadable task)
run a Threadable object |
| Methods inherited from class org.huihoo.jfox.service.ComponentSupport |
destroy, getLogger, getName, getObjectName, getProxyInstance, getState, handleNotification, init, parseName, postDeregister, postRegister, preDeregister, preRegister, setLogger, setName |
SimpleThreadPool
public SimpleThreadPool()
runThread
public void runThread(Threadable task)
- Description copied from interface:
ThreadPool
- run a Threadable object
- Specified by:
runThread in interface ThreadPool
- Following copied from interface:
org.huihoo.jfox.pool.thread.ThreadPool
- Parameters:
thread -
doInit
protected void doInit()
throws java.lang.Exception
- Description copied from class:
ComponentSupport
- do actually create action
- Overrides:
doInit in class ComponentSupport
doDestroy
protected void doDestroy()
throws java.lang.Exception
- Description copied from class:
ComponentSupport
- do actually destory action
- Overrides:
doDestroy in class ComponentSupport
clear
public void clear()
- Description copied from interface:
ObjectPoolMBean
- Clears any objects sitting idle in the pool, releasing any associated resources
- Specified by:
clear in interface ObjectPoolMBean
getObjectFactory
public ObjectFactory getObjectFactory()
- Description copied from interface:
ObjectPoolMBean
- get the factory use to create new instances
- Specified by:
getObjectFactory in interface ObjectPoolMBean
getObjectClass
public java.lang.String getObjectClass()
- Description copied from interface:
ObjectPoolMBean
- get the pooled object's class type, it return by object pool's factory
- Specified by:
getObjectClass in interface ObjectPoolMBean
- Following copied from interface:
org.huihoo.jfox.pool.ObjectPoolMBean
- Returns:
-
getWorking
public int getWorking()
- Description copied from interface:
ObjectPoolMBean
- get the count of working object
- Specified by:
getWorking in interface ObjectPoolMBean
- Following copied from interface:
org.huihoo.jfox.pool.ObjectPoolMBean
- Returns:
-
getRest
public int getRest()
- Description copied from interface:
ObjectPoolMBean
- get the count of rest object
- Specified by:
getRest in interface ObjectPoolMBean
- Following copied from interface:
org.huihoo.jfox.pool.ObjectPoolMBean
- Returns:
-