Author: ron.sigal(a)jboss.com
Date: 2009-04-21 01:28:50 -0400 (Tue, 21 Apr 2009)
New Revision: 5074
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/RemoteClientInvoker.java
Log:
JBREM-1121: Added optional behavior for getting SocketFactory parameters from
InvokerLocator.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/RemoteClientInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/RemoteClientInvoker.java 2009-04-21
02:41:41 UTC (rev 5073)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/RemoteClientInvoker.java 2009-04-21
05:28:50 UTC (rev 5074)
@@ -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