Class ThreadPoolManagerImpl

  • All Implemented Interfaces:
    ThreadPoolManager, java.io.Closeable, java.lang.AutoCloseable

    public class ThreadPoolManagerImpl
    extends java.lang.Object
    implements ThreadPoolManager
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      ThreadPool getDefaultThreadPool()
      Returns the first instance of ThreadPool in the ThreadPoolManager
      private java.lang.ThreadGroup getThreadGroup()  
      ThreadPool getThreadPool​(int numericIdForThreadpool)
      This method will return an instance of the threadpool given a numeric threadpoolId.
      ThreadPool getThreadPool​(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.
      ThreadPoolChooser getThreadPoolChooser​(int componentIndex)
      Return an instance of ThreadPoolChooser based on the componentIndex that was passed as argument.
      ThreadPoolChooser getThreadPoolChooser​(java.lang.String componentId)
      Return an instance of ThreadPoolChooser based on the componentId that was passed as argument
      int getThreadPoolChooserNumericId​(java.lang.String componentId)
      Gets the numeric index associated with the componentId specified for a ThreadPoolChooser.
      int getThreadPoolNumericId​(java.lang.String threadpoolId)
      This method is used to return the numeric id of the threadpool, given a String threadpoolId.
      java.lang.String getThreadPoolStringId​(int numericIdForThreadpool)
      Return a String Id for a numericId of a threadpool managed by the threadpool manager
      void setThreadPoolChooser​(java.lang.String componentId, ThreadPoolChooser aThreadPoolChooser)
      Sets a ThreadPoolChooser for a particular componentId in the ThreadPoolManager.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • THREADPOOL_DEFAULT_NAME

        public static final java.lang.String THREADPOOL_DEFAULT_NAME
        See Also:
        Constant Field Values
      • threadGroup

        private java.lang.ThreadGroup threadGroup
      • tgCount

        private static java.util.concurrent.atomic.AtomicInteger tgCount
    • Constructor Detail

      • ThreadPoolManagerImpl

        public ThreadPoolManagerImpl()
    • Method Detail

      • getThreadGroup

        private java.lang.ThreadGroup getThreadGroup()
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • 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:
        getThreadPool in interface ThreadPoolManager
        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:
        getThreadPoolNumericId in interface ThreadPoolManager
      • 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:
        getThreadPoolStringId in interface ThreadPoolManager
      • 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:
        getThreadPoolChooser in interface ThreadPoolManager
      • 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:
        setThreadPoolChooser in interface ThreadPoolManager
      • 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:
        getThreadPoolChooserNumericId in interface ThreadPoolManager