[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/transport/rmi ...
Ron Sigal
ron_sigal at yahoo.com
Tue Jan 16 03:23:01 EST 2007
User: rsigal
Date: 07/01/16 03:23:01
Modified: src/main/org/jboss/remoting/transport/rmi
RMIClientInvoker.java
Log:
JBREM-298: Refactored with SSLRMIClientInvoker to allow storage of client side config parameters for RMI as well as SSLRMI.
Revision Changes Path
1.10 +23 -1 JBossRemoting/src/main/org/jboss/remoting/transport/rmi/RMIClientInvoker.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RMIClientInvoker.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/rmi/RMIClientInvoker.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- RMIClientInvoker.java 20 Sep 2006 04:22:24 -0000 1.9
+++ RMIClientInvoker.java 16 Jan 2007 08:23:01 -0000 1.10
@@ -23,10 +23,12 @@
package org.jboss.remoting.transport.rmi;
import org.jboss.logging.Logger;
+import org.jboss.remoting.AbstractInvoker;
import org.jboss.remoting.CannotConnectException;
import org.jboss.remoting.ConnectionFailedException;
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.RemoteClientInvoker;
+import org.jboss.remoting.Remoting;
import org.jboss.remoting.marshal.Marshaller;
import org.jboss.remoting.marshal.MarshallerDecorator;
import org.jboss.remoting.marshal.UnMarshaller;
@@ -40,6 +42,7 @@
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
+import java.util.HashMap;
import java.util.Map;
/**
@@ -47,7 +50,7 @@
*
* @author <a href="mailto:jhaynie at vocalocity.net">Jeff Haynie</a>
* @author <a href="mailto:telrod at vocalocity.net">Tom Elrod</a>
- * @version $Revision: 1.9 $
+ * @version $Revision: 1.10 $
*/
public class RMIClientInvoker extends RemoteClientInvoker
{
@@ -137,6 +140,7 @@
// with 2 ports, the rmi server and the registry.
try
{
+ storeLocalConfig(configuration);
String host = locator.getHost();
int port = getRegistryPort(locator);
Registry regsitry = LocateRegistry.getRegistry(host, port);
@@ -168,6 +172,23 @@
return RMIMarshaller.DATATYPE;
}
+ protected void storeLocalConfig(Map config)
+ {
+ HashMap localConfig = new HashMap(config);
+
+ // If a specific SocketFactory was passed in, use it. If a SocketFactory was
+ // generated from SSL parameters, discard it. It will be recreated later by
+ // SerializableSSLClientSocketFactory with any additional parameters sent
+ // from server.
+ if (socketFactory != null &&
+ !socketFactoryCreatedFromSSLParameters &&
+ AbstractInvoker.isCompleteSocketFactory(socketFactory))
+ localConfig.put(Remoting.CUSTOM_SOCKET_FACTORY, socketFactory);
+
+ // Save configuration for SerializableSSLClientSocketFactory.
+ RemotingRMIClientSocketFactory.addLocalConfiguration(locator, localConfig);
+ }
+
protected Object transport(String sessionId, Object invocation, Map metadata, Marshaller marshaller, UnMarshaller unmarshaller)
throws IOException, ConnectionFailedException
{
@@ -243,6 +264,7 @@
}
catch(RemoteException e)
{
+ log.error(e);
throw new CannotConnectException("Error making invocation in RMI client invoker.", e);
}
}
More information about the jboss-cvs-commits
mailing list