Author: ron.sigal(a)jboss.com
Date: 2009-05-01 16:40:33 -0400 (Fri, 01 May 2009)
New Revision: 5120
Modified:
remoting2/branches/2.2/src/main/org/jboss/remoting/RemoteClientInvoker.java
Log:
JBREM-1121: Added optional behavior for getting SocketFactory parameters from
InvokerLocator.
Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/RemoteClientInvoker.java
===================================================================
--- remoting2/branches/2.2/src/main/org/jboss/remoting/RemoteClientInvoker.java 2009-05-01
20:35:45 UTC (rev 5119)
+++ remoting2/branches/2.2/src/main/org/jboss/remoting/RemoteClientInvoker.java 2009-05-01
20:40:33 UTC (rev 5120)
@@ -25,6 +25,8 @@
import java.util.Map;
+import org.jboss.logging.Logger;
+
/**
* This class extends the MicroRemoteClientInvoker and adds extra
* functionality that can not be included in a J2ME envrionment, such as
@@ -35,6 +37,8 @@
*/
public abstract class RemoteClientInvoker extends MicroRemoteClientInvoker
{
+ private static Logger log = Logger.getLogger(RemoteClientInvoker.class);
+
public RemoteClientInvoker(InvokerLocator locator)
{
super(locator);
@@ -52,6 +56,35 @@
configuration.put(Remoting.SOCKET_FACTORY_CLASS_NAME,
socketFactoryClassName);
}
}
- socketFactory = createSocketFactory(configuration);
+ if (useAllParams(getConfiguration()))
+ {
+ // getConfiguration() returns combination of InvokerLocator and configuration
parameters.
+ socketFactory = createSocketFactory(getConfiguration());
+ }
+ else
+ {
+ socketFactory = createSocketFactory(configuration);
+ }
}
+
+ protected boolean useAllParams(Map configuration)
+ {
+ boolean result = false;
+ if (configuration != null)
+ {
+ Object o = configuration.get(Remoting.USE_ALL_SOCKET_FACTORY_PARAMS);
+ if (o != null)
+ {
+ if (o instanceof String)
+ {
+ result = Boolean.valueOf((String) o).booleanValue();
+ }
+ else
+ {
+ log.warn("Value of " + Remoting.USE_ALL_SOCKET_FACTORY_PARAMS +
" must be a String: " + o);
+ }
+ }
+ }
+ return result;
+ }
}
Show replies by date