JBoss Remoting SVN: r3575 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-06 03:18:07 -0500 (Thu, 06 Mar 2008)
New Revision: 3575
Added:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/BisocketConfigurableVersionTestCase.java
Log:
JBREM-764: New unit tests.
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/BisocketConfigurableVersionTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/BisocketConfigurableVersionTestCase.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/BisocketConfigurableVersionTestCase.java 2008-03-06 08:18:07 UTC (rev 3575)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.remoting.version;
+
+
+/**
+ * Unit test for JBREM-764.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright Mar 6, 2008
+ * </p>
+ */
+public class BisocketConfigurableVersionTestCase extends ConfigurableVersionTestParent
+{
+ protected String getTransport()
+ {
+ return "bisocket";
+ }
+}
+
16 years, 9 months
JBoss Remoting SVN: r3574 - in remoting2/branches/2.x/src/tests/org/jboss/test/remoting: version and 1 other directory.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-06 03:17:45 -0500 (Thu, 06 Mar 2008)
New Revision: 3574
Added:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/ConfigurableVersionTestParent.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/HttpConfigurableVersionTestCase.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/RMIConfigurableVersionTestCase.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/SocketConfigurableVersionTestCase.java
Log:
JBREM-764: New unit tests.
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/ConfigurableVersionTestParent.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/ConfigurableVersionTestParent.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/ConfigurableVersionTestParent.java 2008-03-06 08:17:45 UTC (rev 3574)
@@ -0,0 +1,194 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.remoting.version;
+
+import java.net.InetAddress;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.MBeanServer;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.ConsoleAppender;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.log4j.PatternLayout;
+import org.jboss.logging.XLevel;
+import org.jboss.remoting.Client;
+import org.jboss.remoting.InvocationRequest;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.Remoting;
+import org.jboss.remoting.ServerInvocationHandler;
+import org.jboss.remoting.ServerInvoker;
+import org.jboss.remoting.Version;
+import org.jboss.remoting.callback.InvokerCallbackHandler;
+import org.jboss.remoting.transport.Connector;
+import org.jboss.remoting.transport.PortUtil;
+
+
+/**
+ * Unit test for JBREM-764.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright Mar 6, 2008
+ * </p>
+ */
+public abstract class ConfigurableVersionTestParent extends TestCase
+{
+ private static Logger log = Logger.getLogger(ConfigurableVersionTestParent.class);
+
+ private static boolean firstTime = true;
+
+ protected String host;
+ protected int port;
+ protected String locatorURI;
+ protected InvokerLocator serverLocator;
+ protected Connector connector;
+ protected TestInvocationHandler invocationHandler;
+
+
+ public void setUp() throws Exception
+ {
+ if (firstTime)
+ {
+ firstTime = false;
+ Logger.getLogger("org.jboss.remoting").setLevel(XLevel.INFO);
+ Logger.getLogger("org.jboss.test.remoting").setLevel(Level.INFO);
+ String pattern = "[%d{ABSOLUTE}] [%t] %5p (%F:%L) - %m%n";
+ PatternLayout layout = new PatternLayout(pattern);
+ ConsoleAppender consoleAppender = new ConsoleAppender(layout);
+ Logger.getRootLogger().addAppender(consoleAppender);
+ }
+ }
+
+
+ public void tearDown()
+ {
+ }
+
+
+ public void testVersions() throws Throwable
+ {
+ log.info("entering " + getName());
+
+ // Start servers.
+ Connector connector1 = setupServer(Version.VERSION_1);
+ Connector connector2 = setupServer(Version.VERSION_2);
+ Connector connector22 = setupServer(Version.VERSION_2_2);
+ Connector connector0 = setupServer(-1);
+
+ // Create clients.
+ Client client1 = setupClient(connector1);
+ Client client2 = setupClient(connector2);
+ Client client22 = setupClient(connector22);
+ Client client0 = setupClient(connector0);
+
+ // Test connections.
+ assertEquals("abc", client1.invoke("abc"));
+ assertEquals("abc", client2.invoke("abc"));
+ assertEquals("abc", client22.invoke("abc"));
+ assertEquals("abc", client0.invoke("abc"));
+
+ client1.disconnect();
+ client2.disconnect();
+ client22.disconnect();
+ client0.disconnect();
+
+ connector1.stop();
+ connector2.stop();
+ connector22.stop();
+ connector0.stop();
+
+ log.info(getName() + " PASSES");
+ }
+
+
+ abstract protected String getTransport();
+
+
+ protected void addExtraClientConfig(Map config) {}
+ protected void addExtraServerConfig(Map config) {}
+
+
+ protected Connector setupServer(int version) throws Exception
+ {
+ host = InetAddress.getLocalHost().getHostAddress();
+ port = PortUtil.findFreePort(host);
+ locatorURI = getTransport() + "://" + host + ":" + port + "/?";
+
+ if (version > 0)
+ {
+ locatorURI += Remoting.REMOTING_VERSION + "=" + version;
+ }
+ else
+ {
+ locatorURI += "x=y";
+ }
+
+ String parameters = System.getProperty("remoting.metadata");
+ if (parameters != null)
+ {
+ locatorURI += "&" + parameters;
+ }
+
+ serverLocator = new InvokerLocator(locatorURI);
+ log.info("Starting remoting server with locator uri of: " + locatorURI);
+ HashMap config = new HashMap();
+ config.put(InvokerLocator.FORCE_REMOTE, "true");
+ addExtraServerConfig(config);
+ connector = new Connector(serverLocator, config);
+ connector.create();
+ invocationHandler = new TestInvocationHandler();
+ connector.addInvocationHandler("test", invocationHandler);
+ connector.start();
+ return connector;
+ }
+
+
+ protected Client setupClient(Connector connector) throws Exception
+ {
+ InvokerLocator locator = connector.getLocator();
+ HashMap config = new HashMap();
+ config.put(InvokerLocator.FORCE_REMOTE, "true");
+ addExtraClientConfig(config);
+ Client client = new Client(locator, config);
+ client.connect();
+ log.info("client is connected to: " + locator);
+ return client;
+ }
+
+
+ static class TestInvocationHandler implements ServerInvocationHandler
+ {
+ public void addListener(InvokerCallbackHandler callbackHandler) {}
+ public Object invoke(final InvocationRequest invocation) throws Throwable
+ {
+ return invocation.getParameter();
+ }
+ public void removeListener(InvokerCallbackHandler callbackHandler) {}
+ public void setMBeanServer(MBeanServer server) {}
+ public void setInvoker(ServerInvoker invoker) {}
+ }
+}
\ No newline at end of file
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/HttpConfigurableVersionTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/HttpConfigurableVersionTestCase.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/HttpConfigurableVersionTestCase.java 2008-03-06 08:17:45 UTC (rev 3574)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.remoting.version;
+
+
+/**
+ * Unit test for JBREM-764.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright Mar 6, 2008
+ * </p>
+ */
+public class HttpConfigurableVersionTestCase extends ConfigurableVersionTestParent
+{
+ protected String getTransport()
+ {
+ return "http";
+ }
+}
+
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/RMIConfigurableVersionTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/RMIConfigurableVersionTestCase.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/RMIConfigurableVersionTestCase.java 2008-03-06 08:17:45 UTC (rev 3574)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.remoting.version;
+
+
+/**
+ * Unit test for JBREM-764.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright Mar 6, 2008
+ * </p>
+ */
+public class RMIConfigurableVersionTestCase extends ConfigurableVersionTestParent
+{
+ protected String getTransport()
+ {
+ return "rmi";
+ }
+}
+
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/SocketConfigurableVersionTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/SocketConfigurableVersionTestCase.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/version/SocketConfigurableVersionTestCase.java 2008-03-06 08:17:45 UTC (rev 3574)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.remoting.version;
+
+
+/**
+ * Unit test for JBREM-764.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright Mar 6, 2008
+ * </p>
+ */
+public class SocketConfigurableVersionTestCase extends ConfigurableVersionTestParent
+{
+ protected String getTransport()
+ {
+ return "socket";
+ }
+}
+
16 years, 9 months
JBoss Remoting SVN: r3573 - remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/java.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-06 03:16:06 -0500 (Thu, 06 Mar 2008)
New Revision: 3573
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/java/JavaSerializationManager.java
Log:
JBREM-826: Changed log.error() to log.debug().
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/java/JavaSerializationManager.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/java/JavaSerializationManager.java 2008-03-06 08:14:05 UTC (rev 3572)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/java/JavaSerializationManager.java 2008-03-06 08:16:06 UTC (rev 3573)
@@ -178,7 +178,7 @@
}
catch (IOException e)
{
- log.error("", e);
+ log.debug("", e);
throw e;
}
16 years, 9 months
JBoss Remoting SVN: r3572 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-06 03:14:05 -0500 (Thu, 06 Mar 2008)
New Revision: 3572
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ServerThread.java
Log:
JBREM-764: Replaced calls to Version.getDefaultVersion() with calls to AbstractInvoker.getVersion().
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ServerThread.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ServerThread.java 2008-03-06 08:13:25 UTC (rev 3571)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ServerThread.java 2008-03-06 08:14:05 UTC (rev 3572)
@@ -162,7 +162,7 @@
{
shouldCheckConnection = Boolean.valueOf(checkValue).booleanValue();
}
- else if (Version.getDefaultVersion() == Version.VERSION_1)
+ else if (invoker.getVersion() == Version.VERSION_1)
{
shouldCheckConnection = true;
}
@@ -601,9 +601,8 @@
// Ok, now read invocation and invoke
- //TODO: -TME This needs to be done by ServerInvoker
- int version = Version.getDefaultVersion();
- boolean performVersioning = Version.performVersioning();
+ int version = invoker.getVersion();
+ boolean performVersioning = Version.performVersioning(version);
InputStream inputStream = socketWrapper.getInputStream();
if (performVersioning)
16 years, 9 months
JBoss Remoting SVN: r3571 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-06 03:13:25 -0500 (Thu, 06 Mar 2008)
New Revision: 3571
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java
Log:
JBREM-764: Replaced calls to Version.getDefaultVersion() with calls to AbstractInvoker.getVersion().
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java 2008-03-06 08:12:47 UTC (rev 3570)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java 2008-03-06 08:13:25 UTC (rev 3571)
@@ -561,7 +561,7 @@
shouldCheckConnection = Boolean.valueOf(value).booleanValue();
log.debug(this + " setting shouldCheckConnection to " + shouldCheckConnection);
}
- else if (Version.getDefaultVersion() == Version.VERSION_1)
+ else if (getVersion() == Version.VERSION_1)
{
shouldCheckConnection = true;
log.debug(this + " setting shouldCheckConnection to " + shouldCheckConnection);
@@ -752,8 +752,8 @@
try
{
- int version = Version.getDefaultVersion();
- boolean performVersioning = Version.performVersioning();
+ int version = getVersion();
+ boolean performVersioning = Version.performVersioning(version);
OutputStream outputStream = socketWrapper.getOutputStream();
16 years, 9 months
JBoss Remoting SVN: r3570 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-06 03:12:47 -0500 (Thu, 06 Mar 2008)
New Revision: 3570
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet/ServletServerInvoker.java
Log:
JBREM-764: Replaced call to Version.getDefaultVersion() with call to AbstractInvoker.getVersion().
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet/ServletServerInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet/ServletServerInvoker.java 2008-03-06 08:12:28 UTC (rev 3569)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet/ServletServerInvoker.java 2008-03-06 08:12:47 UTC (rev 3570)
@@ -121,7 +121,7 @@
UnMarshaller unmarshaller = MarshalFactory.getUnMarshaller(HTTPUnMarshaller.DATATYPE, getSerializationType());
Object obj = null;
if (unmarshaller instanceof VersionedUnMarshaller)
- obj = ((VersionedUnMarshaller)unmarshaller).read(inputStream, metadata, Version.getDefaultVersion());
+ obj = ((VersionedUnMarshaller)unmarshaller).read(inputStream, metadata, getVersion());
else
obj = unmarshaller.read(inputStream, metadata);
inputStream.close();
@@ -176,7 +176,7 @@
ServletOutputStream outputStream = response.getOutputStream();
Marshaller marshaller = MarshalFactory.getMarshaller(HTTPMarshaller.DATATYPE, getSerializationType());
if (marshaller instanceof VersionedMarshaller)
- ((VersionedMarshaller) marshaller).write(invocationResponse, outputStream, Version.getDefaultVersion());
+ ((VersionedMarshaller) marshaller).write(invocationResponse, outputStream, getVersion());
else
marshaller.write(invocationResponse, outputStream);
outputStream.close();
@@ -252,7 +252,7 @@
UnMarshaller unmarshaller = getUnMarshaller();
Object obj = null;
if (unmarshaller instanceof VersionedUnMarshaller)
- obj = ((VersionedUnMarshaller)unmarshaller).read(new ByteArrayInputStream(requestByte), metadata, Version.getDefaultVersion());
+ obj = ((VersionedUnMarshaller)unmarshaller).read(new ByteArrayInputStream(requestByte), metadata, getVersion());
else
obj = unmarshaller.read(new ByteArrayInputStream(requestByte), metadata);
inputStream.close();
@@ -383,7 +383,7 @@
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Marshaller marshaller = getMarshaller();
if (marshaller instanceof VersionedMarshaller)
- ((VersionedMarshaller) marshaller).write(responseObject, outputStream, Version.getDefaultVersion());
+ ((VersionedMarshaller) marshaller).write(responseObject, outputStream, getVersion());
else
marshaller.write(responseObject, outputStream);
retval = outputStream.toByteArray();
16 years, 9 months
JBoss Remoting SVN: r3569 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-06 03:12:28 -0500 (Thu, 06 Mar 2008)
New Revision: 3569
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIClientInvoker.java
Log:
JBREM-764: Replaced call to Version.getDefaultVersion() with call to AbstractInvoker.getVersion().
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIClientInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIClientInvoker.java 2008-03-06 08:11:46 UTC (rev 3568)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIClientInvoker.java 2008-03-06 08:12:28 UTC (rev 3569)
@@ -300,7 +300,7 @@
{
ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
if (marshaller instanceof VersionedMarshaller)
- ((VersionedMarshaller) marshaller).write(payload, byteOut, Version.getDefaultVersion());
+ ((VersionedMarshaller) marshaller).write(payload, byteOut, getVersion());
else
marshaller.write(payload, byteOut);
ByteArrayInputStream byteIn = new ByteArrayInputStream(byteOut.toByteArray());
16 years, 9 months
JBoss Remoting SVN: r3568 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-06 03:11:46 -0500 (Thu, 06 Mar 2008)
New Revision: 3568
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java
Log:
JBREM-764: Added performVersion(int version) and isValidVersion(int version).
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java 2008-03-06 08:09:16 UTC (rev 3567)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java 2008-03-06 08:11:46 UTC (rev 3568)
@@ -100,4 +100,14 @@
{
return performVersioning;
}
+
+ public static boolean performVersioning(int version)
+ {
+ return version >= 2;
+ }
+
+ public static boolean isValidVersion(int version)
+ {
+ return version == VERSION_1 || version == VERSION_2 || version == VERSION_2_2;
+ }
}
\ No newline at end of file
16 years, 9 months
JBoss Remoting SVN: r3567 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-06 03:09:16 -0500 (Thu, 06 Mar 2008)
New Revision: 3567
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/Remoting.java
Log:
JBREM-764: Added REMOTING_VERSION.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/Remoting.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/Remoting.java 2008-03-06 08:08:52 UTC (rev 3566)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/Remoting.java 2008-03-06 08:09:16 UTC (rev 3567)
@@ -63,4 +63,9 @@
* request payload.
*/
public static final String CLIENT_ADDRESS = "clientAddress";
+
+ /**
+ * Key for configuring Remoting wire version.
+ */
+ public static final String REMOTING_VERSION = "remotingVersion";
}
16 years, 9 months
JBoss Remoting SVN: r3566 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-06 03:08:52 -0500 (Thu, 06 Mar 2008)
New Revision: 3566
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/AbstractInvoker.java
Log:
JBREM-764: Added wire version parameter.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/AbstractInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/AbstractInvoker.java 2008-03-06 08:07:56 UTC (rev 3565)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/AbstractInvoker.java 2008-03-06 08:08:52 UTC (rev 3566)
@@ -65,6 +65,7 @@
protected String serializationType;
protected Map configuration = new HashMap();
protected SocketFactory socketFactory;
+ protected int version;
// Indicates if the serverSocketFactory was generated internally.
protected boolean socketFactoryCreatedFromSSLParameters;
@@ -120,6 +121,35 @@
{
this.setSerializationType(locator.findSerializationType());
}
+
+ setVersion(Version.getDefaultVersion());
+ Object o = this.configuration.get(Remoting.REMOTING_VERSION);
+ if (o instanceof String)
+ {
+ try
+ {
+ int v = Integer.valueOf((String)o).intValue();
+ if (Version.isValidVersion(v))
+ {
+ log.debug(this + " setting version to " + v);
+ setVersion(v);
+ }
+ else
+ {
+ log.debug(this + " invalid version: " + v + ". Using " + getVersion());
+ }
+ }
+ catch (Exception e)
+ {
+ log.warn(this + " could not convert " + Remoting.REMOTING_VERSION +
+ " value of " + o + " to an int value. Using " + getVersion());
+ }
+ }
+ else if (o != null)
+ {
+ log.warn(this + " value of " + Remoting.REMOTING_VERSION +
+ " must be a String: " + o + ". Using " + getVersion());
+ }
}
/**
@@ -282,6 +312,16 @@
return socketFactoryCreatedFromSSLParameters;
}
+ public int getVersion()
+ {
+ return version;
+ }
+
+ public void setVersion(int version)
+ {
+ this.version = version;
+ }
+
/**
* If any configuration parameters relate to the construction of a SSLSocketBuilder, create one.
*/
16 years, 9 months