From: Ron S. <ron...@ya...> - 2006-01-18 05:41:16
|
User: rsigal Date: 06/01/18 00:41:15 Modified: src/main/org/jboss/remoting AbstractInvoker.java Log: JBREM-292: Added configuration HashMap and a constructor that accepts a Map and InvokerLocator with which it populates configuraion Map. Revision Changes Path 1.7 +13 -2 JBossRemoting/src/main/org/jboss/remoting/AbstractInvoker.java (In the diff below, changes in quantity of whitespace are not shown.) Index: AbstractInvoker.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/AbstractInvoker.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -b -r1.6 -r1.7 --- AbstractInvoker.java 30 Dec 2005 05:26:38 -0000 1.6 +++ AbstractInvoker.java 18 Jan 2006 05:41:15 -0000 1.7 @@ -35,7 +35,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:te...@e2...">Tom Elrod</a> - * @version $Revision: 1.6 $ + * @version $Revision: 1.7 $ */ public abstract class AbstractInvoker implements Invoker { @@ -44,13 +44,24 @@ protected InvokerLocator locator; protected Map localServerLocators = new HashMap(); protected String serializationType; - + protected Map configuration = new HashMap(); public AbstractInvoker(InvokerLocator locator) { + this(locator, null); + } + + public AbstractInvoker(InvokerLocator locator, Map configuration) + { this.classbyteloader = new ClassByteClassLoader(this.getClass().getClassLoader()); this.locator = locator; + if (configuration != null) + this.configuration.putAll(configuration); + + if (locator.getParameters() != null) + this.configuration.putAll(locator.getParameters()); + try { InvokerLocator loaderLocator = MarshallLoaderFactory.convertLocator(locator); |
From: Ron S. <ron...@ya...> - 2006-01-18 05:44:20
|
User: rsigal Date: 06/01/18 00:44:19 Modified: src/main/org/jboss/remoting Client.java Log: JBREM-292: Added constructors which accept a configuration Map to pass to InvokerRegistry.createClientInvoker(). Revision Changes Path 1.20 +18 -7 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.19 retrieving revision 1.20 diff -u -b -r1.19 -r1.20 --- Client.java 18 Jan 2006 04:58:34 -0000 1.19 +++ Client.java 18 Jan 2006 05:44:19 -0000 1.20 @@ -44,7 +44,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:te...@e2...">Tom Elrod</a> - * @version $Revision: 1.19 $ + * @version $Revision: 1.20 $ */ public class Client { @@ -74,19 +74,30 @@ public Client(InvokerLocator locator) throws Exception { - this(locator, null); + this(locator, null, null); + } + + public Client(InvokerLocator locator, Map configuration) throws Exception + { + this(locator, null, configuration); } public Client(InvokerLocator locator, String subsystem) throws Exception { - this(Thread.currentThread().getContextClassLoader(), locator, subsystem); + this(locator, subsystem, null); + } + + public Client(InvokerLocator locator, String subsystem, Map configuration) + throws Exception + { + this(Thread.currentThread().getContextClassLoader(), locator, subsystem, configuration); } - public Client(ClassLoader cl, InvokerLocator locator, String subsystem) + public Client(ClassLoader cl, InvokerLocator locator, String subsystem, Map configuration) throws Exception { - this(cl, InvokerRegistry.createClientInvoker(locator), subsystem); + this(cl, InvokerRegistry.createClientInvoker(locator, configuration), subsystem); } public Client(ClassLoader cl, ClientInvoker invoker, String subsystem) |
From: Ron S. <ron...@ya...> - 2006-01-18 05:45:46
|
User: rsigal Date: 06/01/18 00:45:45 Modified: src/main/org/jboss/remoting InvokerRegistry.java Log: JBREM-292: Added a version of createClientInvoker() which accepts a configuration Map to pass to client invoker constructor. Revision Changes Path 1.18 +28 -4 JBossRemoting/src/main/org/jboss/remoting/InvokerRegistry.java (In the diff below, changes in quantity of whitespace are not shown.) Index: InvokerRegistry.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/InvokerRegistry.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -b -r1.17 -r1.18 --- InvokerRegistry.java 5 Jan 2006 07:36:33 -0000 1.17 +++ InvokerRegistry.java 18 Jan 2006 05:45:45 -0000 1.18 @@ -42,7 +42,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:te...@e2...">Tom Elrod</a> - * @version $Revision: 1.17 $ + * @version $Revision: 1.18 $ */ public class InvokerRegistry { @@ -258,7 +258,7 @@ /** * create a ClientInvoker instance, using the specific InvokerLocator, which is just a client-side - * invoker to a remote server + * invoker to a remote server. Will use the default configuration values for the transport. * * @param locator * @return @@ -267,6 +267,20 @@ public static ClientInvoker createClientInvoker(InvokerLocator locator) throws Exception { + return createClientInvoker(locator, null); + } + + /** + * create a ClientInvoker instance, using the specific InvokerLocator, which is just a client-side + * invoker to a remote server + * + * @param locator + * @return + * @throws Exception + */ + public static ClientInvoker createClientInvoker(InvokerLocator locator, Map configuration) + throws Exception + { if(locator == null) { throw new NullPointerException("locator cannot be null"); @@ -318,8 +332,18 @@ throw new RuntimeException("Couldn't find valid client invoker class for transport '" + protocol + "'"); } } + + if(configuration != null) + { + Constructor ctor = cl.getConstructor(new Class[]{InvokerLocator.class, Map.class}); + invoker = (ClientInvoker) ctor.newInstance(new Object[]{locator, configuration}); + } + else + { Constructor ctor = cl.getConstructor(new Class[]{InvokerLocator.class}); invoker = (ClientInvoker) ctor.newInstance(new Object[]{locator}); + } + InvokerLocator l = invoker.getLocator(); clientLocators.put(l, invoker); } |
From: Ron S. <ron...@ya...> - 2006-01-18 05:47:53
|
User: rsigal Date: 06/01/18 00:47:51 Modified: src/main/org/jboss/remoting RemoteClientInvoker.java Log: JBREM-292: Added a constructor which accepts a configuration Map and passes it to super(). Revision Changes Path 1.15 +6 -1 JBossRemoting/src/main/org/jboss/remoting/RemoteClientInvoker.java (In the diff below, changes in quantity of whitespace are not shown.) Index: RemoteClientInvoker.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/RemoteClientInvoker.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -b -r1.14 -r1.15 --- RemoteClientInvoker.java 17 Jan 2006 18:53:40 -0000 1.14 +++ RemoteClientInvoker.java 18 Jan 2006 05:47:51 -0000 1.15 @@ -43,7 +43,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:te...@e2...">Tom Elrod</a> - * @version $Revision: 1.14 $ + * @version $Revision: 1.15 $ */ public abstract class RemoteClientInvoker extends AbstractInvoker implements ClientInvoker { @@ -58,6 +58,11 @@ super(locator); } + public RemoteClientInvoker(InvokerLocator locator, Map configuration) + { + super(locator, configuration); + } + /** * transport a request against a remote ServerInvoker * |
From: Ron S. <ron...@ya...> - 2006-01-18 05:50:26
|
User: rsigal Date: 06/01/18 00:50:16 Modified: src/main/org/jboss/remoting ServerInvoker.java Log: JBREM-292: Removed configuration Map variable, which is now in AbstractInvoker, and made small changes to constructor's handling of configuration Map. Revision Changes Path 1.22 +7 -6 JBossRemoting/src/main/org/jboss/remoting/ServerInvoker.java (In the diff below, changes in quantity of whitespace are not shown.) Index: ServerInvoker.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/ServerInvoker.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -b -r1.21 -r1.22 --- ServerInvoker.java 17 Jan 2006 19:58:33 -0000 1.21 +++ ServerInvoker.java 18 Jan 2006 05:50:16 -0000 1.22 @@ -51,7 +51,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:tom...@jb...">Tom Elrod</a> - * @version $Revision: 1.21 $ + * @version $Revision: 1.22 $ */ public abstract class ServerInvoker extends AbstractInvoker implements ServerInvokerMBean { @@ -85,8 +85,6 @@ private MBeanServer mbeanServer = null; - private Map configuration = new HashMap(); - private String dataType; private String serverBindAddress = null; @@ -114,11 +112,14 @@ public ServerInvoker(InvokerLocator locator, Map configuration) { super(locator); - this.configuration = configuration; + + if (configuration != null) + this.configuration.putAll(configuration); + Map locatorParams = locator.getParameters(); - if(configuration != null && locatorParams != null) + if(locatorParams != null) { - configuration.putAll(locator.getParameters()); + this.configuration.putAll(locator.getParameters()); } } |
From: Tom E. <tom...@jb...> - 2006-01-24 18:53:40
|
User: telrod Date: 06/01/24 13:53:25 Modified: src/main/org/jboss/remoting InvokerRegistry.java Log: JBREM-255 - including request headers in invocation request. Revision Changes Path 1.20 +1 -1 JBossRemoting/src/main/org/jboss/remoting/InvokerRegistry.java (In the diff below, changes in quantity of whitespace are not shown.) Index: InvokerRegistry.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/InvokerRegistry.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -b -r1.19 -r1.20 --- InvokerRegistry.java 19 Jan 2006 04:25:24 -0000 1.19 +++ InvokerRegistry.java 24 Jan 2006 18:53:25 -0000 1.20 @@ -42,7 +42,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:te...@e2...">Tom Elrod</a> - * @version $Revision: 1.19 $ + * @version $Revision: 1.20 $ */ public class InvokerRegistry { |
From: Tom E. <tom...@jb...> - 2006-01-26 16:13:51
|
User: telrod Date: 06/01/26 11:13:48 Modified: src/main/org/jboss/remoting Version.java Log: JBREM-226 - updated version. Revision Changes Path 1.5 +1 -1 JBossRemoting/src/main/org/jboss/remoting/Version.java (In the diff below, changes in quantity of whitespace are not shown.) Index: Version.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/Version.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -b -r1.4 -r1.5 --- Version.java 30 Dec 2005 05:26:38 -0000 1.4 +++ Version.java 26 Jan 2006 16:13:48 -0000 1.5 @@ -27,7 +27,7 @@ */ public class Version { - public static final String VERSION = "1.4.0 Beta"; + public static final String VERSION = "1.4.0 Final"; public static void main(String arg[]) |
From: Tom E. <tom...@jb...> - 2006-02-14 16:24:04
|
User: telrod Date: 06/02/14 11:24:00 Modified: src/main/org/jboss/remoting Client.java Log: JBREM-317 - adding ability to by-pass setting up lease on the client side. Revision Changes Path 1.23 +55 -21 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.22 retrieving revision 1.23 diff -u -b -r1.22 -r1.23 --- Client.java 26 Jan 2006 07:31:00 -0000 1.22 +++ Client.java 14 Feb 2006 16:24:00 -0000 1.23 @@ -23,6 +23,7 @@ package org.jboss.remoting; import java.io.InputStream; +import java.io.Serializable; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -46,9 +47,9 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:te...@e2...">Tom Elrod</a> - * @version $Revision: 1.22 $ + * @version $Revision: 1.23 $ */ -public class Client +public class Client implements Serializable { /** * Key to be used when tracking callback listeners. @@ -72,6 +73,15 @@ public static final String RAW = "RAW_PAYLOAD"; /** + * Key for the configuration map passed to the Client constructor + * to indicate that client should not make initial request to establish + * lease with server. May be needed when connecting to non-remoting server + * (especially if using http client only). The value for this should be + * either a String that java.lang.Boolean can evaluate or a java.lang.Boolean. + */ + public static final String ENABLE_LEASE = "ENABLE_LEASE"; + + /** * Indicated the max number of threads used within oneway thread pool. */ private int maxNumberThreads = MAX_NUM_ONEWAY_THREADS; @@ -86,6 +96,8 @@ private LeasePinger leasePinger = null; private Map configuration = null; + private boolean enableLease = true; + /** * Constructs a remoting client with intended target server specified via the lcoator, * without specifing a remote subsystem or including any metadata. @@ -286,18 +298,39 @@ private void setupClientLease(ClientInvoker invoker) { + if(configuration != null) + { + Object val = configuration.get(ENABLE_LEASE); + if(val != null) + { + if(val instanceof Boolean) + { + enableLease = ((Boolean) val).booleanValue(); + } + else if(val instanceof String) + { + enableLease = Boolean.valueOf((String) val).booleanValue(); + } + else + { + log.warn("Can not evaluate " + ENABLE_LEASE + " value (" + val + ") as a boolean type."); + } + } + } + if(enableLease) + { Object ret = null; try { ret = invoker.invoke(new InvocationRequest(sessionId, subsystem, "$PING$", configuration, null, null)); if(ret instanceof InvocationResponse) { - InvocationResponse resp = (InvocationResponse)ret; + InvocationResponse resp = (InvocationResponse) ret; Map respMap = resp.getPayload(); if(respMap != null) { - Long leaseTimeoutValue = (Long)respMap.get("clientLeasePeriod"); + Long leaseTimeoutValue = (Long) respMap.get("clientLeasePeriod"); long leaseTimeout = leaseTimeoutValue.longValue(); if(leaseTimeout > 0) { @@ -315,6 +348,7 @@ log.error("Error setting up client lease.", throwable); } } + } /** * Disconnects the underlying transport from the target server. |
From: Timothy F. <ti...@jb...> - 2006-03-08 08:26:53
|
User: timfox Date: 06/03/08 03:26:50 Modified: src/main/org/jboss/remoting Client.java Log: Only tries to startPinger when pinger is newly created Revision Changes Path 1.25 +3 -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.24 retrieving revision 1.25 diff -u -b -r1.24 -r1.25 --- Client.java 2 Mar 2006 21:04:51 -0000 1.24 +++ Client.java 8 Mar 2006 08:26:50 -0000 1.25 @@ -47,7 +47,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:te...@e2...">Tom Elrod</a> - * @version $Revision: 1.24 $ + * @version $Revision: 1.25 $ */ public class Client implements Serializable { @@ -355,13 +355,13 @@ if(leasePinger == null) { leasePinger = new LeasePinger(this); - } leasePinger.startPing(leaseTimeout); } } } } } + } catch(Throwable throwable) { log.error("Error setting up client lease.", throwable); |
From: Ron S. <ron...@ya...> - 2006-03-14 05:12:33
|
User: rsigal Date: 06/03/14 00:12:28 Modified: src/main/org/jboss/remoting InvokerRegistry.java Log: JBREM-336: Put call to InvokerRegistry.unregisterLocator() in InvokerRegistry.destroyServerInvoker(). Revision Changes Path 1.21 +2 -2 JBossRemoting/src/main/org/jboss/remoting/InvokerRegistry.java (In the diff below, changes in quantity of whitespace are not shown.) Index: InvokerRegistry.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/InvokerRegistry.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -b -r1.20 -r1.21 --- InvokerRegistry.java 24 Jan 2006 18:53:25 -0000 1.20 +++ InvokerRegistry.java 14 Mar 2006 05:12:28 -0000 1.21 @@ -42,7 +42,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:te...@e2...">Tom Elrod</a> - * @version $Revision: 1.20 $ + * @version $Revision: 1.21 $ */ public class InvokerRegistry { @@ -454,7 +454,7 @@ if(invoker != null) { InvokerLocator locator = invoker.getLocator(); - serverLocators.remove(invoker.getLocator()); + unregisterLocator(locator); if(clientLocators.get(locator) instanceof LocalClientInvoker) { ClientInvoker clientInvoker = (ClientInvoker) clientLocators.remove(locator); |
From: Tom E. <tom...@jb...> - 2006-03-14 18:32:54
|
User: telrod Date: 06/03/14 13:32:52 Modified: src/main/org/jboss/remoting ServerInvoker.java Log: JBREM-319 - allow configuration of server socket factory by instance, classname, or mbean service over all the different transports. Revision Changes Path 1.26 +124 -1 JBossRemoting/src/main/org/jboss/remoting/ServerInvoker.java (In the diff below, changes in quantity of whitespace are not shown.) Index: ServerInvoker.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/ServerInvoker.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -b -r1.25 -r1.26 --- ServerInvoker.java 10 Mar 2006 03:30:25 -0000 1.25 +++ ServerInvoker.java 14 Mar 2006 18:32:52 -0000 1.26 @@ -28,10 +28,12 @@ import java.util.Iterator; import java.util.Map; import java.util.Set; +import java.lang.reflect.Constructor; import javax.management.MBeanServer; import javax.management.MBeanServerInvocationHandler; import javax.management.MalformedObjectNameException; import javax.management.ObjectName; +import javax.net.ServerSocketFactory; import org.jboss.remoting.callback.Callback; import org.jboss.remoting.callback.InvokerCallbackHandler; import org.jboss.remoting.callback.ServerInvokerCallbackHandler; @@ -41,6 +43,8 @@ import org.jboss.remoting.stream.StreamHandler; import org.jboss.remoting.stream.StreamInvocationHandler; import org.jboss.remoting.transport.PortUtil; +import org.jboss.remoting.security.ServerSocketFactoryMBean; +import org.jboss.remoting.util.ServerSocketFactoryWrapper; import org.jboss.util.threadpool.BasicThreadPool; import org.jboss.util.threadpool.BlockingMode; import org.jboss.util.threadpool.ThreadPool; @@ -52,7 +56,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:tom...@jb...">Tom Elrod</a> - * @version $Revision: 1.25 $ + * @version $Revision: 1.26 $ */ public abstract class ServerInvoker extends AbstractInvoker implements ServerInvokerMBean { @@ -64,6 +68,7 @@ public static final String CLIENT_CONNECT_PORT_KEY = "clientConnectPort"; public static final String CLIENT_LEASE_PERIOD = "clientLeasePeriod"; public static final String TIMEOUT = "timeout"; + public static final String SERVER_SOCKET_FACTORY = "serverSocketFactory"; /** * The max number of worker threads to be used in the @@ -109,6 +114,7 @@ private Map clientLeases = new HashMap(); private ConnectionNotifier connectionNotifier = null; + private ServerSocketFactory serverSocketFactory = null; public ServerInvoker(InvokerLocator locator) { @@ -264,6 +270,123 @@ throw new InvalidConfigurationException("Can not set client lease period because can not convert given value (" + clientLeasePeriod + ") to a number."); } } + + createServerSocketFactory(); + } + + public void setServerSocketFactory(ServerSocketFactory serverSocketFactory) + { + this.serverSocketFactory = serverSocketFactory; + } + + public ServerSocketFactory getServerSocketFactory() + { + return serverSocketFactory; + } + + protected ServerSocketFactory createServerSocketFactory() throws IOException + { + // only want to look at config if server socket factory has not already been set + if(serverSocketFactory == null) + { + /** + * TODO: -TME This is another big hack because of dependancy on JMX within configuration. + * Have to wait till the mbean server is set before can actually set the server socket + * factory since it is an mbean (new server's DI will fix all this). Would prefer this + * to be in the setup() method... + * Also, I can't cast the mbean proxy directly to ServerSocketFactory because it is not + * an interface. Therefore, have to require that ServerSocketFactoryMBean is used. + */ + String serverSocketFactoryString = (String)configuration.get(SERVER_SOCKET_FACTORY); + if(serverSocketFactoryString != null && serverSocketFactoryString.length() > 0) + { + try + { + if(serverSocketFactoryString != null) + { + MBeanServer server = getMBeanServer(); + ObjectName serverSocketFactoryObjName = new ObjectName(serverSocketFactoryString); + if(server != null) + { + try + { + ServerSocketFactoryMBean serverSocketFactoryMBean = (ServerSocketFactoryMBean) MBeanServerInvocationHandler.newProxyInstance(server, + serverSocketFactoryObjName, + ServerSocketFactoryMBean.class, + false); + serverSocketFactory = new ServerSocketFactoryWrapper(serverSocketFactoryMBean); + } + catch(Exception e) + { + log.debug("Error creating mbean proxy for server socket factory for object name: " + serverSocketFactoryObjName + ". Will try by class name."); + } + } + else + { + log.debug("The 'serverSocketFactory' attribute was set with a value, but the MBeanServer reference is null."); + } + } + } + catch(MalformedObjectNameException e) + { + log.debug("Attibute value (" + serverSocketFactoryString + ") passed is not a valid ObjectName. Can not look up if is a mbean service. Will try by classname."); + } + catch(NullPointerException e) + { + log.debug("Could not set up the server socket factory as a mbean service due to null pointer exception."); + } + + // couldn't create from object name for mbean service, will try by class name + if(serverSocketFactory == null) + { + //ClassLoader classLoader = invoker.getClassLoader(); + ClassLoader classLoader = null; + if(classLoader == null) + { + classLoader = Thread.currentThread().getContextClassLoader(); + + if(classLoader == null) + { + classLoader = getClass().getClassLoader(); + } + } + try + { + Class cl = classLoader.loadClass(serverSocketFactoryString); + + Constructor serverSocketConstructor = null; + serverSocketConstructor = cl.getConstructor(new Class[]{}); + serverSocketFactory = (ServerSocketFactory)serverSocketConstructor.newInstance(new Object[] {}); + log.trace("ServerSocketFactory (" + serverSocketFactoryString + ") loaded"); + } + catch(Exception e) + { + log.debug("Could not create server socket factory by classname (" + serverSocketFactoryString + "). Error message: " + e.getMessage()); + } + } + } + } + + if(serverSocketFactory == null) + { + log.debug("Did not find server socket factory configuration as mbean service or classname. Creating default server socket."); + serverSocketFactory = getDefaultServerSocketFactory(); + } + + log.debug("Created server socket factory: " + serverSocketFactory); + + return serverSocketFactory; + + } + + /** + * Gets the default server socket factory to use for the server invoker. The intention + * is this method will be overridden by sub-classes for their specific defaults. + * @return + */ + protected ServerSocketFactory getDefaultServerSocketFactory() + { + return ServerSocketFactory.getDefault(); } public void setTimeout(int timeout) |
From: Tom E. <tom...@jb...> - 2006-03-21 04:17:33
|
User: telrod Date: 06/03/20 23:17:27 Modified: src/main/org/jboss/remoting ServerInvoker.java Log: JBREM-341 - changed to if invocation request does not contain a client session id, a lease will not be set up for it. Revision Changes Path 1.27 +15 -12 JBossRemoting/src/main/org/jboss/remoting/ServerInvoker.java (In the diff below, changes in quantity of whitespace are not shown.) Index: ServerInvoker.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/ServerInvoker.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -b -r1.26 -r1.27 --- ServerInvoker.java 14 Mar 2006 18:32:52 -0000 1.26 +++ ServerInvoker.java 21 Mar 2006 04:17:27 -0000 1.27 @@ -56,7 +56,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:tom...@jb...">Tom Elrod</a> - * @version $Revision: 1.26 $ + * @version $Revision: 1.27 $ */ public abstract class ServerInvoker extends AbstractInvoker implements ServerInvokerMBean { @@ -856,6 +856,8 @@ if(invocation != null) { String clientSessionId = invocation.getSessionId(); + if(clientSessionId != null) + { Lease clientLease = (Lease)clientLeases.get(clientSessionId); if(clientLease == null) { @@ -871,6 +873,7 @@ } } } + } /** * Takes the real invocation from the client out of the OnewayInvocation and then executes the invoke() |
From: Tom E. <tom...@jb...> - 2006-03-21 05:17:36
|
User: telrod Date: 06/03/21 00:17:30 Modified: src/main/org/jboss/remoting InvokerLocator.java Log: JBREM-341 - added ability to set client lease period in the client's locator uri. Revision Changes Path 1.16 +9 -1 JBossRemoting/src/main/org/jboss/remoting/InvokerLocator.java (In the diff below, changes in quantity of whitespace are not shown.) Index: InvokerLocator.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/InvokerLocator.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -b -r1.15 -r1.16 --- InvokerLocator.java 2 Mar 2006 21:04:51 -0000 1.15 +++ InvokerLocator.java 21 Mar 2006 05:17:30 -0000 1.16 @@ -57,7 +57,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:te...@e2...">Tom Elrod</a> - * @version $Revision: 1.15 $ + * @version $Revision: 1.16 $ */ public class InvokerLocator implements Serializable { @@ -119,6 +119,14 @@ public static final String CLIENT_LEASE = "leasing"; /** + * Constant to define what the client lease period should be in the case that + * server side leasing is turned on. Value for this parameter key should be the number + * of milliseconds to wait before each client lease renewal and must be greater than zero + * in order to be recognized. + */ + public static final String CLIENT_LEASE_PERIOD = "lease_period"; + + /** * Constructs the object used to identify a remoting server via simple uri format string (e.g. socket://myhost:7000). * Note: the uri passed may not always be the one returned via call to getLocatorURI() as may need to change if * port not specified, host is 0.0.0.0, etc. If need original uri that is passed to this constructor, need to |
From: Tom E. <tom...@jb...> - 2006-03-21 05:17:42
|
User: telrod Date: 06/03/21 00:17:41 Modified: src/main/org/jboss/remoting Client.java Log: JBREM-341 - added ability to set client lease period in the client's locator uri. Revision Changes Path 1.26 +29 -11 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.25 retrieving revision 1.26 diff -u -b -r1.25 -r1.26 --- Client.java 8 Mar 2006 08:26:50 -0000 1.25 +++ Client.java 21 Mar 2006 05:17:41 -0000 1.26 @@ -47,7 +47,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:te...@e2...">Tom Elrod</a> - * @version $Revision: 1.25 $ + * @version $Revision: 1.26 $ */ public class Client implements Serializable { @@ -97,6 +97,7 @@ private Map configuration = null; private boolean enableLease = false; + private long leasePeriod = -1; /** * Constructs a remoting client with intended target server specified via the lcoator, @@ -310,6 +311,18 @@ { enableLease = Boolean.valueOf(leaseValue).booleanValue(); } + String leasePeriodValue = (String)locatorParams.get(InvokerLocator.CLIENT_LEASE_PERIOD); + if(leasePeriodValue != null && leasePeriodValue.length() > 0) + { + try + { + leasePeriod = Long.parseLong(leasePeriodValue); + } + catch(NumberFormatException e) + { + log.warn("Could not convert client lease period value (" + leasePeriodValue + ") to a number."); + } + } } } @@ -345,18 +358,23 @@ Boolean shouldLease = (Boolean)resp.getResult(); if(shouldLease.booleanValue()) { + + // if lease period not set via locator param, check value returned by server + if(leasePeriod < 0) + { Map respMap = resp.getPayload(); if(respMap != null) { Long leaseTimeoutValue = (Long) respMap.get("clientLeasePeriod"); - long leaseTimeout = leaseTimeoutValue.longValue(); - if(leaseTimeout > 0) + leasePeriod = leaseTimeoutValue.longValue(); + } + } + if(leasePeriod > 0) { if(leasePinger == null) { leasePinger = new LeasePinger(this); - leasePinger.startPing(leaseTimeout); - } + leasePinger.startPing(leasePeriod); } } } |
From: Tom E. <tom...@jb...> - 2006-03-21 07:20:48
|
User: telrod Date: 06/03/21 02:20:45 Modified: src/main/org/jboss/remoting Lease.java Log: JBREM-342 - convert lease timers to use org.jboss.util.TimerQueue Revision Changes Path 1.3 +14 -11 JBossRemoting/src/main/org/jboss/remoting/Lease.java (In the diff below, changes in quantity of whitespace are not shown.) Index: Lease.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/Lease.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -b -r1.2 -r1.3 --- Lease.java 19 Jan 2006 04:25:24 -0000 1.2 +++ Lease.java 21 Mar 2006 07:20:45 -0000 1.3 @@ -21,9 +21,9 @@ */ package org.jboss.remoting; -import java.util.Timer; -import java.util.TimerTask; import java.util.Map; +import org.jboss.util.TimerQueue; +import org.jboss.util.TimerTask; /** * This class is used on the remoting server to maintain lease information @@ -41,14 +41,14 @@ * start sending lease pings. Otherwise, client might get the * lease time and start pinging before the lease time runs out. */ - public static long TIMER_DELAY= 5000; + public static long TIMER_DELAY = 5000; private ConnectionNotifier notifier = null; private String clientSessionId = null; private long leasePeriod = -1; private String locatorURL = null; private Map requestPayload = null; - private Timer leaseTimer = null; + private TimerQueue leaseTimer = null; private boolean leaseUpdated = false; @@ -60,13 +60,14 @@ this.locatorURL = locatorurl; this.requestPayload = requestPayload; // run as deamon, since want to go away when server does - leaseTimer = new Timer(true); + leaseTimer = new TimerQueue("Lease-" + clientSessionId); } public void startLease() { - leaseTimer.schedule(new LeaseTimerTask(), leasePeriod + TIMER_DELAY, leasePeriod); + leaseTimer.start(); + leaseTimer.schedule(new LeaseTimerTask(), leasePeriod + TIMER_DELAY); } public void updateLease(long leasePeriod) @@ -75,8 +76,9 @@ if(leasePeriod != this.leasePeriod) { this.leasePeriod = leasePeriod; - leaseTimer.cancel(); - leaseTimer.schedule(new LeaseTimerTask(), leasePeriod + TIMER_DELAY, leasePeriod); + stopLease(); + leaseTimer = new TimerQueue("Lease-" + clientSessionId); + startLease(); } } @@ -88,7 +90,7 @@ private void stopLease() { - leaseTimer.cancel(); + leaseTimer.stop(); } private class LeaseTimerTask extends TimerTask @@ -97,16 +99,17 @@ /** * The action to be performed by this timer task. */ - public void run() + public void execute() { if(leaseUpdated) { leaseUpdated = false; + leaseTimer.schedule(this, leasePeriod); } else { - notifier.connectionLost(locatorURL, clientSessionId, requestPayload); stopLease(); + notifier.connectionLost(locatorURL, clientSessionId, requestPayload); } } } |
From: Tom E. <tom...@jb...> - 2006-03-21 07:20:59
|
User: telrod Date: 06/03/21 02:20:57 Modified: src/main/org/jboss/remoting LeasePinger.java Log: JBREM-342 - convert lease timers to use org.jboss.util.TimerQueue Revision Changes Path 1.2 +10 -7 JBossRemoting/src/main/org/jboss/remoting/LeasePinger.java (In the diff below, changes in quantity of whitespace are not shown.) Index: LeasePinger.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/LeasePinger.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- LeasePinger.java 17 Jan 2006 18:53:40 -0000 1.1 +++ LeasePinger.java 21 Mar 2006 07:20:57 -0000 1.2 @@ -1,8 +1,8 @@ package org.jboss.remoting; -import java.util.Timer; -import java.util.TimerTask; import org.jboss.logging.Logger; +import org.jboss.util.TimerQueue; +import org.jboss.util.TimerTask; /** * Internal agent class to ping the remote server to keep lease alive. @@ -14,29 +14,32 @@ private Client client = null; private long pingPeriod = -1; - private Timer pingTimer = null; + private TimerQueue pingTimer = null; private static final Logger log = Logger.getLogger(LeasePinger.class); public LeasePinger(Client remotingClient) { this.client = remotingClient; - pingTimer = new Timer(true); + pingTimer = new TimerQueue("LeasePinger-" + client.getSessionId()); } public void startPing(long leaseTimeout) { this.pingPeriod = leaseTimeout; - pingTimer.schedule(this, pingPeriod, pingPeriod); + pingTimer.start(); + pingTimer.schedule(this, pingPeriod); } public void stopPing() { - pingTimer.cancel(); + pingTimer.stop(); } - public void run() + public void execute() throws Exception { + pingTimer.schedule(this, pingPeriod); + if(client != null) { try |
From: Tom E. <tom...@jb...> - 2006-03-21 07:44:30
|
User: telrod Date: 06/03/21 02:44:28 Modified: src/main/org/jboss/remoting InvokerRegistry.java Log: JBREM-350 - moved debug log statement to synchronized block as causing concurrent modification error otherwise. Revision Changes Path 1.22 +2 -3 JBossRemoting/src/main/org/jboss/remoting/InvokerRegistry.java (In the diff below, changes in quantity of whitespace are not shown.) Index: InvokerRegistry.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/InvokerRegistry.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -b -r1.21 -r1.22 --- InvokerRegistry.java 14 Mar 2006 05:12:28 -0000 1.21 +++ InvokerRegistry.java 21 Mar 2006 07:44:28 -0000 1.22 @@ -42,7 +42,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:te...@e2...">Tom Elrod</a> - * @version $Revision: 1.21 $ + * @version $Revision: 1.22 $ */ public class InvokerRegistry { @@ -244,12 +244,11 @@ synchronized(clientLock) { invoker = (ClientInvoker) clientLocators.remove(locator); + log.debug("destroying client for locator: " + locator + ", invoker:" + invoker + ", remaining list:" + clientLocators); } if(invoker != null) { - log.debug("destroying client for locator: " + locator + ", invoker:" + invoker + ", remaining list:" + clientLocators); - invoker.disconnect(); invoker = null; } |
From: Ron S. <ron...@ya...> - 2006-03-21 21:15:16
|
User: rsigal Date: 06/03/21 16:15:08 Modified: src/main/org/jboss/remoting Client.java Log: JBREM-335: Client.invoke() should pass configuration map to InvokerRegistry.createClientInvoker(). Changed Client.invok() so that it passes configuration map to InvokerRegistry.createClientInvoker(). Revision Changes Path 1.27 +12 -12 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.26 retrieving revision 1.27 diff -u -b -r1.26 -r1.27 --- Client.java 21 Mar 2006 05:17:41 -0000 1.26 +++ Client.java 21 Mar 2006 21:15:08 -0000 1.27 @@ -47,7 +47,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:te...@e2...">Tom Elrod</a> - * @version $Revision: 1.26 $ + * @version $Revision: 1.27 $ */ public class Client implements Serializable { @@ -256,6 +256,16 @@ } /** + * Gets the configuration map passed when constructing + * this object. + * @return + */ + public Map getConfiguration() + { + return configuration; + } + +/** * Gets the session id used when making invocations on server invokers. * This is the id that will be used for tracking client connections on * the server side, to include client failures that are sent to @@ -503,7 +513,7 @@ { log.debug("invoke called, but our invoker is disconnected, discarding and fetching another fresh invoker for: " + invoker.getLocator()); - localInvoker = InvokerRegistry.createClientInvoker(localInvoker.getLocator()); + localInvoker = InvokerRegistry.createClientInvoker(localInvoker.getLocator(), configuration); connect(localInvoker); } } @@ -826,14 +836,4 @@ // now call on target server and pass locator for stream callbacks return invoke(new InternalInvocation(InternalInvocation.ADDSTREAMCALLBACK, new Object[]{locator, param}), null); } - - /** - * Gets the configuration map passed when constructing - * this object. - * @return - */ - public Map getConfiguration() - { - return configuration; - } } |
From: Ron S. <ron...@ya...> - 2006-03-21 21:29:19
|
User: rsigal Date: 06/03/21 16:29:16 Modified: src/main/org/jboss/remoting ServerInvoker.java Log: JBREM-356: ServerInvoker should destroy its callback handlers. Added code to stop() to call destroy() on all callback handlers. Revision Changes Path 1.28 +8 -1 JBossRemoting/src/main/org/jboss/remoting/ServerInvoker.java (In the diff below, changes in quantity of whitespace are not shown.) Index: ServerInvoker.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/ServerInvoker.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -b -r1.27 -r1.28 --- ServerInvoker.java 21 Mar 2006 04:17:27 -0000 1.27 +++ ServerInvoker.java 21 Mar 2006 21:29:16 -0000 1.28 @@ -56,7 +56,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:tom...@jb...">Tom Elrod</a> - * @version $Revision: 1.27 $ + * @version $Revision: 1.28 $ */ public abstract class ServerInvoker extends AbstractInvoker implements ServerInvokerMBean { @@ -1180,6 +1180,13 @@ public void stop() { started = false; + + Iterator it = callbackHandlers.values().iterator(); + while (it.hasNext()) + { + ServerInvokerCallbackHandler callbackHandler = (ServerInvokerCallbackHandler) it.next(); + callbackHandler.destroy(); + } } /** |
From: Tom E. <tom...@jb...> - 2006-03-22 06:34:09
|
User: telrod Date: 06/03/22 01:34:02 Modified: src/main/org/jboss/remoting Lease.java Log: JBREM-342 - lease will now take into account how long it is taking for ping to come in and increase lease window accordingly. Revision Changes Path 1.4 +34 -12 JBossRemoting/src/main/org/jboss/remoting/Lease.java (In the diff below, changes in quantity of whitespace are not shown.) Index: Lease.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/Lease.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -b -r1.3 -r1.4 --- Lease.java 21 Mar 2006 07:20:45 -0000 1.3 +++ Lease.java 22 Mar 2006 06:34:02 -0000 1.4 @@ -49,6 +49,9 @@ private String locatorURL = null; private Map requestPayload = null; private TimerQueue leaseTimer = null; + private LeaseTimerTask leaseTimerTask = null; + private long leaseWindow = -1; + private long pingStart = -1; private boolean leaseUpdated = false; @@ -59,7 +62,7 @@ this.notifier = notifier; this.locatorURL = locatorurl; this.requestPayload = requestPayload; - // run as deamon, since want to go away when server does + this.leaseWindow = leasePeriod; leaseTimer = new TimerQueue("Lease-" + clientSessionId); } @@ -67,7 +70,9 @@ public void startLease() { leaseTimer.start(); - leaseTimer.schedule(new LeaseTimerTask(), leasePeriod + TIMER_DELAY); + leaseTimerTask = new LeaseTimerTask(); + leaseTimer.schedule(leaseTimerTask, leasePeriod + TIMER_DELAY); + pingStart = System.currentTimeMillis(); } public void updateLease(long leasePeriod) @@ -76,10 +81,21 @@ if(leasePeriod != this.leasePeriod) { this.leasePeriod = leasePeriod; + this.leaseWindow = leasePeriod; stopLease(); - leaseTimer = new TimerQueue("Lease-" + clientSessionId); startLease(); } + else + { + long pingDuration = System.currentTimeMillis() - pingStart; + if(pingDuration > (leaseWindow / 2)) + { + leaseWindow = pingDuration * 2; + } + leaseTimer.schedule(leaseTimerTask, leaseWindow); + pingStart = System.currentTimeMillis(); + } + } public void terminateLease(long leasePeriod) @@ -90,21 +106,26 @@ private void stopLease() { + leaseTimerTask.running = false; leaseTimer.stop(); } private class LeaseTimerTask extends TimerTask { + protected boolean running = true; + /** * The action to be performed by this timer task. */ public void execute() { + if(running) + { if(leaseUpdated) { leaseUpdated = false; - leaseTimer.schedule(this, leasePeriod); + leaseTimer.schedule(this, leaseWindow); } else { @@ -113,4 +134,5 @@ } } } + } } \ No newline at end of file |
From: Tom E. <tom...@jb...> - 2006-03-27 22:47:04
|
User: telrod Date: 06/03/27 17:47:01 Modified: src/main/org/jboss/remoting Version.java Log: JBREM-340 - added wire versioning and versioning tests over previous releases. Revision Changes Path 1.6 +69 -1 JBossRemoting/src/main/org/jboss/remoting/Version.java (In the diff below, changes in quantity of whitespace are not shown.) Index: Version.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/Version.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -b -r1.5 -r1.6 --- Version.java 26 Jan 2006 16:13:48 -0000 1.5 +++ Version.java 27 Mar 2006 22:47:01 -0000 1.6 @@ -22,17 +22,85 @@ package org.jboss.remoting; +import org.jboss.logging.Logger; + /** * @author <a href="mailto:tom...@jb...">Tom Elrod</a> */ public class Version { - public static final String VERSION = "1.4.0 Final"; + // possible remoting versions + public static final byte VERSION_1 = 1; + public static final byte VERSION_2 = 2; + + public static final String VERSION = "2.0.0 Beta (Boon)"; + private static final byte byteVersion = VERSION_2; + private static byte defaultByteVersion = byteVersion; + private static boolean performVersioning = true; + + + public static final String PRE_2_0_COMPATIBLE = "jboss.remoting.pre_2_0_compatible"; + //TODO: -TME Is this the best system property key to use? May want to use something that + // is more decscriptive that is user defined version. However, may want to make available + // to users via system property the version of remoting? + public static final String REMOTING_VERSION_TO_USE = "jboss.remoting.version"; + final static private Logger log = Logger.getLogger(Version.class); + + // have a static block to load the user defined version to use + static + { + boolean precompatibleFlag = false; + String precompatible = System.getProperty(PRE_2_0_COMPATIBLE); + if(precompatible != null && precompatible.length() > 0) + { + precompatibleFlag = Boolean.valueOf(precompatible).booleanValue(); + } + // if is precompatible, no need to look for custom version, as there is only 1 precompatible version + if(precompatibleFlag) + { + defaultByteVersion = 1; + performVersioning = false; + } + else + { + String userDefinedVersion = System.getProperty(REMOTING_VERSION_TO_USE); + if(userDefinedVersion != null && userDefinedVersion.length() > 0) + { + byte userByteVersion = new Byte(userDefinedVersion).byteValue(); + if(userByteVersion > 0) + { + defaultByteVersion = userByteVersion; + if(defaultByteVersion < 2) + { + performVersioning = false; + } + } + else + { + log.error("Can not set remoting version to value less than 1. " + + "System property value set for '" + REMOTING_VERSION_TO_USE + "' was " + userDefinedVersion); + } + } + else + { + System.setProperty(REMOTING_VERSION_TO_USE, new Byte(defaultByteVersion).toString()); + } + } + } public static void main(String arg[]) { System.out.println("JBossRemoting Version " + VERSION); } + public static int getDefaultVersion() + { + return defaultByteVersion; + } + + public static boolean performVersioning() + { + return performVersioning; + } } \ No newline at end of file |
From: Ron S. <ron...@ya...> - 2006-03-28 02:33:40
|
User: rsigal Date: 06/03/27 21:33:37 Modified: src/main/org/jboss/remoting InvokerRegistry.java Log: Revision Changes Path 1.23 +3 -1 JBossRemoting/src/main/org/jboss/remoting/InvokerRegistry.java (In the diff below, changes in quantity of whitespace are not shown.) Index: InvokerRegistry.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/InvokerRegistry.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -b -r1.22 -r1.23 --- InvokerRegistry.java 21 Mar 2006 07:44:28 -0000 1.22 +++ InvokerRegistry.java 28 Mar 2006 02:33:37 -0000 1.23 @@ -42,7 +42,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:te...@e2...">Tom Elrod</a> - * @version $Revision: 1.22 $ + * @version $Revision: 1.23 $ */ public class InvokerRegistry { @@ -86,6 +86,8 @@ serverInvokerFQN.put("servlet", "org.jboss.remoting.transport.servlet.ServletServerInvoker"); clientInvokerFQN.put("multiplex", "org.jboss.remoting.transport.multiplex.MultiplexClientInvoker"); serverInvokerFQN.put("multiplex", "org.jboss.remoting.transport.multiplex.MultiplexServerInvoker"); + clientInvokerFQN.put("sslmultiplex", "org.jboss.remoting.transport.multiplex.ssl.SSLMultiplexClientInvoker"); + serverInvokerFQN.put("sslmultiplex", "org.jboss.remoting.transport.multiplex.ssl.SSLMultiplexServerInvoker"); } /** |
From: Ron S. <ron...@ya...> - 2006-03-28 02:33:55
|
User: rsigal Date: 06/03/27 21:33:51 Modified: src/main/org/jboss/remoting RemoteClientInvoker.java Log: Revision Changes Path 1.16 +480 -441 JBossRemoting/src/main/org/jboss/remoting/RemoteClientInvoker.java (In the diff below, changes in quantity of whitespace are not shown.) Index: RemoteClientInvoker.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/RemoteClientInvoker.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -b -r1.15 -r1.16 --- RemoteClientInvoker.java 18 Jan 2006 05:47:51 -0000 1.15 +++ RemoteClientInvoker.java 28 Mar 2006 02:33:51 -0000 1.16 @@ -24,6 +24,9 @@ import java.io.IOException; import java.util.Map; + +import javax.net.SocketFactory; + import org.jboss.remoting.loading.ClassByteClassLoader; import org.jboss.remoting.loading.RemotingClassLoader; import org.jboss.remoting.marshal.InvalidMarshallingResource; @@ -31,6 +34,7 @@ import org.jboss.remoting.marshal.Marshaller; import org.jboss.remoting.marshal.UnMarshaller; import org.jboss.remoting.transport.ClientInvoker; +import org.jboss.remoting.util.socket.RemotingSSLSocketFactory; /** * RemoteClientInvoker is an abstract client part handler that implements the bulk of the heavy @@ -43,7 +47,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:te...@e2...">Tom Elrod</a> - * @version $Revision: 1.15 $ + * @version $Revision: 1.16 $ */ public abstract class RemoteClientInvoker extends AbstractInvoker implements ClientInvoker { @@ -52,6 +56,8 @@ private UnMarshaller unmarshaller; private String dataType; + // SocketFactory for use by derived transports + private SocketFactory socketFactory; public RemoteClientInvoker(InvokerLocator locator) { @@ -61,6 +67,7 @@ public RemoteClientInvoker(InvokerLocator locator, Map configuration) { super(locator, configuration); + socketFactory = createSocketFactory(configuration); } /** @@ -336,6 +343,11 @@ return this.unmarshaller; } + public SocketFactory getSocketFactory() + { + return socketFactory; + } + /** * Will get the data type for the marshaller factory so know which marshaller to * get to marshal the data. Will first check the locator uri for a 'datatype' @@ -438,4 +450,31 @@ disconnect(); super.finalize(); } + + /** + * If any configuration parameters relate to the construction of a RemotingSSLSocketFactory, + * create one. + * + * @param configuration + * @return + */ + protected SocketFactory createSocketFactory(Map configuration) + { + if (configuration == null) + return null; + + if (configuration.get(RemotingSSLSocketFactory.REMOTING_ALGORITHM) != null || + configuration.get(RemotingSSLSocketFactory.REMOTING_KEY_ALIAS) != null || + configuration.get(RemotingSSLSocketFactory.REMOTING_KEY_STORE_FILE_PATH) != null || + configuration.get(RemotingSSLSocketFactory.REMOTING_KEY_STORE_PASSWORD) != null || + configuration.get(RemotingSSLSocketFactory.REMOTING_KEY_STORE_TYPE) != null || + configuration.get(RemotingSSLSocketFactory.REMOTING_TRUST_ALGORITHM) != null || + configuration.get(RemotingSSLSocketFactory.STANDARD_TRUST_STORE_FILE_PATH) != null || + configuration.get(RemotingSSLSocketFactory.REMOTING_TRUST_STORE_PASSWORD) != null || + configuration.get(RemotingSSLSocketFactory.STANDARD_KEY_STORE_TYPE) != null + ) + return new RemotingSSLSocketFactory(configuration); + else + return null; + } } |
From: Ron S. <ron...@ya...> - 2006-03-28 07:28:11
|
User: rsigal Date: 06/03/28 02:28:08 Modified: src/main/org/jboss/remoting RemoteClientInvoker.java Log: Revision Changes Path 1.17 +480 -480 JBossRemoting/src/main/org/jboss/remoting/RemoteClientInvoker.java (In the diff below, changes in quantity of whitespace are not shown.) Index: RemoteClientInvoker.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/RemoteClientInvoker.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -b -r1.16 -r1.17 --- RemoteClientInvoker.java 28 Mar 2006 02:33:51 -0000 1.16 +++ RemoteClientInvoker.java 28 Mar 2006 07:28:08 -0000 1.17 @@ -47,7 +47,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:te...@e2...">Tom Elrod</a> - * @version $Revision: 1.16 $ + * @version $Revision: 1.17 $ */ public abstract class RemoteClientInvoker extends AbstractInvoker implements ClientInvoker { @@ -469,9 +469,9 @@ configuration.get(RemotingSSLSocketFactory.REMOTING_KEY_STORE_PASSWORD) != null || configuration.get(RemotingSSLSocketFactory.REMOTING_KEY_STORE_TYPE) != null || configuration.get(RemotingSSLSocketFactory.REMOTING_TRUST_ALGORITHM) != null || - configuration.get(RemotingSSLSocketFactory.STANDARD_TRUST_STORE_FILE_PATH) != null || + configuration.get(RemotingSSLSocketFactory.REMOTING_TRUST_STORE_FILE_PATH) != null || configuration.get(RemotingSSLSocketFactory.REMOTING_TRUST_STORE_PASSWORD) != null || - configuration.get(RemotingSSLSocketFactory.STANDARD_KEY_STORE_TYPE) != null + configuration.get(RemotingSSLSocketFactory.REMOTING_KEY_STORE_TYPE) != null ) return new RemotingSSLSocketFactory(configuration); else |
From: Ron S. <ron...@ya...> - 2006-03-28 07:40:07
|
User: rsigal Date: 06/03/28 02:40:02 Modified: src/main/org/jboss/remoting RemoteClientInvoker.java Log: Revision Changes Path 1.18 +2 -2 JBossRemoting/src/main/org/jboss/remoting/RemoteClientInvoker.java (In the diff below, changes in quantity of whitespace are not shown.) Index: RemoteClientInvoker.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/RemoteClientInvoker.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -b -r1.17 -r1.18 --- RemoteClientInvoker.java 28 Mar 2006 07:28:08 -0000 1.17 +++ RemoteClientInvoker.java 28 Mar 2006 07:40:02 -0000 1.18 @@ -47,7 +47,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:te...@e2...">Tom Elrod</a> - * @version $Revision: 1.17 $ + * @version $Revision: 1.18 $ */ public abstract class RemoteClientInvoker extends AbstractInvoker implements ClientInvoker { @@ -471,7 +471,7 @@ configuration.get(RemotingSSLSocketFactory.REMOTING_TRUST_ALGORITHM) != null || configuration.get(RemotingSSLSocketFactory.REMOTING_TRUST_STORE_FILE_PATH) != null || configuration.get(RemotingSSLSocketFactory.REMOTING_TRUST_STORE_PASSWORD) != null || - configuration.get(RemotingSSLSocketFactory.REMOTING_KEY_STORE_TYPE) != null + configuration.get(RemotingSSLSocketFactory.REMOTING_TRUST_STORE_TYPE) != null ) return new RemotingSSLSocketFactory(configuration); else |