Package com.sun.corba.ee.impl.threadpool
Class ThreadPoolManagerImpl
- java.lang.Object
-
- com.sun.corba.ee.impl.threadpool.ThreadPoolManagerImpl
-
- All Implemented Interfaces:
ThreadPoolManager,java.io.Closeable,java.lang.AutoCloseable
public class ThreadPoolManagerImpl extends java.lang.Object implements ThreadPoolManager
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.concurrent.atomic.AtomicIntegertgCountprivate java.lang.ThreadGroupthreadGroupprivate ThreadPoolthreadPoolstatic java.lang.StringTHREADPOOL_DEFAULT_NAME
-
Constructor Summary
Constructors Constructor Description ThreadPoolManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()ThreadPoolgetDefaultThreadPool()Returns the first instance of ThreadPool in the ThreadPoolManagerprivate java.lang.ThreadGroupgetThreadGroup()ThreadPoolgetThreadPool(int numericIdForThreadpool)This method will return an instance of the threadpool given a numeric threadpoolId.ThreadPoolgetThreadPool(java.lang.String threadpoolId)This method will return an instance of the threadpool given a threadpoolId, that can be used by any component in the app.ThreadPoolChoosergetThreadPoolChooser(int componentIndex)Return an instance of ThreadPoolChooser based on the componentIndex that was passed as argument.ThreadPoolChoosergetThreadPoolChooser(java.lang.String componentId)Return an instance of ThreadPoolChooser based on the componentId that was passed as argumentintgetThreadPoolChooserNumericId(java.lang.String componentId)Gets the numeric index associated with the componentId specified for a ThreadPoolChooser.intgetThreadPoolNumericId(java.lang.String threadpoolId)This method is used to return the numeric id of the threadpool, given a String threadpoolId.java.lang.StringgetThreadPoolStringId(int numericIdForThreadpool)Return a String Id for a numericId of a threadpool managed by the threadpool managervoidsetThreadPoolChooser(java.lang.String componentId, ThreadPoolChooser aThreadPoolChooser)Sets a ThreadPoolChooser for a particular componentId in the ThreadPoolManager.
-
-
-
Field Detail
-
THREADPOOL_DEFAULT_NAME
public static final java.lang.String THREADPOOL_DEFAULT_NAME
- See Also:
- Constant Field Values
-
threadPool
private ThreadPool threadPool
-
threadGroup
private java.lang.ThreadGroup threadGroup
-
tgCount
private static java.util.concurrent.atomic.AtomicInteger tgCount
-
-
Method Detail
-
getThreadGroup
private java.lang.ThreadGroup getThreadGroup()
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
getThreadPool
public ThreadPool getThreadPool(java.lang.String threadpoolId) throws NoSuchThreadPoolException
This method will return an instance of the threadpool given a threadpoolId, that can be used by any component in the app. server.- Specified by:
getThreadPoolin interfaceThreadPoolManager- Throws:
NoSuchThreadPoolException- thrown when invalid threadpoolId is passed as a parameter
-
getThreadPool
public ThreadPool getThreadPool(int numericIdForThreadpool) throws NoSuchThreadPoolException
This method will return an instance of the threadpool given a numeric threadpoolId. This method will be used by the ORB to support the functionality of dedicated threadpool for EJB beans- Specified by:
getThreadPoolin interfaceThreadPoolManager- Throws:
NoSuchThreadPoolException- thrown when invalidnumericIdForThreadpool is passed as a parameter
-
getThreadPoolNumericId
public int getThreadPoolNumericId(java.lang.String threadpoolId)
This method is used to return the numeric id of the threadpool, given a String threadpoolId. This is used by the POA interceptors to add the numeric threadpool Id, as a tagged component in the IOR. This is used to provide the functionality of dedicated threadpool for EJB beans- Specified by:
getThreadPoolNumericIdin interfaceThreadPoolManager
-
getThreadPoolStringId
public java.lang.String getThreadPoolStringId(int numericIdForThreadpool)
Return a String Id for a numericId of a threadpool managed by the threadpool manager- Specified by:
getThreadPoolStringIdin interfaceThreadPoolManager
-
getDefaultThreadPool
public ThreadPool getDefaultThreadPool()
Returns the first instance of ThreadPool in the ThreadPoolManager- Specified by:
getDefaultThreadPoolin interfaceThreadPoolManager
-
getThreadPoolChooser
public ThreadPoolChooser getThreadPoolChooser(java.lang.String componentId)
Return an instance of ThreadPoolChooser based on the componentId that was passed as argument- Specified by:
getThreadPoolChooserin interfaceThreadPoolManager
-
getThreadPoolChooser
public ThreadPoolChooser getThreadPoolChooser(int componentIndex)
Return an instance of ThreadPoolChooser based on the componentIndex that was passed as argument. This is added for improved performance so that the caller does not have to pay the cost of computing hashcode for the componentId- Specified by:
getThreadPoolChooserin interfaceThreadPoolManager
-
setThreadPoolChooser
public void setThreadPoolChooser(java.lang.String componentId, ThreadPoolChooser aThreadPoolChooser)Sets a ThreadPoolChooser for a particular componentId in the ThreadPoolManager. This would enable any component to add a ThreadPoolChooser for their specific use- Specified by:
setThreadPoolChooserin interfaceThreadPoolManager
-
getThreadPoolChooserNumericId
public int getThreadPoolChooserNumericId(java.lang.String componentId)
Gets the numeric index associated with the componentId specified for a ThreadPoolChooser. This method would help the component call the more efficient implementation i.e. getThreadPoolChooser(int componentIndex)- Specified by:
getThreadPoolChooserNumericIdin interfaceThreadPoolManager
-
-