[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/callback ...
Ron Sigal
ron_sigal at yahoo.com
Wed Aug 29 01:59:14 EDT 2007
User: rsigal
Date: 07/08/29 01:59:14
Modified: src/main/org/jboss/remoting/callback Tag: remoting_2_x
ServerInvokerCallbackHandler.java
Log:
JBREM-782, JBREM-765: Synchronized with branch remoting_2_2_0_GA: (1) moved callbackClient.connect() from init() to connect(); (2) Checks for "callbackTimeout" configuration parameter.
Revision Changes Path
No revision
No revision
1.15.2.14 +33 -1 JBossRemoting/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ServerInvokerCallbackHandler.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java,v
retrieving revision 1.15.2.13
retrieving revision 1.15.2.14
diff -u -b -r1.15.2.13 -r1.15.2.14
--- ServerInvokerCallbackHandler.java 22 May 2007 17:31:46 -0000 1.15.2.13
+++ ServerInvokerCallbackHandler.java 29 Aug 2007 05:59:14 -0000 1.15.2.14
@@ -116,6 +116,9 @@
*/
public static final String CALLBACK_ID = "callbackId";
+ /** This key is used to identify the timeout used by a callback client */
+ public static final String CALLBACK_TIMEOUT = "callbackTimeout";
+
/**
* The percentage number of used memory before should persist messages.
* For example, if 64MB available and only 30MB free mem and memPercentCeiling
@@ -141,6 +144,17 @@
init(invocation, owner);
}
+ public void connect() throws Exception
+ {
+ if (callBackClient != null)
+ {
+ if (callBackClient.isConnected())
+ return;
+ callBackClient.connect();
+ }
+
+ }
+
private void init(InvocationRequest invocation, ServerInvoker owner) throws Exception
{
clientSessionId = invocation.getSessionId();
@@ -169,11 +183,29 @@
if(invocation.getLocator() != null)
{
+ Object val = metadata.get(CALLBACK_TIMEOUT);
+ if (val instanceof String)
+ {
+ try
+ {
+ Integer.parseInt((String) val);
+ metadata.put(ServerInvoker.TIMEOUT, val);
+ log.debug(this + " using callbackTimeout value " + val);
+ }
+ catch (NumberFormatException e)
+ {
+ log.warn("callbackTimeout value must have valid numeric format: " + val);
+ }
+ }
+ else if (val != null)
+ {
+ log.warn("callbackTimeout value must be a String: " + val);
+ }
+
// need to configure callback client with ssl config if one exists for server
configureSocketFactory(metadata, owner);
callBackClient = new Client(invocation.getLocator(), invocation.getSubsystem(), metadata);
- callBackClient.connect();
createCallbackErrorHandler(owner, invocation.getSubsystem());
}
else
More information about the jboss-cvs-commits
mailing list