KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > spi > orbutil > threadpool > ThreadPoolManager


1 /*
2  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
3  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4  */

5
6 package com.sun.corba.se.spi.orbutil.threadpool;
7
8 public interface ThreadPoolManager
9 {
10     /**
11     * This method will return an instance of the threadpool given a threadpoolId,
12     * that can be used by any component in the app. server.
13     *
14     * @throws NoSuchThreadPoolException thrown when invalid threadpoolId is passed
15     * as a parameter
16     */

17     public ThreadPool getThreadPool(String JavaDoc threadpoolId) throws NoSuchThreadPoolException;
18
19     /**
20     * This method will return an instance of the threadpool given a numeric threadpoolId.
21     * This method will be used by the ORB to support the functionality of
22     * dedicated threadpool for EJB beans
23     *
24     * @throws NoSuchThreadPoolException thrown when invalidnumericIdForThreadpool is passed
25     * as a parameter
26     */

27     public ThreadPool getThreadPool(int numericIdForThreadpool) throws NoSuchThreadPoolException;
28
29     /**
30     * This method is used to return the numeric id of the threadpool, given a String
31     * threadpoolId. This is used by the POA interceptors to add the numeric threadpool
32     * Id, as a tagged component in the IOR. This is used to provide the functionality of
33     * dedicated threadpool for EJB beans
34     */

35     public int getThreadPoolNumericId(String JavaDoc threadpoolId);
36
37     /**
38     * Return a String Id for a numericId of a threadpool managed by the threadpool
39     * manager
40     */

41     public String JavaDoc getThreadPoolStringId(int numericIdForThreadpool);
42
43     /**
44     * Returns the first instance of ThreadPool in the ThreadPoolManager
45     */

46     public ThreadPool getDefaultThreadPool();
47
48     /**
49      * Return an instance of ThreadPoolChooser based on the componentId that was
50      * passed as argument
51      */

52     public ThreadPoolChooser getThreadPoolChooser(String JavaDoc componentId);
53
54     /**
55      * Return an instance of ThreadPoolChooser based on the componentIndex that was
56      * passed as argument. This is added for improved performance so that the caller
57      * does not have to pay the cost of computing hashcode for the componentId
58      */

59     public ThreadPoolChooser getThreadPoolChooser(int componentIndex);
60
61     /**
62      * Sets a ThreadPoolChooser for a particular componentId in the ThreadPoolManager. This
63      * would enable any component to add a ThreadPoolChooser for their specific use
64      */

65     public void setThreadPoolChooser(String JavaDoc componentId, ThreadPoolChooser aThreadPoolChooser);
66
67     /**
68      * Gets the numeric index associated with the componentId specified for a
69      * ThreadPoolChooser. This method would help the component call the more
70      * efficient implementation i.e. getThreadPoolChooser(int componentIndex)
71      */

72     public int getThreadPoolChooserNumericId(String JavaDoc componentId);
73 }
74
75 // End of file.
76
Popular Tags