Methods Summary |
---|
private void | createThreadPools(com.sun.enterprise.config.serverbeans.ThreadPool threadpoolBean, int index)
String threadpoolId = null;
String minThreadsValue, maxThreadsValue, timeoutValue, numberOfQueuesValue;
int minThreads = DEFAULT_MIN_THREAD_COUNT;
int maxThreads = DEFAULT_MAX_THREAD_COUNT;
int idleTimeoutInSeconds = ORBConstants.DEFAULT_INACTIVITY_TIMEOUT;
int numberOfQueues = DEFAULT_NUMBER_OF_QUEUES;
try {
threadpoolId = threadpoolBean.getThreadPoolId();
} catch (NullPointerException npe) {
if(_logger.isLoggable(Level.WARNING)) {
_logger.log(Level.WARNING, "ThreadPoolBean may be null ", npe);
}
}
try {
minThreadsValue = threadpoolBean.getMinThreadPoolSize();
minThreads = Integer.parseInt(minThreadsValue);
} catch (NullPointerException npe) {
if(_logger.isLoggable(Level.WARNING)) {
_logger.log(Level.WARNING, "ThreadPoolBean may be null ", npe);
_logger.log(Level.WARNING,
"Using default value for steady-threadpool-size = " + minThreads);
}
} catch (NumberFormatException nfe) {
if(_logger.isLoggable(Level.WARNING)) {
_logger.log(Level.WARNING,"enterprise_util.excep_orbmgr_numfmt",nfe);
_logger.log(Level.WARNING,
"Using default value for min-threadpool-size = " + minThreads);
}
}
try {
maxThreadsValue = threadpoolBean.getMaxThreadPoolSize();
maxThreads = Integer.parseInt(maxThreadsValue);
} catch (NullPointerException npe) {
if(_logger.isLoggable(Level.WARNING)) {
_logger.log(Level.WARNING, "ThreadPoolBean may be null ", npe);
_logger.log(Level.WARNING,
"Using default value for max-threadpool-size = " + maxThreads);
}
} catch (NumberFormatException nfe) {
if(_logger.isLoggable(Level.WARNING)) {
_logger.log(Level.WARNING,"enterprise_util.excep_orbmgr_numfmt",nfe);
_logger.log(Level.WARNING,
"Using default value for max-threadpool-size = " + maxThreads);
}
}
try {
timeoutValue = threadpoolBean.getIdleThreadTimeoutInSeconds();
idleTimeoutInSeconds = Integer.parseInt(timeoutValue);
} catch (NullPointerException npe) {
if(_logger.isLoggable(Level.WARNING)) {
_logger.log(Level.WARNING, "ThreadPoolBean may be null ", npe);
_logger.log(Level.WARNING,
"Using default value for idle-thread-timeout-in-seconds = " +
idleTimeoutInSeconds);
}
} catch (NumberFormatException nfe) {
if(_logger.isLoggable(Level.WARNING)) {
_logger.log(Level.WARNING,"enterprise_util.excep_orbmgr_numfmt",nfe);
_logger.log(Level.WARNING,
"Using default value for idle-thread-timeout-in-seconds = " +
idleTimeoutInSeconds);
}
}
// Currently this value is not used but when multi-queue threadpools are
// implemented this could be used to decide which one to instantiate and
// number of queues in the multi-queue threadpool
try {
numberOfQueuesValue = threadpoolBean.getNumWorkQueues();
numberOfQueues = Integer.parseInt(numberOfQueuesValue);
} catch (NullPointerException npe) {
if(_logger.isLoggable(Level.WARNING)) {
_logger.log(Level.WARNING, "ThreadPoolBean may be null ", npe);
_logger.log(Level.WARNING,
"Using default value for num-work-queues = " +
numberOfQueues);
}
} catch (NumberFormatException nfe) {
if(_logger.isLoggable(Level.WARNING)) {
_logger.log(Level.WARNING,"enterprise_util.excep_orbmgr_numfmt",nfe);
_logger.log(Level.WARNING,
"Using default value for num-work-queues = " +
numberOfQueues);
}
}
// Mutiplied the idleTimeoutInSeconds by 1000 to convert to milliseconds
com.sun.corba.ee.spi.orbutil.threadpool.ThreadPool threadpool =
new ThreadPoolImpl(minThreads, maxThreads,
idleTimeoutInSeconds * 1000, threadpoolId,
ApplicationServer.getServerContext().getCommonClassLoader());
// Add the threadpool instance to the threadpoolList
threadpoolList.add(threadpool);
// Associate the threadpoolId to the index passed
idToIndexTable.put(threadpoolId, new Integer(index));
// Associate the threadpoolId to the index passed
indexToIdTable.put(new Integer(index), threadpoolId);
|
public com.sun.corba.ee.spi.orbutil.threadpool.ThreadPool | getDefaultThreadPool()Returns the first instance of ThreadPool in the ThreadPoolManager
try {
return getThreadPool(0);
} catch (NoSuchThreadPoolException nstpe) {
if(_logger.isLoggable(Level.WARNING)) {
_logger.log(Level.WARNING, "No default ThreadPool defined ", nstpe);
}
}
return null;
|
public com.sun.corba.ee.spi.orbutil.threadpool.ThreadPool | getThreadPool(java.lang.String id)This method will return an instance of the threadpool given a threadpoolId,
that can be used by any component in the app. server.
Integer i = (Integer)idToIndexTable.get(id);
if (i == null) {
throw new NoSuchThreadPoolException();
}
try {
com.sun.corba.ee.spi.orbutil.threadpool.ThreadPool threadpool =
(com.sun.corba.ee.spi.orbutil.threadpool.ThreadPool)
threadpoolList.get(i.intValue());
return threadpool;
} catch (IndexOutOfBoundsException iobe) {
throw new NoSuchThreadPoolException();
}
|
public com.sun.corba.ee.spi.orbutil.threadpool.ThreadPool | getThreadPool(int numericIdForThreadpool)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
try {
com.sun.corba.ee.spi.orbutil.threadpool.ThreadPool threadpool =
(com.sun.corba.ee.spi.orbutil.threadpool.ThreadPool)
threadpoolList.get(numericIdForThreadpool);
return threadpool;
} catch (IndexOutOfBoundsException iobe) {
throw new NoSuchThreadPoolException();
}
|
public com.sun.corba.ee.spi.orbutil.threadpool.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
//FIXME: This method is not used, but should be fixed once
//ORB's nio select starts working and we start using ThreadPoolChooser
//This will be mostly used by the ORB
return null;
|
public com.sun.corba.ee.spi.orbutil.threadpool.ThreadPoolChooser | getThreadPoolChooser(java.lang.String componentId)Return an instance of ThreadPoolChooser based on the componentId that was
passed as argument
//FIXME: This method is not used, but should be fixed once
//ORB's nio select starts working and we start using ThreadPoolChooser
//This will be mostly used by the ORB
return null;
|
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)
//FIXME: This method is not used, but should be fixed once
//ORB's nio select starts working and we start using ThreadPoolChooser
//This will be mostly used by the ORB
return 0;
|
public static com.sun.corba.ee.spi.orbutil.threadpool.ThreadPoolManager | getThreadPoolManager()
return s1asThreadPoolMgr;
|
public int | getThreadPoolNumericId(java.lang.String id)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
Integer i = (Integer)idToIndexTable.get(id);
return ((i == null) ? 0 : i.intValue());
|
public java.lang.String | getThreadPoolStringId(int numericIdForThreadpool)Return a String Id for a numericId of a threadpool managed by the threadpool
manager
String id = (String)indexToIdTable.get(new Integer(numericIdForThreadpool));
return ((id == null) ? defaultID : id);
|
public void | setThreadPoolChooser(java.lang.String componentId, com.sun.corba.ee.spi.orbutil.threadpool.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
//FIXME: This method is not used, but should be fixed once
//ORB's nio select starts working and we start using ThreadPoolChooser
//This will be mostly used by the ORB
|