[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting ...
Ron Sigal
ron_sigal at yahoo.com
Tue Nov 28 13:45:36 EST 2006
User: rsigal
Date: 06/11/28 13:45:36
Modified: src/main/org/jboss/remoting Tag: remoting_2_x Client.java
Log:
JBREM-640: Checks config map for size of oneway threadool.
Revision Changes Path
No revision
No revision
1.53.2.5 +22 -3 JBossRemoting/src/main/org/jboss/remoting/Client.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Client.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/Client.java,v
retrieving revision 1.53.2.4
retrieving revision 1.53.2.5
diff -u -b -r1.53.2.4 -r1.53.2.5
--- Client.java 21 Nov 2006 07:05:03 -0000 1.53.2.4
+++ Client.java 28 Nov 2006 18:45:36 -0000 1.53.2.5
@@ -63,7 +63,7 @@
*
* @author <a href="mailto:jhaynie at vocalocity.net">Jeff Haynie</a>
* @author <a href="mailto:telrod at e2technologies.net">Tom Elrod</a>
- * @version $Revision: 1.53.2.4 $
+ * @version $Revision: 1.53.2.5 $
*/
public class Client implements Externalizable
{
@@ -83,7 +83,7 @@
* executing one way invocations on the client.
* Value is 10.
*/
- public static final int MAX_NUM_ONEWAY_THREADS = 10;
+ public static final int MAX_NUM_ONEWAY_THREADS_DEFAULT = 10;
/**
* The key to use for the metadata Map passed when making a invoke() call
@@ -132,10 +132,13 @@
*/
public static final String CALLBACK_SERVER_PORT = "callbackServerPort";
+
+ public static final String MAX_NUM_ONEWAY_THREADS = "maxNumThreadsOneway";
+
/**
* Indicated the max number of threads used within oneway thread pool.
*/
- private int maxNumberThreads = MAX_NUM_ONEWAY_THREADS;
+ private int maxNumberThreads = MAX_NUM_ONEWAY_THREADS_DEFAULT;
private static final Logger log = Logger.getLogger(Client.class);
private ClientInvoker invoker;
private ClassLoader classloader;
@@ -703,6 +706,22 @@
if (onewayThreadPool == null)
{
BasicThreadPool pool = new BasicThreadPool("JBossRemoting Client Oneway");
+ Object maxNumberThreadsObject = configuration.get(MAX_NUM_ONEWAY_THREADS);
+ if (maxNumberThreadsObject instanceof String)
+ {
+ try
+ {
+ maxNumberThreads = Integer.parseInt((String) maxNumberThreadsObject);
+ }
+ catch (NumberFormatException e)
+ {
+ log.error("maxNumberThreads parameter has invalid format: " + maxNumberThreadsObject);
+ }
+ }
+ else
+ {
+ log.error("maxNumberThreads parameter must be in integer format");
+ }
pool.setMaximumPoolSize(maxNumberThreads);
pool.setBlockingMode(BlockingMode.WAIT);
onewayThreadPool = pool;
More information about the jboss-cvs-commits
mailing list