From jboss-remoting-commits at lists.jboss.org Thu Jul 31 20:15:50 2008 Content-Type: multipart/mixed; boundary="===============2713474965496609735==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4445 - remoting2/branches/2.x/docs/guide/en. Date: Thu, 31 Jul 2008 20:15:50 -0400 Message-ID: --===============2713474965496609735== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-07-31 20:15:50 -0400 (Thu, 31 Jul 2008) New Revision: 4445 Modified: remoting2/branches/2.x/docs/guide/en/chap5.xml Log: JBREM-1015: Described new Remoting.SOCKET_FACTORY_CLASS_NAME parameter; als= o, some other uncommitted changes. Modified: remoting2/branches/2.x/docs/guide/en/chap5.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/docs/guide/en/chap5.xml 2008-07-31 23:32:40 UTC = (rev 4444) +++ remoting2/branches/2.x/docs/guide/en/chap5.xml 2008-08-01 00:15:50 UTC = (rev 4445) @@ -920,25 +920,40 @@ A number of transport independent features are introduced in Re= moting version 2.4. = -
- Multihome servers +
+ Binding to 0.0.0.0 = - Before version 2.4, a Remoting server could bind either to a= specific IP address, e.g., = - + Before version 2.4, a Remoting server could bind to only one + specific IP address. In particular, the address 0.0.0.0 was transl= ated + to the host returned by java.net.InetAddress.getLocalHost()<= /code> + (or its equivalent IP address). As of version 2.4 [and later relea= ses in + the 2.2 series], a server started with the address 0.0.0.0 binds to + all available interfaces. = - socket://192.168.0.2:6500 + Note. If 0.0.0.0 appears = in the + InvokerLocator, it needs to be translated t= o an + address that is usable on the client side. If the system property + InvokerLocator.BIND_BY_HOST (actual value + "remoting.bind_by_host") is set to "true", the + InvokerLocator host will be transformed to = the + value returned by + InetAddress.getLocalHost().getHostName(). + Otherwise, it will be transformed to the value returned by + InetAddress.getLocalHost().getHostAddress(). = - or to all IP addresses on a given host,= e.g., +
+ = +
+ Multihome servers = - socket://0.0.0.0:6500 + As of release 2.4, besides binding to all + available interfaces, it is also possible to configure a server to + bind to a subset of the interfaces available on a given host. Supp= ose, + for example, that a host machine has NICs configured with addresses + 10.32.4.2, 192.168.4.2, and 192.168.8.2, and suppose that 192.168.= 8.2 is + on a LAN from which access is meant to be denied. It is now possib= le to + create a single server that binds to 10.32.4.2 and 192.168.4.2. = - As of release 2.4, it is possible to a configure a server to= bind to a - subset of the interfaces available on a given host. Suppose, for e= xample, - that a host machine has NICs configured with addresses 10.32.4.2, - 192.168.4.2, and 192.168.8.2, and suppose that 192.168.8.2 is on a= LAN from - which access is meant to be denied. It is now possible to create a= single - server that binds to 10.32.4.2 and 192.168.4.2. - = It would be convenient to be able to create an In= vokerLocator that looks something like: = @@ -1103,9 +1118,8 @@ }
= - =
- Support for IPv6 IP addresses + Support for IPv6 addresses = org.jboss.remoting.InvokerLocator wi= ll now accept IPv6 IP addresses. For example, @@ -1225,12 +1239,11 @@
=
- How the server bind address and port is ultimately - determined + How the server bind address and port is determined = If the serverBindAddress property is set, the server invoker w= ill - bind to that address. Otherwise, it will, with two exceptions, use = the - address in the InvokerLocator (if there is one). The first exceptio= n is the + bind to that address. Otherwise, it will, with one exception, use t= he + address in the InvokerLocator (if there is one). The exception is t= he case in which the clientConnectAddress property is set, which indica= tes that the adddess in the InvokerLocator is not the real address of the server's host. In that case, and in the case that there is no addre= ss @@ -1246,8 +1259,8 @@ use host from InvokerLocator else use local host address - - There is one other exception. If the InvokerLocator address is + = = + = If the serverBindPort property is set, it will be used. If this value is 0 or a negative number, then the next available port will be @@ -1511,8 +1526,9 @@ continueAfterTimeout - in= dicates what a server thread should do after experiencing a java.net.SocketTimeoutException. If set to - "true", the server thread will continue to wait for an invocation; - otherwise, it will return itself to the thread pool. + "true", or if JBossSerialization is being used, the server thread = will + continue to wait for an invocation; otherwise, it will return itse= lf to + the thread pool. = Configurations affecting the Socket invoker client @@ -2295,6 +2311,13 @@ sockets. The default value is 10. = + MAX_CONTROL_CONNECTION_RESTARTS + (actual value is "maxControlConnectionRestarts"): The client sid= e uses + this value to limit the number of times it will request a new co= ntrol + connection after a ping timeout. The default value is 10. + + = + SECONDARY_BIND_PORT (actual v= alue is "secondaryBindPort"): The server side uses this parameter to det= ermine the bind port for the secondary @@ -3971,7 +3994,7 @@ Put the class name of a SocketFactory in a configuration map, using key - Remoting.SOCKET_FACTORY_NAME, and pass the + Remoting.SOCKET_FACTORY_CLASS_NAME, and p= ass the map to one of the Connector constructor= s. The SocketFactory class must have a def= ault constructor. @@ -4170,7 +4193,7 @@ Put the class name of a SocketFactory in a configuration map, using key - Remoting.SOCKET_FACTORY_NAME, and pass the + Remoting.SOCKET_FACTORY_CLASS_NAME, and p= ass the map to one of the Client constructors. = The SocketFactory class must have a default constructor, which will be used to create a @@ -5211,8 +5234,8 @@ = - Each transport that supports per invocation timeouts handles them a - little differently. More details are given below. + Each transport handles per invocation timeouts a little differentl= y. + More details are given below.
= @@ -5854,8 +5877,8 @@ Client to indicate the socket factory to be used. Value must be instan= ce of javax.net.SocketFactory. = - SOCKET_FACTORY_NAME (actual v= alue - is 'socketFactory') - key for the configuration map passed to a Client= to + SOCKET_FACTORY_CLASS_NAME (ac= tual value + is 'socketFactoryClassName') - key for the configuration map passed to= a Client to indicate the classname of the socket factory to be used. Value should = be fully qualified classname of class that is an instance of javax.net.SocketFactory and has a void constructor. This property will= not @@ -6439,16 +6462,19 @@
org.jboss.remoting.transport.socket.ServerThread = - evictabilityTimeout - indic= ates the - number of milliseconds during which a server thread waiting for the = next - invocation will not be preemptible. - = - continueAfterTimeout - indi= cates - what a server thread should do after experiencing a - java.net.SocketTimeoutException. If set to "tr= ue", - the server thread will continue to wait for an invocation; otherwise,= it - will return itself to the thread pool. + EVICTABILITY_TIMEOUT (actua= l value + "evictabilityTimeout") - indicates the number of milliseconds during= which + a server thread waiting for the next invocation will not be + preemptible. = + CONTINUE_AFTER_TIMEOUT (act= ual + value "continueAfterTimeout") - indicates what a server thread shoul= d do + after experiencing a + java.net.SocketTimeoutException. If set to "t= rue", + or if JBossSerialization is being used, the server thread will conti= nue to + wait for an invocation; otherwise, it will return itself to the thre= ad + pool. + =
= = =
--===============2713474965496609735==-- From jboss-remoting-commits at lists.jboss.org Thu Jul 31 20:17:46 2008 Content-Type: multipart/mixed; boundary="===============7853736121180363910==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4446 - remoting2/branches/2.x/docs/guide/en. Date: Thu, 31 Jul 2008 20:17:46 -0400 Message-ID: --===============7853736121180363910== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-07-31 20:17:46 -0400 (Thu, 31 Jul 2008) New Revision: 4446 Modified: remoting2/branches/2.x/docs/guide/en/chap9.xml Log: Syntactic correction. Modified: remoting2/branches/2.x/docs/guide/en/chap9.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/docs/guide/en/chap9.xml 2008-08-01 00:15:50 UTC = (rev 4445) +++ remoting2/branches/2.x/docs/guide/en/chap9.xml 2008-08-01 00:17:46 UTC = (rev 4446) @@ -159,7 +159,7 @@ when done using it. Otherwise, the client will continue to make its pi= ng call on the server to keep its lease current. = - The client can also provide extra metadata the will be communica= ted to + The client can also provide extra metadata that will be communic= ated to the connection listener in case of failure by supplying a metadata Map= to the Client constructor. This map will be included in the Client instan= ce passed to the connection listener (via the handleConnectionException() --===============7853736121180363910==-- From jboss-remoting-commits at lists.jboss.org Thu Jul 31 20:46:05 2008 Content-Type: multipart/mixed; boundary="===============3700576490858077535==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4447 - remoting2/branches/2.x/docs/guide/en. Date: Thu, 31 Jul 2008 20:46:05 -0400 Message-ID: --===============3700576490858077535== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-07-31 20:46:05 -0400 (Thu, 31 Jul 2008) New Revision: 4447 Modified: remoting2/branches/2.x/docs/guide/en/chap9.xml Log: JBREM-1012: Described injection of ConnectionListener. Modified: remoting2/branches/2.x/docs/guide/en/chap9.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/docs/guide/en/chap9.xml 2008-08-01 00:17:46 UTC = (rev 4446) +++ remoting2/branches/2.x/docs/guide/en/chap9.xml 2008-08-01 00:46:05 UTC = (rev 4447) @@ -90,16 +90,15 @@ The second criterion is that an implementation of the org.jboss.remoting.ConnectionListener interface is added = as a - connection listener to the Connector, via the method + connection listener to the Connector, either via the method = public void addConnectionListener(ConnectionListener l= istener) = - Once both criteria are met, the remoting server will turn on cl= ient - leasing. - = - Note that there is no way to register a - ConnectionListener via xml based configuration = for - the Connector. + or though the use of the + ServerInvoker.CONNECTION_LISTENER parameter (actual value + "connectionListener") in the Connector's + configuration map or XML configuration file. Once both criteria are me= t, the + remoting server will turn on client leasing. = The ConnectionListener will be notified of both client failures = and client disconnects via the handleConnectionException() method. If the = client --===============3700576490858077535==-- From jboss-remoting-commits at lists.jboss.org Thu Jul 31 20:46:58 2008 Content-Type: multipart/mixed; boundary="===============6955024377538333813==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4448 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/lease. Date: Thu, 31 Jul 2008 20:46:58 -0400 Message-ID: --===============6955024377538333813== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-07-31 20:46:58 -0400 (Thu, 31 Jul 2008) New Revision: 4448 Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/lease/InjectedC= onnectionListenerTestCase.java Log: JBREM-1012: New unit test. Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/lease/Injec= tedConnectionListenerTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/lease/Injected= ConnectionListenerTestCase.java (rev 0) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/lease/Injected= ConnectionListenerTestCase.java 2008-08-01 00:46:58 UTC (rev 4448) @@ -0,0 +1,223 @@ +package org.jboss.test.remoting.lease; + +import java.io.ByteArrayInputStream; +import java.net.InetAddress; +import java.util.HashMap; +import java.util.Map; + +import javax.management.MBeanServer; +import javax.management.MBeanServerFactory; +import javax.management.ObjectName; +import javax.xml.parsers.DocumentBuilderFactory; + +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.ConnectionListener; +import org.jboss.remoting.InvocationRequest; +import org.jboss.remoting.InvokerLocator; +import org.jboss.remoting.ServerInvocationHandler; +import org.jboss.remoting.ServerInvoker; +import org.jboss.remoting.callback.InvokerCallbackHandler; +import org.jboss.remoting.transport.Connector; +import org.jboss.remoting.transport.PortUtil; +import org.w3c.dom.Document; + + +/** + * = + * Unit test for JBREM-1012. + * = + * @author Ron Sigal + * @version $Revision: 1.1 $ + *

+ * Copyright Jul 18, 2008 + *

+ */ +public class InjectedConnectionListenerTestCase extends TestCase +{ + private static Logger log =3D Logger.getLogger(InjectedConnectionListen= erTestCase.class); + = + private static boolean firstTime =3D true; + = + protected String host; + protected int port; + protected String locatorURI; + protected Connector connector; + protected TestInvocationHandler invocationHandler; + + = + public void setUp() throws Exception + { + if (firstTime) + { + firstTime =3D false; + Logger.getLogger("org.jboss.remoting").setLevel(XLevel.INFO); + Logger.getLogger("org.jboss.test.remoting").setLevel(Level.INFO); + String pattern =3D "[%d{ABSOLUTE}] [%t] %5p (%F:%L) - %m%n"; + PatternLayout layout =3D new PatternLayout(pattern); + ConsoleAppender consoleAppender =3D new ConsoleAppender(layout); + Logger.getRootLogger().addAppender(consoleAppender); = + } + = + TestConnectionListener.gotException =3D false; + } + + = + public void tearDown() + { + } + = + = + public void testInjectionWithClassName() throws Throwable + { + log.info("entering " + getName()); + = + // Start server. + MBeanServer mbeanServer =3D MBeanServerFactory.createMBeanServer(); + setupServer(TestConnectionListener.class.getName(), mbeanServer); + = + // Create client. + InvokerLocator clientLocator =3D new InvokerLocator(locatorURI); + HashMap clientConfig =3D new HashMap(); + clientConfig.put(InvokerLocator.FORCE_REMOTE, "true"); + clientConfig.put(Client.ENABLE_LEASE, "true"); + addExtraClientConfig(clientConfig); + Client client =3D new Client(clientLocator, clientConfig); + client.connect(); + log.info("client is connected"); + = + // Test connections. + assertEquals("abc", client.invoke("abc")); + log.info("connection is good"); + = + // Verify ConnectionListener is notified. + log.info("client disconnecting"); + client.disconnect(); + log.info("client disconnected"); + assertTrue(TestConnectionListener.gotException); + = + shutdownServer(); + log.info(getName() + " PASSES"); + } + = + = + = + public void testInjectionWithMBean() throws Throwable + { + log.info("entering " + getName()); + = + // Start server. + String connectionListenerName =3D "jboss:type=3Dconnectionlistener"; + ObjectName objName =3D new ObjectName(connectionListenerName); + MBeanServer mbeanServer =3D MBeanServerFactory.createMBeanServer(); + TestConnectionListener listener =3D new TestConnectionListener(); + mbeanServer.registerMBean(listener, objName); + setupServer(connectionListenerName, mbeanServer); + = + // Create client. + InvokerLocator clientLocator =3D new InvokerLocator(locatorURI); + HashMap clientConfig =3D new HashMap(); + clientConfig.put(InvokerLocator.FORCE_REMOTE, "true"); + clientConfig.put(Client.ENABLE_LEASE, "true"); + addExtraClientConfig(clientConfig); + Client client =3D new Client(clientLocator, clientConfig); + client.connect(); + log.info("client is connected"); + = + // Test connections. + assertEquals("abc", client.invoke("abc")); + log.info("connection is good"); + = + // Verify ConnectionListener is notified. + log.info("client disconnecting"); + client.disconnect(); + log.info("client disconnected"); + assertTrue(TestConnectionListener.gotException); + = + shutdownServer(); + log.info(getName() + " PASSES"); + } + = + = + protected String getTransport() + { + return "socket"; + } + = + = + protected void addExtraClientConfig(Map config) {} + protected void addExtraServerConfig(Map config) {} + = + + protected void setupServer(String listener, MBeanServer mbeanServer) th= rows Exception + { + HashMap config =3D new HashMap(); + config.put(InvokerLocator.FORCE_REMOTE, "true"); + addExtraServerConfig(config); + Connector connector =3D new Connector(config); + mbeanServer.registerMBean(connector, new ObjectName("test:type=3Dcon= nector")); + = + host =3D InetAddress.getLocalHost().getHostAddress(); + port =3D PortUtil.findFreePort(host); + StringBuffer buf =3D new StringBuffer(); + buf.append("\n"); + buf.append(""); + buf.append(" "); + buf.append(" " + host += ""); + buf.append(" " + port + "<= /attribute>"); + buf.append(" " + listener + ""); + buf.append(" 5000"); + buf.append(" "); + buf.append(""); + ByteArrayInputStream bais =3D new ByteArrayInputStream(buf.toString(= ).getBytes()); + Document xml =3D DocumentBuilderFactory.newInstance().newDocumentBui= lder().parse(bais); + connector.setConfiguration(xml.getDocumentElement()); + connector.create(); + connector.addInvocationHandler("test", new TestInvocationHandler()); + connector.start(); + locatorURI =3D connector.getInvokerLocator(); + log.info("Started remoting server with locator uri of: " + locatorUR= I); + } + = + = + protected void shutdownServer() throws Exception + { + if (connector !=3D null) + connector.stop(); + } + = + = + static class TestInvocationHandler implements ServerInvocationHandler + { + public void addListener(InvokerCallbackHandler callbackHandler) {} + public Object invoke(final InvocationRequest invocation) throws Thro= wable + { + return invocation.getParameter(); + } + public void removeListener(InvokerCallbackHandler callbackHandler) {} + public void setMBeanServer(MBeanServer server) {} + public void setInvoker(ServerInvoker invoker) {} + } + = + = + public interface TestConnectionListenerMBean extends ConnectionListener + { = + } + = + public static class TestConnectionListener implements TestConnectionLis= tenerMBean + { + public static boolean gotException; + = + public void handleConnectionException(Throwable throwable, Client cl= ient) + { + gotException =3D true; + log.info("TestConnectionListener got exception"); + } + } +} \ No newline at end of file --===============6955024377538333813==-- From jboss-remoting-commits at lists.jboss.org Thu Jul 31 20:48:01 2008 Content-Type: multipart/mixed; boundary="===============0391185892559442625==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4449 - remoting2/branches/2.x/src/main/org/jboss/remoting. Date: Thu, 31 Jul 2008 20:48:01 -0400 Message-ID: --===============0391185892559442625== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-07-31 20:48:00 -0400 (Thu, 31 Jul 2008) New Revision: 4449 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java Log: JBREM-1012: Enable injection of ConnectionListener. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.= java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java 2= 008-08-01 00:46:58 UTC (rev 4448) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java 2= 008-08-01 00:48:00 UTC (rev 4449) @@ -218,6 +218,8 @@ public static final String ECHO =3D "$ECHO$"; = public static final String INVOKER_SESSION_ID =3D "invokerSessionId"; + = + public static final String CONNECTION_LISTENER =3D "connectionListener"; = = // Static -------------------------------------------------------------= -------------------------- @@ -349,7 +351,64 @@ throw new IllegalArgumentException("Can not add null ConnectionLi= stener."); } } + = + public void setConnectionListener(Object listener) + { + if (listener =3D=3D null) + { + log.error("ConnectionListener is null"); + return; + } + = + if (listener instanceof ConnectionListener) + { + addConnectionListener((ConnectionListener) listener); + return; + } = + if (!(listener instanceof String)) + { + log.error("Object supplied as ConnectionListener is neither Strin= g nor ConnectionListener"); + return; + } + + ConnectionListener connectionListener =3D null; + try + { + MBeanServer server =3D getMBeanServer(); + ObjectName objName =3D new ObjectName((String) listener); + Class c =3D ConnectionListener.class; + Object o =3D MBeanServerInvocationHandler.newProxyInstance(server= , objName, c, false); + connectionListener =3D (ConnectionListener) o; + } + catch (MalformedObjectNameException e) + { + log.debug("Object supplied as ConnectionListener is not an object= name."); + } + + if (connectionListener =3D=3D null) + { + try + { + Class listenerClass =3D ClassLoaderUtility.loadClass((String) = listener, ServerInvoker.class); + connectionListener =3D (ConnectionListener) listenerClass.newI= nstance(); + } + catch (Exception e) + { + log.error("Unable to instantiate " + listener + ": " + e.getMe= ssage()); + return; + } + } + + if (connectionListener =3D=3D null) + { + log.error("Unable to create ConnectionListener from " + listener); + return; + } + = + addConnectionListener(connectionListener); + } + public void removeConnectionListener(ConnectionListener listener) { if(connectionNotifier !=3D null) @@ -1086,6 +1145,13 @@ } } = + // Inject ConnectionListener + String connectionListener =3D (String)config.get(CONNECTION_LISTENER= ); + if (connectionListener !=3D null) + { + setConnectionListener(connectionListener); + } + = String registerCallbackListenersString =3D (String)config.get(REGIST= ER_CALLBACK_LISTENER); if(registerCallbackListenersString !=3D null) { --===============0391185892559442625==-- From jboss-remoting-commits at lists.jboss.org Thu Jul 31 21:41:51 2008 Content-Type: multipart/mixed; boundary="===============4720651012729223052==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4450 - remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util. Date: Thu, 31 Jul 2008 21:41:51 -0400 Message-ID: --===============4720651012729223052== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: david.lloyd(a)jboss.com Date: 2008-07-31 21:41:51 -0400 (Thu, 31 Jul 2008) New Revision: 4450 Modified: remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/ServiceURI= .java Log: New and improved Remoting service URI utility methods Modified: remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/Ser= viceURI.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/ServiceUR= I.java 2008-08-01 00:48:00 UTC (rev 4449) +++ remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/ServiceUR= I.java 2008-08-01 01:41:51 UTC (rev 4450) @@ -2,8 +2,6 @@ = import java.net.URI; import java.net.URISyntaxException; -import java.util.regex.Matcher; -import java.util.regex.Pattern; = /** * A parser for JBoss Remoting URI types. @@ -11,77 +9,123 @@ public final class ServiceURI { public static final String SCHEME =3D "jrs"; = - private static final String FIRST_CHAR =3D "[$_a-zA-Z]"; - private static final String SUBSEQUENT_CHAR =3D "[-+$_a-zA-Z0-9]*"; - private static final String ID =3D FIRST_CHAR + SUBSEQUENT_CHAR; - private static final String SEPARATOR =3D "[./]"; + private ServiceURI() { + } = - private static final Pattern VALID_PATTERN =3D Pattern.compile("^(?:" = + ID + "(?:" + SEPARATOR + ID + ")*)*$"); - - private final URI uri; - private final String serviceType; - private final String groupName; - private final String endpointName; - - public ServiceURI(final String str) throws URISyntaxException { - this(new URI(str)); + /** + * Determine if this URI is for a Remoting service. + * + * @param uri the URI + * @return {@code true} if the given URI is a Remoting service URI + */ + public static boolean isRemotingServiceUri(final URI uri) { + return SCHEME.equals(uri.getScheme()); } = - public ServiceURI(final URI uri) { - this.uri =3D uri; - if (! uri.getScheme().equals(SCHEME)) { - throw new IllegalArgumentException("Invalid URI scheme for ser= vice"); + /** + * Get the service type from a Remoting service URI. + * + * @param uri the URI + * @return the service type + * @throws IllegalArgumentException if the given URI is not for a remo= ting service + */ + public static String getServiceType(final URI uri) throws IllegalArgum= entException { + if (! isRemotingServiceUri(uri)) { + throw new IllegalArgumentException("Not a remoting service URI= "); } final String ssp =3D uri.getSchemeSpecificPart(); - final int stcp =3D ssp.indexOf(':'); - if (stcp =3D=3D -1) { + final int firstColon =3D ssp.indexOf(':'); + final String serviceType; + if (firstColon =3D=3D -1) { serviceType =3D ssp; - groupName =3D ""; - endpointName =3D ""; } else { - serviceType =3D ssp.substring(0, stcp).trim(); - final int gncp =3D ssp.indexOf(':', stcp + 1); - if (gncp =3D=3D -1) { - groupName =3D ssp.substring(stcp + 1).trim(); - endpointName =3D ""; - } else { - groupName =3D ssp.substring(stcp + 1, gncp).trim(); - // ignore everything after the last : - final int encp =3D ssp.indexOf(':', gncp + 1); - if (encp =3D=3D -1) { - endpointName =3D ssp.substring(gncp + 1).trim(); - } else { - endpointName =3D ssp.substring(gncp + 1, encp).trim(); - } - } + serviceType =3D ssp.substring(0, firstColon); } - final Matcher matcher =3D VALID_PATTERN.matcher(serviceType); - if (! matcher.matches()) { - throw new IllegalArgumentException("Syntax error in service ty= pe URI part"); + return serviceType; + } + + /** + * Get the group name from a Remoting service URI. + * + * @param uri the URI + * @return the group name + * @throws IllegalArgumentException if the given URI is not for a remo= ting service + */ + public static String getGroupName(final URI uri) throws IllegalArgumen= tException { + if (! isRemotingServiceUri(uri)) { + throw new IllegalArgumentException("Not a remoting service URI= "); } - matcher.reset(groupName); - if (! matcher.matches()) { - throw new IllegalArgumentException("Syntax error in group name= URI part"); + final String ssp =3D uri.getSchemeSpecificPart(); + final int firstColon =3D ssp.indexOf(':'); + final String groupName; + if (firstColon =3D=3D -1) { + return ""; } - matcher.reset(endpointName); - if (! matcher.matches()) { - throw new IllegalArgumentException("Syntax error in endpoint n= ame URI part"); + final int secondColon =3D ssp.indexOf(':', firstColon + 1); + if (secondColon =3D=3D -1) { + groupName =3D ssp.substring(firstColon + 1); + } else { + groupName =3D ssp.substring(firstColon + 1, secondColon); } + return groupName; } = - public URI getUri() { - return uri; + /** + * Get the endpoint name from a Remoting service URI. + * + * @param uri the URI + * @return the endpoint name + * @throws IllegalArgumentException if the given URI is not for a remo= ting service + */ + public static String getEndpointName(final URI uri) throws IllegalArgu= mentException { + if (! isRemotingServiceUri(uri)) { + throw new IllegalArgumentException("Not a remoting service URI= "); + } + final String ssp =3D uri.getSchemeSpecificPart(); + final int firstColon =3D ssp.indexOf(':'); + final String endpointName; + if (firstColon =3D=3D -1) { + return ""; + } + final int secondColon =3D ssp.indexOf(':', firstColon + 1); + if (secondColon =3D=3D -1) { + return ""; + } + // ::: is not officially supported, but this leaves room for exten= sions + final int thirdColon =3D ssp.indexOf(':', secondColon + 1); + if (thirdColon =3D=3D -1) { + endpointName =3D ssp.substring(secondColon + 1); + } else { + endpointName =3D ssp.substring(secondColon + 1, thirdColon); + } + return endpointName; } = - public String getServiceType() { - return serviceType; + /** + * Create a Remoting service URI. + * + * @param serviceType the service type, if any + * @param groupName the group name, if any + * @param endpointName the endpoint name, if any + * @return the URI + */ + public static URI create(String serviceType, String groupName, String = endpointName) { + try { + StringBuilder builder =3D new StringBuilder(serviceType.length= () + groupName.length() + endpointName.length() + 2); + if (serviceType !=3D null && serviceType.length() > 0) { + builder.append(serviceType); + } + if (groupName !=3D null && groupName.length() > 0) { + builder.append(':').append(groupName); + if (endpointName !=3D null && endpointName.length() > 0) { + builder.append(':').append(groupName); + } + } else if (endpointName !=3D null && endpointName.length() > 0= ) { + builder.append(':').append(':').append(groupName); + } + return new URI(SCHEME, builder.toString(), null); + } catch (URISyntaxException e) { + throw new IllegalStateException("URI syntax exception should n= ot be possible here", e); + } } - - public String getGroupName() { - return groupName; - } - - public String getEndpointName() { - return endpointName; - } } --===============4720651012729223052==-- From jboss-remoting-commits at lists.jboss.org Thu Jul 31 21:48:05 2008 Content-Type: multipart/mixed; boundary="===============8953151696398955927==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4451 - remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util. Date: Thu, 31 Jul 2008 21:48:05 -0400 Message-ID: --===============8953151696398955927== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: david.lloyd(a)jboss.com Date: 2008-07-31 21:48:05 -0400 (Thu, 31 Jul 2008) New Revision: 4451 Modified: remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/ServiceURI= .java Log: New and improved Remoting service URI utility methods - fixed Modified: remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/Ser= viceURI.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/ServiceUR= I.java 2008-08-01 01:41:51 UTC (rev 4450) +++ remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/ServiceUR= I.java 2008-08-01 01:48:05 UTC (rev 4451) @@ -115,14 +115,14 @@ if (serviceType !=3D null && serviceType.length() > 0) { builder.append(serviceType); } + builder.append(':'); if (groupName !=3D null && groupName.length() > 0) { - builder.append(':').append(groupName); - if (endpointName !=3D null && endpointName.length() > 0) { - builder.append(':').append(groupName); - } - } else if (endpointName !=3D null && endpointName.length() > 0= ) { - builder.append(':').append(':').append(groupName); + builder.append(groupName); } + builder.append(':'); + if (endpointName !=3D null && endpointName.length() > 0) { + builder.append(endpointName); + } return new URI(SCHEME, builder.toString(), null); } catch (URISyntaxException e) { throw new IllegalStateException("URI syntax exception should n= ot be possible here", e); --===============8953151696398955927==-- From jboss-remoting-commits at lists.jboss.org Thu Jul 31 21:49:45 2008 Content-Type: multipart/mixed; boundary="===============4952055453958751256==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4452 - remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util. Date: Thu, 31 Jul 2008 21:49:45 -0400 Message-ID: --===============4952055453958751256== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: david.lloyd(a)jboss.com Date: 2008-07-31 21:49:45 -0400 (Thu, 31 Jul 2008) New Revision: 4452 Modified: remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/ServiceURI= .java Log: Slightly stricter checking Modified: remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/Ser= viceURI.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/ServiceUR= I.java 2008-08-01 01:48:05 UTC (rev 4451) +++ remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/ServiceUR= I.java 2008-08-01 01:49:45 UTC (rev 4452) @@ -13,13 +13,13 @@ } = /** - * Determine if this URI is for a Remoting service. + * Determine if this URI is a valid Remoting service URI. * * @param uri the URI - * @return {@code true} if the given URI is a Remoting service URI + * @return {@code true} if the given URI is a valid Remoting service U= RI */ public static boolean isRemotingServiceUri(final URI uri) { - return SCHEME.equals(uri.getScheme()); + return SCHEME.equals(uri.getScheme()) && uri.isOpaque(); } = /** @@ -31,7 +31,7 @@ */ public static String getServiceType(final URI uri) throws IllegalArgum= entException { if (! isRemotingServiceUri(uri)) { - throw new IllegalArgumentException("Not a remoting service URI= "); + throw new IllegalArgumentException("Not a valid remoting servi= ce URI"); } final String ssp =3D uri.getSchemeSpecificPart(); final int firstColon =3D ssp.indexOf(':'); @@ -53,7 +53,7 @@ */ public static String getGroupName(final URI uri) throws IllegalArgumen= tException { if (! isRemotingServiceUri(uri)) { - throw new IllegalArgumentException("Not a remoting service URI= "); + throw new IllegalArgumentException("Not a valid remoting servi= ce URI"); } final String ssp =3D uri.getSchemeSpecificPart(); final int firstColon =3D ssp.indexOf(':'); @@ -79,7 +79,7 @@ */ public static String getEndpointName(final URI uri) throws IllegalArgu= mentException { if (! isRemotingServiceUri(uri)) { - throw new IllegalArgumentException("Not a remoting service URI= "); + throw new IllegalArgumentException("Not a valid remoting servi= ce URI"); } final String ssp =3D uri.getSchemeSpecificPart(); final int firstColon =3D ssp.indexOf(':'); --===============4952055453958751256==-- From jboss-remoting-commits at lists.jboss.org Thu Jul 31 23:07:52 2008 Content-Type: multipart/mixed; boundary="===============8911693385594492768==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4453 - remoting2/branches/2.x/src/main/org/jboss/remoting. Date: Thu, 31 Jul 2008 23:07:52 -0400 Message-ID: --===============8911693385594492768== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-07-31 23:07:52 -0400 (Thu, 31 Jul 2008) New Revision: 4453 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvo= ker.java Log: JBREM-1019: Syntax change to conform to jdk 1.4. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteCli= entInvoker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInv= oker.java 2008-08-01 01:49:45 UTC (rev 4452) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInv= oker.java 2008-08-01 03:07:52 UTC (rev 4453) @@ -128,7 +128,7 @@ if (flag !=3D null) { String sflag =3D flag.toString(); - parentFirst =3D Boolean.valueOf(sflag); + parentFirst =3D Boolean.valueOf(sflag).booleanValue(); } if (unmarshaller instanceof UpdateableClassloaderUnMarshaller) { --===============8911693385594492768==-- From jboss-remoting-commits at lists.jboss.org Fri Aug 1 01:50:13 2008 Content-Type: multipart/mixed; boundary="===============6202407085603883248==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4454 - remoting2/branches/2.x/src/main/org/jboss/remoting/loading. Date: Fri, 01 Aug 2008 01:50:13 -0400 Message-ID: --===============6202407085603883248== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-01 01:50:12 -0400 (Fri, 01 Aug 2008) New Revision: 4454 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/loading/ClassByteClas= sLoader.java Log: JBREM-1000: Added two log.debug() calls. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/loading/ClassB= yteClassLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/loading/ClassByteCla= ssLoader.java 2008-08-01 03:07:52 UTC (rev 4453) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/loading/ClassByteCla= ssLoader.java 2008-08-01 05:50:12 UTC (rev 4454) @@ -389,7 +389,9 @@ { loaderClient.connect(); } + log.debug("attempting to load from network: " + className); Object obj =3D loaderClient.invoke(marshallerMethodName, metad= ata); + log.debug("loaded from network: " + obj); = if(obj !=3D null) { --===============6202407085603883248==-- From jboss-remoting-commits at lists.jboss.org Fri Aug 1 01:52:08 2008 Content-Type: multipart/mixed; boundary="===============8254292419756903588==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4455 - remoting2/branches/2.x/src/main/org/jboss/remoting/marshal. Date: Fri, 01 Aug 2008 01:52:08 -0400 Message-ID: --===============8254292419756903588== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-01 01:52:08 -0400 (Fri, 01 Aug 2008) New Revision: 4455 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshallerLoa= derHandler.java Log: JBREM-1000: Can look in HeirarchicalLoaderRepository3s for scoped classes. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/Marsha= llerLoaderHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshallerLo= aderHandler.java 2008-08-01 05:50:12 UTC (rev 4454) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshallerLo= aderHandler.java 2008-08-01 05:52:08 UTC (rev 4455) @@ -22,9 +22,19 @@ = package org.jboss.remoting.marshal; = +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.Iterator; +import java.util.List; import java.util.Map; import javax.management.MBeanServer; +import javax.management.ObjectName; + import org.jboss.logging.Logger; +import org.jboss.mx.loading.LoaderRepository; +import org.jboss.mx.loading.RepositoryClassLoader; import org.jboss.remoting.InvocationRequest; import org.jboss.remoting.InvokerLocator; import org.jboss.remoting.ServerInvocationHandler; @@ -43,10 +53,15 @@ { private ServerInvoker invoker =3D null; private MBeanServer server =3D null; + private List repositories; = protected final static Logger log =3D Logger.getLogger(MarshallerLoader= Handler.class); = - + public MarshallerLoaderHandler(List repositories) + { + this.repositories =3D repositories; + } + = /** * set the mbean server that the handler can reference * @@ -102,9 +117,11 @@ else if(LOAD_CLASS_METHOD.equals(param)) { String className =3D (String) metadMap.get(CLASSNAME); + log.debug("MarshallerLoaderHandler: loading class: " + className); if(className !=3D null) { ret =3D loadClassBytes(className, invoker.getClassLoader()); + log.debug("MarshallerLoaderHandler: returning class: " + class= Name + ": " + ret); } else { @@ -155,6 +172,39 @@ if(className !=3D null) { byte[] classDefinition =3D ClassUtil.getClassBytes(className, cla= ssLoader); + = + if (classDefinition =3D=3D null && repositories !=3D null) + { + Iterator it =3D repositories.iterator(); + while (it.hasNext()) + { + ObjectName name =3D (ObjectName) it.next(); + log.debug("searching repository " + name); + = + try + { + Object o =3D server.getAttribute(name, "Instance"); + LoaderRepository repository =3D (LoaderRepository) o; + Class c =3D repository.getCachedClass(className); + if (c =3D=3D null) + { + continue; + } + log.debug("found class in repository " + name); + RepositoryClassLoader cl =3D (RepositoryClassLoader) c.g= etClassLoader(); + classDefinition =3D loadByteCode(cl, className); + } + catch (Exception e) + { + log.debug("unable to get class from " + name + ": " + e.= getMessage(), e); + } + } + } + = + if (classDefinition =3D=3D null) + { + log.debug("unable to load class " + className); + } classBytes =3D new ClassBytes(className, classDefinition); } return classBytes; @@ -179,4 +229,62 @@ { //NO OP as don't won't allow listeners } + = + /** + * Adapted from org.jboss.mx.loading.RepositoryClassLoader. + * = + * @param cl + * @param classname + * @return + * @throws ClassNotFoundException + * @throws IOException + */ + protected byte[] loadByteCode(ClassLoader cl, String classname) + throws ClassNotFoundException, IOException + { + byte[] bytecode =3D null; + URL classURL =3D getClassURL(cl, classname); + + // Load the class bytecode + InputStream is =3D null; + try + { + is =3D classURL.openStream(); + ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); + byte[] tmp =3D new byte[1024]; + int read =3D 0; + while( (read =3D is.read(tmp)) > 0 ) + { + baos.write(tmp, 0, read); + } + bytecode =3D baos.toByteArray(); + } + finally + { + if( is !=3D null ) + is.close(); + } + + return bytecode; + } + = + /** + * Adapted from org.jboss.mx.loading.RepositoryClassLoader. + * = + * @param cl + * @param classname + * @return + * @throws ClassNotFoundException + */ + private URL getClassURL(ClassLoader cl, String classname) throws ClassN= otFoundException + { + String classRsrcName =3D classname.replace('.', '/') + ".class"; + URL classURL =3D cl.getResource(classRsrcName); + if( classURL =3D=3D null ) + { + String msg =3D "Failed to find: "+classname+" as resource: "+clas= sRsrcName; + throw new ClassNotFoundException(msg); + } + return classURL; + } } --===============8254292419756903588==-- From jboss-remoting-commits at lists.jboss.org Fri Aug 1 01:52:53 2008 Content-Type: multipart/mixed; boundary="===============0089139596917883235==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4456 - remoting2/branches/2.x/src/main/org/jboss/remoting/marshal. Date: Fri, 01 Aug 2008 01:52:53 -0400 Message-ID: --===============0089139596917883235== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-01 01:52:52 -0400 (Fri, 01 Aug 2008) New Revision: 4456 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshallLoade= rFactory.java Log: JBREM-1000: arshallerLoaderHandler gets repositories set and MBeanServer. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/Marsha= llLoaderFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshallLoad= erFactory.java 2008-08-01 05:52:08 UTC (rev 4455) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshallLoad= erFactory.java 2008-08-01 05:52:52 UTC (rev 4456) @@ -23,7 +23,11 @@ package org.jboss.remoting.marshal; = import java.util.HashMap; +import java.util.List; import java.util.Map; + +import javax.management.MBeanServer; + import org.jboss.logging.Logger; import org.jboss.remoting.InvokerLocator; import org.jboss.remoting.transport.Connector; @@ -43,9 +47,11 @@ * listen on. Will return null if can not create the connector. * * @param locator + * @param repositories + * @param mbeanServer * @return */ - public static Connector createMarshallLoader(InvokerLocator locator) + public static Connector createMarshallLoader(InvokerLocator locator, Li= st repositories, MBeanServer mbeanServer) { Connector marshallerConnector =3D null; try @@ -54,8 +60,11 @@ marshallerConnector.setInvokerLocator(locator.getLocatorURI()); marshallerConnector.start(); = - MarshallerLoaderHandler loader =3D new MarshallerLoaderHandler(); + MarshallerLoaderHandler loader =3D new MarshallerLoaderHandler(re= positories); marshallerConnector.addInvocationHandler("loader", loader); + = + // Set after Connector.addInvocationHandler(), which also sets MB= eanServer. + loader.setMBeanServer(mbeanServer); } catch(Exception e) { --===============0089139596917883235==-- From jboss-remoting-commits at lists.jboss.org Fri Aug 1 01:53:42 2008 Content-Type: multipart/mixed; boundary="===============4163758651540337470==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4457 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport. Date: Fri, 01 Aug 2008 01:53:42 -0400 Message-ID: --===============4163758651540337470== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-01 01:53:42 -0400 (Fri, 01 Aug 2008) New Revision: 4457 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Connector.j= ava Log: JBREM-1000: Added ability to read element from xml config fi= le. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Conn= ector.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Connector.= java 2008-08-01 05:52:52 UTC (rev 4456) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Connector.= java 2008-08-01 05:53:42 UTC (rev 4457) @@ -508,7 +508,8 @@ // if loaderLocator is null, then probably not defined to have loade= r service (i.e. no loader port specified) if (loaderLocator !=3D null) { - marshallerLoader =3D MarshallLoaderFactory.createMarshallLoader(l= oaderLocator); + List repositories =3D getLoaderRepositories(); + marshallerLoader =3D MarshallLoaderFactory.createMarshallLoader(l= oaderLocator, repositories, server); } return marshallerLoader; } @@ -972,6 +973,41 @@ } } = + private List getLoaderRepositories() + { + if (xml =3D=3D null) + { + return null; + } + + NodeList repositoryNodes =3D xml.getElementsByTagName("repository"); + if (repositoryNodes.getLength() =3D=3D 0) + { + return null; + } + = + List repositories =3D new ArrayList(); + for (int i =3D 0; i < repositoryNodes.getLength(); i++) + { + Node node =3D repositoryNodes.item(i); + String repositoryName =3D node.getFirstChild().getNodeValue(); + + try + { + ObjectName objName =3D new ObjectName(repositoryName); + repositories.add(objName); + log.info("repository: " + repositoryName); + } + catch (MalformedObjectNameException e) + { + log.debug("repository name is not an object name: " + reposito= ryName); + continue; + } + } + = + return repositories; + } + = private ServerInvocationHandler createHandlerProxy(ObjectName objName) { ServerInvocationHandler handler; --===============4163758651540337470==-- From jboss-remoting-commits at lists.jboss.org Fri Aug 1 01:55:00 2008 Content-Type: multipart/mixed; boundary="===============5187520803085695094==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4458 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http. Date: Fri, 01 Aug 2008 01:55:00 -0400 Message-ID: --===============5187520803085695094== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-01 01:55:00 -0400 (Fri, 01 Aug 2008) New Revision: 4458 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPCl= ientInvoker.java Log: JBREM-990: (1) useHttpURLConnection() tries to add responseMessage and resp= onseCode to CannotConnectException(); (2) readResponse() checks for EOF on = inputStream and throws EOFException. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http= /HTTPClientInvoker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPC= lientInvoker.java 2008-08-01 05:53:42 UTC (rev 4457) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPC= lientInvoker.java 2008-08-01 05:55:00 UTC (rev 4458) @@ -51,6 +51,7 @@ import org.jboss.util.threadpool.Task; import org.jboss.util.threadpool.ThreadPool; = +import java.io.EOFException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -379,8 +380,21 @@ } catch (Exception e) { - log.debug("Error invoking http client invoker.", e); - throw new CannotConnectException("Can not connect http client inv= oker.", e); + String message =3D "Can not connect http client invoker."; + if (e.getMessage() !=3D null) + message +=3D " " + e.getMessage() + "."; + = + try + { + String responseMessage =3D conn.getResponseMessage(); + int code =3D conn.getResponseCode(); + message +=3D " Response: " + responseMessage + "/" + code + ".= "; + } + catch (IOException e1) + { + log.debug("Unable to retrieve response message", e1); + } + throw new CannotConnectException(message, e); } = // now check for error response and throw exception unless configure= d to not do so @@ -501,9 +515,9 @@ } = private Object readResponse(Map metadata, Map headers, UnMarshaller unm= arshaller, InputStream is) - throws IOException, ClassNotFoundException + throws ClassNotFoundException, IOException { - Object result; + Object result =3D null; String encoding =3D null; Object ceObj =3D headers.get("Content-Encoding"); if (ceObj !=3D null) @@ -529,10 +543,25 @@ map.put(HTTPUnMarshaller.PRESERVE_LINES, o); } = - if (unmarshaller instanceof VersionedUnMarshaller) - result =3D ((VersionedUnMarshaller)unmarshaller).read(is, map, ge= tVersion()); - else - result =3D unmarshaller.read(is, map); + try + { + if (unmarshaller instanceof VersionedUnMarshaller) + result =3D ((VersionedUnMarshaller)unmarshaller).read(is, map,= getVersion()); + else + result =3D unmarshaller.read(is, map); + } + catch (ClassNotFoundException e) + { + throw e; + } + catch (IOException e) + { + if (-1 =3D=3D is.read()) + { + throw new EOFException(); + } + throw e; + } = return result; } --===============5187520803085695094==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 2 00:00:54 2008 Content-Type: multipart/mixed; boundary="===============5789277809573891714==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4459 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket. Date: Sat, 02 Aug 2008 00:00:54 -0400 Message-ID: --===============5789277809573891714== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-02 00:00:54 -0400 (Sat, 02 Aug 2008) New Revision: 4459 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/Clie= ntSocketWrapper.java Log: JBREM-996, JBREM-997: In createStreams() took timeout reset out of finally = clause. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/sock= et/ClientSocketWrapper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/Cli= entSocketWrapper.java 2008-08-01 05:55:00 UTC (rev 4458) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/Cli= entSocketWrapper.java 2008-08-02 04:00:54 UTC (rev 4459) @@ -158,16 +158,10 @@ } } = - try - { - out =3D createOutputStream(serializationType, socket, marshaller); - in =3D createInputStream(serializationType, socket, unmarshaller); - } - finally - { - setTimeout(savedTimeout); - log.debug("reset timeout: " + savedTimeout); - } + out =3D createOutputStream(serializationType, socket, marshaller); + in =3D createInputStream(serializationType, socket, unmarshaller); + setTimeout(savedTimeout); + log.debug("reset timeout: " + savedTimeout); } = protected InputStream createInputStream(String serializationType, Socke= t socket, UnMarshaller unmarshaller) --===============5789277809573891714==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 2 01:41:55 2008 Content-Type: multipart/mixed; boundary="===============2082594637092793573==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4460 - remoting2/branches/2.x/src/etc. Date: Sat, 02 Aug 2008 01:41:55 -0400 Message-ID: --===============2082594637092793573== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-02 01:41:54 -0400 (Sat, 02 Aug 2008) New Revision: 4460 Modified: remoting2/branches/2.x/src/etc/remoting.security.policy.core Log: JBREM-1019: Added read permission for system property "org.jboss.remoting.c= lassloadingParentFirstDelegation", which is read in MicroRemoteClientInvoke= r. Modified: remoting2/branches/2.x/src/etc/remoting.security.policy.core =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/etc/remoting.security.policy.core 2008-08-02= 04:00:54 UTC (rev 4459) +++ remoting2/branches/2.x/src/etc/remoting.security.policy.core 2008-08-02= 05:41:54 UTC (rev 4460) @@ -182,6 +182,9 @@ //////////////////////////////////////////////////////////////////////////= /////////////////// // System properties accessed by Remoting = + // Used by org.jboss.remoting.MicroRemoteClientInvoker + permission java.util.PropertyPermission "org.jboss.remoting.classloadi= ngParentFirstDelegation", "read"; + = // Used by org.jboss.remoting.callback.CallbackStore, // org.jboss.remoting.callback.ServerInvokerCallbackHandler permission java.util.PropertyPermission "file.separator", "read"; --===============2082594637092793573==-- From jboss-remoting-commits at lists.jboss.org Sun Aug 3 22:52:36 2008 Content-Type: multipart/mixed; boundary="===============3633997472774717403==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4461 - remoting2/branches/2.x/src/etc. Date: Sun, 03 Aug 2008 22:52:36 -0400 Message-ID: --===============3633997472774717403== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-03 22:52:36 -0400 (Sun, 03 Aug 2008) New Revision: 4461 Modified: remoting2/branches/2.x/src/etc/remoting.security.policy.tests Log: JBREM-1012: Added permissions for org.jboss.test.remoting.lease.InjectedCon= nectionListenerTestCase. Modified: remoting2/branches/2.x/src/etc/remoting.security.policy.tests =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/etc/remoting.security.policy.tests 2008-08-0= 2 05:41:54 UTC (rev 4460) +++ remoting2/branches/2.x/src/etc/remoting.security.policy.tests 2008-08-0= 4 02:52:36 UTC (rev 4461) @@ -33,7 +33,10 @@ = // Permission for org.jboss.remoting.callback.CallbackStore permission java.io.FilePermission "${build.home}${/}output${/}tests${/= }classes${/}-", "read, write, delete"; - = + = + // Permission for org.jboss.remoting.ConnectionNotifier = + permission javax.management.MBeanPermission "org.jboss.test.remoting.l= ease.InjectedConnectionListenerTestCase$TestConnectionListener#handleConnec= tionException[jboss:type=3Dconnectionlistener]", "invoke"; + = // org.jboss.test.remoting.detection.metadata.MetadataTestCase permission javax.management.MBeanPermission "org.jboss.test.remoting.d= etection.metadata.MetadataTestCase$TestNetworkRegistry#-[remoting:type=3DNe= tworkRegistry]", "isInstanceOf"; = @@ -142,6 +145,8 @@ permission javax.management.MBeanPermission "org.jboss.test.remoting.d= etection.jndi.JNDIDetectorTest2$TestNetworkRegistry#-[remoting:type=3DNetwo= rkRegistry]", "registerMBean"; permission javax.management.MBeanPermission "org.jboss.test.remoting.d= etection.metadata.MetadataTestCase$TestNetworkRegistry#-[remoting:type=3DNe= tworkRegistry]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf= , addNotificationListener"; permission javax.management.MBeanPermission "org.jboss.test.remoting.h= andler.mbean.MBeanHandler#-[test:type=3Dhandler]", "registerMBean"; + permission javax.management.MBeanPermission "org.jboss.test.remoting.l= ease.InjectedConnectionListenerTestCase$TestConnectionListener#-[jboss:type= =3Dconnectionlistener]", "registerMBean"; + permission javax.management.MBeanPermission "org.jboss.test.remoting.l= ease.InjectedConnectionListenerTestCase$TestConnectionListener#handleConnec= tionException[jboss:type=3Dconnectionlistener]", "invoke"; permission javax.management.MBeanPermission "org.jboss.test.remoting.s= ecurity.TestCallbackErrorHandler#*[test:type=3DTestCallbackErrorHandler]", = "registerMBean, getAttribute"; permission javax.management.MBeanPermission "org.jboss.test.remoting.s= ecurity.TestCallbackStore#*[test:type=3DCallbackstore]", "registerMBean, ge= tAttribute, invoke"; permission javax.management.MBeanPermission "org.jboss.test.remoting.s= ecurity.TestNetworkRegistry#*[test:type=3DTestNetworkRegistry]", "registerM= Bean, unregisterMBean, getAttribute"; --===============3633997472774717403==-- From jboss-remoting-commits at lists.jboss.org Mon Aug 4 00:21:47 2008 Content-Type: multipart/mixed; boundary="===============5929616384699080025==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4462 - in remoting2/branches/2.x/src/tests/org/jboss/test/remoting/classloader: parentfirst and 1 other directory. Date: Mon, 04 Aug 2008 00:21:46 -0400 Message-ID: --===============5929616384699080025== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-04 00:21:46 -0400 (Mon, 04 Aug 2008) New Revision: 4462 Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/classloader/par= entfirst/ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/classloader/par= entfirst/ParentFirstClassloaderTestCase.java Log: JBREM-1019: New unit test. Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/classloader= /parentfirst/ParentFirstClassloaderTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/classloader/pa= rentfirst/ParentFirstClassloaderTestCase.java (rev = 0) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/classloader/pa= rentfirst/ParentFirstClassloaderTestCase.java 2008-08-04 04:21:46 UTC (rev = 4462) @@ -0,0 +1,286 @@ +/* +* 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.classloader.parentfirst; + +import java.io.Serializable; +import java.net.InetAddress; +import java.security.AccessController; +import java.security.PrivilegedAction; +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.callback.InvokerCallbackHandler; +import org.jboss.remoting.transport.Connector; +import org.jboss.remoting.transport.PortUtil; + + +/** + * Unit test for JBREM-1019. + * = + * @author Ron Sigal + * @version $Revision: 1.1 $ + *

+ * Copyright Aug 3, 2008 + *

+ */ +public class ParentFirstClassloaderTestCase extends TestCase +{ + private static Logger log =3D Logger.getLogger(ParentFirstClassloaderTe= stCase.class); + = + private static boolean firstTime =3D 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 =3D false; + Logger.getLogger("org.jboss.remoting").setLevel(XLevel.INFO); + Logger.getLogger("org.jboss.test.remoting").setLevel(Level.INFO); + String pattern =3D "[%d{ABSOLUTE}] [%t] %5p (%F:%L) - %m%n"; + PatternLayout layout =3D new PatternLayout(pattern); + ConsoleAppender consoleAppender =3D new ConsoleAppender(layout); + Logger.getRootLogger().addAppender(consoleAppender); = + } + } + + = + public void tearDown() + { + } + = + + /** + * Verify that by default the context classloader is not called first. + */ + public void testDefaultConfig() throws Throwable + { + log.info("entering " + getName()); + = + // Start server. + setupServer(); + = + // Create client. + InvokerLocator clientLocator =3D new InvokerLocator(locatorURI); + HashMap clientConfig =3D new HashMap(); + clientConfig.put(InvokerLocator.FORCE_REMOTE, "true"); + addExtraClientConfig(clientConfig); + Client client =3D new Client(clientLocator, clientConfig); + client.connect(); + log.info("client is connected"); + = + TestClassLoader tcl =3D new TestClassLoader(); + Thread.currentThread().setContextClassLoader(tcl); + = + // Test connection. + client.invoke("abc"); + log.info("connection is good"); + = + // Verify that TestClassLoader has not been queried. + assertFalse(tcl.visited); + log.info("context classloader has not been queried"); + = + client.disconnect(); + shutdownServer(); + log.info(getName() + " PASSES"); + } + = + = + /** + * Verify that by the context classloader is called first if = + * org.jboss.remoting.Remoting.CLASSLOADING_PARENT_FIRST_DELEGATION is = set to "true" + * in the config map. + */ + public void testByConfigMap() throws Throwable + { + log.info("entering " + getName()); + = + // Start server. + setupServer(); + = + // Create client. + InvokerLocator clientLocator =3D new InvokerLocator(locatorURI); + HashMap clientConfig =3D new HashMap(); + clientConfig.put(InvokerLocator.FORCE_REMOTE, "true"); + clientConfig.put(Remoting.CLASSLOADING_PARENT_FIRST_DELEGATION, "fal= se"); + addExtraClientConfig(clientConfig); + Client client =3D new Client(clientLocator, clientConfig); + client.connect(); + log.info("client is connected"); + = + TestClassLoader tcl =3D new TestClassLoader(); + setContextClassLoader(tcl); + = + // Test connection. + client.invoke("abc"); + log.info("connection is good"); + = + // Verify that TestClassLoader has been queried. + assertTrue(tcl.visited); + log.info("context classloader has been queried"); + = + client.disconnect(); + shutdownServer(); + log.info(getName() + " PASSES"); + } + = + = + /** + * Verify that by the context classloader is called first if the system= property + * org.jboss.remoting.Remoting.CLASSLOADING_PARENT_FIRST_DELEGATION_PRO= P is set to "true" + * in the config map. + */ + public void testBySystemProperty() throws Throwable + { + log.info("entering " + getName()); + = + // Start server. + setupServer(); + = + // Create client. + InvokerLocator clientLocator =3D new InvokerLocator(locatorURI); + HashMap clientConfig =3D new HashMap(); + clientConfig.put(InvokerLocator.FORCE_REMOTE, "true"); + addExtraClientConfig(clientConfig); + Client client =3D new Client(clientLocator, clientConfig); + client.connect(); + log.info("client is connected"); + = + System.setProperty(Remoting.CLASSLOADING_PARENT_FIRST_DELEGATION_PRO= P, "false"); + TestClassLoader tcl =3D new TestClassLoader(); + setContextClassLoader(tcl); + = + // Test connection. + client.invoke("abc"); + log.info("connection is good"); + = + // Verify that TestClassLoader has been queried. + assertTrue(tcl.visited); + log.info("context classloader has been queried"); + = + client.disconnect(); + shutdownServer(); + log.info(getName() + " PASSES"); + } + = + protected String getTransport() + { + return "socket"; + } + = + = + protected void addExtraClientConfig(Map config) {} + protected void addExtraServerConfig(Map config) {} + = + + protected void setupServer() throws Exception + { + host =3D InetAddress.getLocalHost().getHostAddress(); + port =3D PortUtil.findFreePort(host); + locatorURI =3D getTransport() + "://" + host + ":" + port; = + serverLocator =3D new InvokerLocator(locatorURI); + log.info("Starting remoting server with locator uri of: " + locatorU= RI); + HashMap config =3D new HashMap(); + config.put(InvokerLocator.FORCE_REMOTE, "true"); + addExtraServerConfig(config); + connector =3D new Connector(serverLocator, config); + connector.create(); + invocationHandler =3D new TestInvocationHandler(); + connector.addInvocationHandler("test", invocationHandler); + connector.start(); + } + = + = + protected void shutdownServer() throws Exception + { + if (connector !=3D null) + connector.stop(); + } + = + = + protected void setContextClassLoader(final ClassLoader classLoader) + { + AccessController.doPrivileged( new PrivilegedAction() + { + public Object run() + { + Thread.currentThread().setContextClassLoader(classLoader); + return null; + } + }); + } + = + = + static class TestInvocationHandler implements ServerInvocationHandler + { + public void addListener(InvokerCallbackHandler callbackHandler) {} + public Object invoke(final InvocationRequest invocation) throws Thro= wable + { + return new TestClass(); + } + public void removeListener(InvokerCallbackHandler callbackHandler) {} + public void setMBeanServer(MBeanServer server) {} + public void setInvoker(ServerInvoker invoker) {} + } + + = + static class TestClassLoader extends ClassLoader + { + boolean visited; + = + public Class loadClass(String name) throws ClassNotFoundException + { + visited =3D true; + log.info("TestClassLoader.loadClass(): " + name); + throw new ClassNotFoundException(name); + } + } + = + = + static class TestClass implements Serializable + { + /** The serialVersionUID */ + private static final long serialVersionUID =3D 1L; + } +} \ No newline at end of file --===============5929616384699080025==-- From jboss-remoting-commits at lists.jboss.org Mon Aug 4 22:59:59 2008 Content-Type: multipart/mixed; boundary="===============8621564708833983135==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4463 - in remoting3/trunk: api/src/main/java/org/jboss/cx/remoting/spi and 7 other directories. Date: Mon, 04 Aug 2008 22:59:58 -0400 Message-ID: --===============8621564708833983135== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: david.lloyd(a)jboss.com Date: 2008-08-04 22:59:58 -0400 (Mon, 04 Aug 2008) New Revision: 4463 Added: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/HandleableClosea= ble.java remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/RemoteServiceReg= istration.java remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/ServiceListener.= java remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/SimpleCloseable.= java remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/AbstractHand= leableCloseable.java remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/AbstractSimp= leCloseable.java remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/FutureClie= ntSource.java remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/ServiceReg= istration.java Removed: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/Closeable.java remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/AbstractClos= eable.java Modified: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/Client.java remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/ClientContext.ja= va remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/ClientSource.java remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/Endpoint.java remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/ServiceContext.j= ava remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/AbstractAuto= Closeable.java remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/remote/Handl= e.java remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/remote/Reque= stHandler.java remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/remote/Reque= stHandlerSource.java remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/wrapper/Endp= ointWrapper.java remoting3/trunk/api/src/test/java/org/jboss/cx/remoting/spi/CloseableTes= tCase.java remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/AbstractCo= ntextImpl.java remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/ClientSour= ceImpl.java remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/EndpointIm= pl.java remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/proto= col/basic/AbstractConnection.java remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/proto= col/basic/Connection.java remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/proto= col/basic/MessageType.java remoting3/trunk/protocol/basic/src/test/java/org/jboss/cx/remoting/proto= col/basic/ConnectionTestCase.java remoting3/trunk/standalone/src/main/java/org/jboss/cx/remoting/Remoting.= java Log: API changes for service registration, location Modified: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/Client.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/Client.java 200= 8-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/Client.java 200= 8-08-05 02:59:58 UTC (rev 4463) @@ -10,7 +10,7 @@ * @param the request type * @param the reply type */ -public interface Client extends Closeable> { +public interface Client extends HandleableCloseable> { /** * Send a request and block until a reply is received. *

Modified: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/ClientCon= text.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/ClientContext.j= ava 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/ClientContext.j= ava 2008-08-05 02:59:58 UTC (rev 4463) @@ -5,7 +5,7 @@ /** * The server context for a single remote client instance. */ -public interface ClientContext extends Closeable { +public interface ClientContext extends HandleableCloseable { /** * Get the attributes for this end of the channel as a map. * Modified: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/ClientSou= rce.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/ClientSource.ja= va 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/ClientSource.ja= va 2008-08-05 02:59:58 UTC (rev 4463) @@ -8,7 +8,7 @@ * @param the request type * @param the reply type */ -public interface ClientSource extends Closeable> { +public interface ClientSource extends HandleableCloseable> { /** * Close the context source. New contexts may no longer be created af= ter this * method is called. Subsequent calls to this method have no addition= al effect. Deleted: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/Closeable.= java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/Closeable.java = 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/Closeable.java = 2008-08-05 02:59:58 UTC (rev 4463) @@ -1,26 +0,0 @@ -package org.jboss.cx.remoting; - -import java.io.IOException; - -/** - * A Remoting resource that can be closed. - * - * @param the type that is passed to the close handler - */ -public interface Closeable extends java.io.Closeable { - - /** - * Close, waiting for any outstanding processing to finish. - * - * @throws IOException if the close failed - */ - void close() throws IOException; - - /** - * Add a handler that will be called upon close. The handler may be c= alled before or after the close acutally - * takes place. - * - * @param handler the close handler - */ - void addCloseHandler(CloseHandler handler); -} Modified: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/Endpoint.= java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/Endpoint.java 2= 008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/Endpoint.java 2= 008-08-05 02:59:58 UTC (rev 4463) @@ -1,10 +1,12 @@ package org.jboss.cx.remoting; = import java.util.concurrent.ConcurrentMap; +import java.net.URI; import java.io.IOException; import org.jboss.cx.remoting.spi.remote.RequestHandler; import org.jboss.cx.remoting.spi.remote.RequestHandlerSource; import org.jboss.cx.remoting.spi.remote.Handle; +import org.jboss.xnio.IoFuture; = /** * A potential participant in a JBoss Remoting communications relationship. @@ -51,10 +53,12 @@ * @param the request type * @param the reply type * @param requestListener the request listener + * @param serviceType the type of service to advertise + * @param groupName the name of the group of this type to be part of * @return a handle for the client source * @throws IOException if an error occurs */ - Handle createRequestHandlerSource(Request= Listener requestListener) throws IOException; + Handle createRequestHandlerSource(Request= Listener requestListener, String serviceType, String groupName) throw= s IOException; = /** * Create a client that uses the given request handler to handle its r= equests. @@ -77,4 +81,42 @@ * @throws IOException if an error occurs */ ClientSource createClientSource(RequestHandlerSource hand= lerSource) throws IOException; + + /** + * Attempt to locate a service. The return value then be queried for = the service's {@code ClientSource}. + * + * @param the request type + * @param the reply type + * @param serviceUri the URI of the service + * @return the future service + * @throws IllegalArgumentException if the given URI is not a valid Re= moting service URI + */ + IoFuture> locateService(URI serviceUri) thro= ws IllegalArgumentException; + + /** + * Register a remotely available service.

+ * The remote endpoint may not have the same name as this endpoint. T= he group name and service type must be + * non-{@code null} and non-empty. The metric must be greater than ze= ro. + * + * @param serviceType the service type string + * @param groupName the group name + * @param endpointName the name of the remote endpoint + * @param handlerSource the remote handler source + * @param metric the preference metric, lower is more preferred + * @return a handle corresponding to the registration + * @throws IllegalArgumentException if one of the given arguments was = not valid + * @throws IOException if an error occurs with the registration + */ + SimpleCloseable registerRemoteService(String serviceType, String group= Name, String endpointName, RequestHandlerSource handlerSource, int metric) = throws IllegalArgumentException, IOException; + + /** + * Add a listener for observing when local and remote services are add= ed. The caller may specify whether the listener + * should be notified of the complete list of currently registered ser= vices (set {@code onlyNew} to {@code false}) + * or only services registered after the time of calling this method (= set {@code onlyNew} to {@code true}). + * + * @param serviceListener the listener + * @param onlyNew {@code true} if only new registrations should be sen= t to the listener + * @return a handle which may be used to unregister the listener + */ + SimpleCloseable addServiceListener(ServiceListener serviceListener, bo= olean onlyNew); } Copied: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/HandleableC= loseable.java (from rev 4437, remoting3/trunk/api/src/main/java/org/jboss/c= x/remoting/Closeable.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/HandleableClose= able.java (rev 0) +++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/HandleableClose= able.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -0,0 +1,27 @@ +package org.jboss.cx.remoting; + +import java.io.IOException; +import java.io.Closeable; + +/** + * A Remoting resource that can be closed. + * + * @param the type that is passed to the close handler + */ +public interface HandleableCloseable extends Closeable { + + /** + * Close, waiting for any outstanding processing to finish. + * + * @throws IOException if the close failed + */ + void close() throws IOException; + + /** + * Add a handler that will be called upon close. The handler may be c= alled before or after the close acutally + * takes place. + * + * @param handler the close handler + */ + void addCloseHandler(CloseHandler handler); +} Added: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/RemoteServic= eRegistration.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/RemoteServiceRe= gistration.java (rev 0) +++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/RemoteServiceRe= gistration.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -0,0 +1,29 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2008, 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.cx.remoting; + +/** + * + */ +public interface RemoteServiceRegistration extends HandleableCloseable { +} Modified: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/ServiceCo= ntext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/ServiceContext.= java 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/ServiceContext.= java 2008-08-05 02:59:58 UTC (rev 4463) @@ -6,7 +6,7 @@ * The server-side context of a service. Used to hold state relating to a= service (known as a {@code ContextSource} on * the client side). */ -public interface ServiceContext extends Closeable { +public interface ServiceContext extends HandleableCloseable { = /** * Get an attribute map which can be used to cache arbitrary state on = the server side. Added: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/ServiceListe= ner.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/ServiceListener= .java (rev 0) +++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/ServiceListener= .java 2008-08-05 02:59:58 UTC (rev 4463) @@ -0,0 +1,56 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2008, 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.cx.remoting; + +import org.jboss.cx.remoting.spi.remote.RequestHandlerSource; + +/** + * A listener for watching service registrations on an endpoint. + */ +public interface ServiceListener { + + /** + * Receive notification that a local service was added. To receive a = notification when it is closed, register a + * close handler on the provided {@code requestHandlerSource} paramete= r. + * + * @param listenerHandle the handle to this listener + * @param serviceType the service type string + * @param groupName the group name string + * @param requestHandlerSource the request handler source + */ + void localServiceCreated(SimpleCloseable listenerHandle, String servic= eType, String groupName, RequestHandlerSource requestHandlerSource); + + /** + * Receive notification that a remote service was registered. To rece= ive a notification when it is unregistered, register a + * close handler on the provided {@code handle} parameter. + * + * @param listenerHandle the handle to this listener + * @param endpointName the remote endpoint name + * @param serviceType the service type string + * @param groupName the group name string + * @param metric the metric value + * @param requestHandlerSource the request handler source + * @param handle the handle to the registration + */ + void remoteServiceRegistered(SimpleCloseable listenerHandle, String en= dpointName, String serviceType, String groupName, int metric, RequestHandle= rSource requestHandlerSource, SimpleCloseable handle); +} Added: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/SimpleClosea= ble.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/SimpleCloseable= .java (rev 0) +++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/SimpleCloseable= .java 2008-08-05 02:59:58 UTC (rev 4463) @@ -0,0 +1,29 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2008, 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.cx.remoting; + +/** + * A simple close-only handle. + */ +public interface SimpleCloseable extends HandleableCloseable { +} Modified: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/Abstr= actAutoCloseable.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/AbstractAut= oCloseable.java 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/AbstractAut= oCloseable.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -33,7 +33,7 @@ * A closeable implementation that supports reference counting. Since the= initial reference count is zero, implementors * must be careful to ensure that the first operation invoked is a call to= {@link #getHandle()}. */ -public abstract class AbstractAutoCloseable extends AbstractCloseable { +public abstract class AbstractAutoCloseable extends AbstractHandleableC= loseable { = private final AtomicInteger refcount =3D new AtomicInteger(0); private final Executor executor; @@ -100,7 +100,7 @@ return new HandleImpl(); } = - private final class HandleImpl extends AbstractCloseable> im= plements Handle { + private final class HandleImpl extends AbstractHandleableCloseable> implements Handle { private HandleImpl() throws IOException { super(AbstractAutoCloseable.this.executor); inc(); Deleted: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/Abstra= ctCloseable.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/AbstractClo= seable.java 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/AbstractClo= seable.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -1,178 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2008, 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.cx.remoting.spi; - -import org.jboss.cx.remoting.Closeable; -import org.jboss.cx.remoting.RemotingException; -import org.jboss.cx.remoting.CloseHandler; -import org.jboss.cx.remoting.spi.SpiUtils; -import org.jboss.xnio.IoUtils; -import org.jboss.xnio.log.Logger; -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.Executor; -import java.util.concurrent.RejectedExecutionException; -import java.util.concurrent.atomic.AtomicBoolean; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.io.IOException; - -/** - * A basic implementation of a closeable resource. Use as a convenient ba= se class for your closeable resources. - * Ensures that the {@code close()} method is idempotent; implements the r= egistry of close handlers. - */ -public abstract class AbstractCloseable implements Closeable { - - private static final Logger log =3D Logger.getLogger(AbstractCloseable= .class); - - protected final Executor executor; - private final Object closeLock =3D new Object(); - private final AtomicBoolean closed =3D new AtomicBoolean(); - private Set> closeHandlers; - - private static final boolean LEAK_DEBUGGING; - private final StackTraceElement[] backtrace; - - static { - boolean b =3D false; - try { - b =3D Boolean.parseBoolean(AccessController.doPrivileged(new P= rivilegedAction() { - public String run() { - return System.getProperty("jboss.remoting.leakdebuggin= g", "false"); - } - })); - } catch (SecurityException se) { - b =3D false; - } - LEAK_DEBUGGING =3D b; - } - - /** - * Basic constructor. - * - * @param executor the executor used to execute the close notification= handlers - */ - protected AbstractCloseable(final Executor executor) { - if (executor =3D=3D null) { - throw new NullPointerException("executor is null"); - } - this.executor =3D executor; - backtrace =3D LEAK_DEBUGGING ? new Throwable().getStackTrace() : n= ull; - } - - /** - * Read the status of this resource. This is just a snapshot in time;= there is no guarantee that the resource - * will remain open for any amount of time, even if this method return= s {@code true}. - * - * @return {@code true} if the resource is still open - */ - protected boolean isOpen() { - return ! closed.get(); - } - - /** - * Called exactly once when the {@code close()} method is invoked; the= actual close operation should take place here. - * - * @throws RemotingException if the close failed - */ - protected void closeAction() throws IOException {} - - /** - * {@inheritDoc} - */ - public final void close() throws IOException { - if (! closed.getAndSet(true)) { - log.trace("Closed %s", this); - synchronized (closeLock) { - if (closeHandlers !=3D null) { - for (final CloseHandler handler : closeHand= lers) { - try { - executor.execute(new Runnable() { - @SuppressWarnings({ "unchecked" }) - public void run() { - SpiUtils.safeHandleClose(handler, (T) = AbstractCloseable.this); - } - }); - } catch (RejectedExecutionException ree) { - log.warn("Unable to execute close handler (exe= cution rejected) for %s (%s)", this, ree.getMessage()); - } - } - closeHandlers =3D null; - } - } - closeAction(); - } - } - - /** - * {@inheritDoc} - */ - public void addCloseHandler(final CloseHandler handler) { - synchronized (closeLock) { - if (closeHandlers =3D=3D null) { - closeHandlers =3D new HashSet>(); - } - closeHandlers.add(handler); - } - } - - /** - * Get the executor to use for handler invocation. - * - * @return the executor - */ - protected Executor getExecutor() { - return executor; - } - - /** - * Finalize this closeable instance. If the instance hasn't been clos= ed, it is closed and a warning is logged. - */ - protected void finalize() throws Throwable { - try { - super.finalize(); - } finally { - if (isOpen()) { - if (LEAK_DEBUGGING) { - final Throwable t =3D new LeakThrowable(); - t.setStackTrace(backtrace); - log.warn(t, "Leaked a %s instance: %s", getClass().get= Name(), this); - } else { - log.warn("Leaked a %s instance: %s", getClass().getNam= e(), this); - } - IoUtils.safeClose(this); - } - } - } - - @SuppressWarnings({ "serial" }) - private static final class LeakThrowable extends Throwable { - - public LeakThrowable() { - } - - public String toString() { - return "a leaked reference"; - } - } -} Copied: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/Abstrac= tHandleableCloseable.java (from rev 4439, remoting3/trunk/api/src/main/java= /org/jboss/cx/remoting/spi/AbstractCloseable.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/AbstractHan= dleableCloseable.java (rev 0) +++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/AbstractHan= dleableCloseable.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -0,0 +1,178 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2008, 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.cx.remoting.spi; + +import org.jboss.cx.remoting.HandleableCloseable; +import org.jboss.cx.remoting.RemotingException; +import org.jboss.cx.remoting.CloseHandler; +import org.jboss.cx.remoting.spi.SpiUtils; +import org.jboss.xnio.IoUtils; +import org.jboss.xnio.log.Logger; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.Executor; +import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.atomic.AtomicBoolean; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.io.IOException; + +/** + * A basic implementation of a closeable resource. Use as a convenient ba= se class for your closeable resources. + * Ensures that the {@code close()} method is idempotent; implements the r= egistry of close handlers. + */ +public abstract class AbstractHandleableCloseable implements Handleable= Closeable { + + private static final Logger log =3D Logger.getLogger(AbstractHandleabl= eCloseable.class); + + protected final Executor executor; + private final Object closeLock =3D new Object(); + private final AtomicBoolean closed =3D new AtomicBoolean(); + private Set> closeHandlers; + + private static final boolean LEAK_DEBUGGING; + private final StackTraceElement[] backtrace; + + static { + boolean b =3D false; + try { + b =3D Boolean.parseBoolean(AccessController.doPrivileged(new P= rivilegedAction() { + public String run() { + return System.getProperty("jboss.remoting.leakdebuggin= g", "false"); + } + })); + } catch (SecurityException se) { + b =3D false; + } + LEAK_DEBUGGING =3D b; + } + + /** + * Basic constructor. + * + * @param executor the executor used to execute the close notification= handlers + */ + protected AbstractHandleableCloseable(final Executor executor) { + if (executor =3D=3D null) { + throw new NullPointerException("executor is null"); + } + this.executor =3D executor; + backtrace =3D LEAK_DEBUGGING ? new Throwable().getStackTrace() : n= ull; + } + + /** + * Read the status of this resource. This is just a snapshot in time;= there is no guarantee that the resource + * will remain open for any amount of time, even if this method return= s {@code true}. + * + * @return {@code true} if the resource is still open + */ + protected boolean isOpen() { + return ! closed.get(); + } + + /** + * Called exactly once when the {@code close()} method is invoked; the= actual close operation should take place here. + * + * @throws RemotingException if the close failed + */ + protected void closeAction() throws IOException {} + + /** + * {@inheritDoc} + */ + public final void close() throws IOException { + if (! closed.getAndSet(true)) { + log.trace("Closed %s", this); + synchronized (closeLock) { + if (closeHandlers !=3D null) { + for (final CloseHandler handler : closeHand= lers) { + try { + executor.execute(new Runnable() { + @SuppressWarnings({ "unchecked" }) + public void run() { + SpiUtils.safeHandleClose(handler, (T) = AbstractHandleableCloseable.this); + } + }); + } catch (RejectedExecutionException ree) { + log.warn("Unable to execute close handler (exe= cution rejected) for %s (%s)", this, ree.getMessage()); + } + } + closeHandlers =3D null; + } + } + closeAction(); + } + } + + /** + * {@inheritDoc} + */ + public void addCloseHandler(final CloseHandler handler) { + synchronized (closeLock) { + if (closeHandlers =3D=3D null) { + closeHandlers =3D new HashSet>(); + } + closeHandlers.add(handler); + } + } + + /** + * Get the executor to use for handler invocation. + * + * @return the executor + */ + protected Executor getExecutor() { + return executor; + } + + /** + * Finalize this closeable instance. If the instance hasn't been clos= ed, it is closed and a warning is logged. + */ + protected void finalize() throws Throwable { + try { + super.finalize(); + } finally { + if (isOpen()) { + if (LEAK_DEBUGGING) { + final Throwable t =3D new LeakThrowable(); + t.setStackTrace(backtrace); + log.warn(t, "Leaked a %s instance: %s", getClass().get= Name(), this); + } else { + log.warn("Leaked a %s instance: %s", getClass().getNam= e(), this); + } + IoUtils.safeClose(this); + } + } + } + + @SuppressWarnings({ "serial" }) + private static final class LeakThrowable extends Throwable { + + public LeakThrowable() { + } + + public String toString() { + return "a leaked reference"; + } + } +} Added: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/Abstract= SimpleCloseable.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/AbstractSim= pleCloseable.java (rev 0) +++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/AbstractSim= pleCloseable.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -0,0 +1,41 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2008, 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.cx.remoting.spi; + +import org.jboss.cx.remoting.SimpleCloseable; +import java.util.concurrent.Executor; + +/** + * An abstract simple closeable implementation. + */ +public abstract class AbstractSimpleCloseable extends AbstractHandleableCl= oseable implements SimpleCloseable { + + /** + * Basic constructor. + * + * @param executor the executor used to execute the close notification= handlers + */ + protected AbstractSimpleCloseable(final Executor executor) { + super(executor); + } +} Modified: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/remot= e/Handle.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/remote/Hand= le.java 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/remote/Hand= le.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -22,14 +22,14 @@ = package org.jboss.cx.remoting.spi.remote; = -import org.jboss.cx.remoting.Closeable; +import org.jboss.cx.remoting.HandleableCloseable; import org.jboss.cx.remoting.CloseHandler; import java.io.IOException; = /** * A handle to a local resource. */ -public interface Handle extends Closeable> { +public interface Handle extends HandleableCloseable> { = /** * Get the resource. Modified: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/remot= e/RequestHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/remote/Requ= estHandler.java 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/remote/Requ= estHandler.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -22,7 +22,7 @@ = package org.jboss.cx.remoting.spi.remote; = -import org.jboss.cx.remoting.Closeable; +import org.jboss.cx.remoting.HandleableCloseable; import org.jboss.cx.remoting.RemotingException; import org.jboss.cx.remoting.CloseHandler; import java.io.IOException; @@ -31,7 +31,7 @@ * A request handler, which can be passed to remote endpoints. Remote sys= tems can then use the handler * to make invocations, or they may forward a handler on to other remote s= ystems. */ -public interface RequestHandler extends Closeable { +public interface RequestHandler extends HandleableCloseable { = /** * Receive a one-way request from a remote system. This method is int= ended to be called by protocol handlers. No Modified: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/remot= e/RequestHandlerSource.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/remote/Requ= estHandlerSource.java 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/remote/Requ= estHandlerSource.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -22,7 +22,7 @@ = package org.jboss.cx.remoting.spi.remote; = -import org.jboss.cx.remoting.Closeable; +import org.jboss.cx.remoting.HandleableCloseable; import org.jboss.cx.remoting.RemotingException; import org.jboss.cx.remoting.CloseHandler; import java.io.IOException; @@ -33,7 +33,7 @@ * has the advantage that a round trip to the remote side is not necessary= ; the local side can spawn a request handler * and simply notify the remote side of the change. */ -public interface RequestHandlerSource extends Closeable { +public interface RequestHandlerSource extends HandleableCloseable { = /** * Create a request handler for the service corresponding to this requ= est handler source. Modified: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/wrapp= er/EndpointWrapper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/wrapper/End= pointWrapper.java 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/wrapper/End= pointWrapper.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -2,13 +2,17 @@ = import java.util.concurrent.ConcurrentMap; import java.io.IOException; +import java.net.URI; import org.jboss.cx.remoting.Endpoint; import org.jboss.cx.remoting.RequestListener; import org.jboss.cx.remoting.Client; import org.jboss.cx.remoting.ClientSource; +import org.jboss.cx.remoting.SimpleCloseable; +import org.jboss.cx.remoting.ServiceListener; import org.jboss.cx.remoting.spi.remote.RequestHandler; import org.jboss.cx.remoting.spi.remote.RequestHandlerSource; import org.jboss.cx.remoting.spi.remote.Handle; +import org.jboss.xnio.IoFuture; = /** * A simple delegating wrapper for endpoints. @@ -49,8 +53,8 @@ /** * {@inheritDoc} This implementation calls the same method on the del= egate object. */ - public Handle createRequestHandlerSource(= final RequestListener requestListener) throws IOException { - return delegate.createRequestHandlerSource(requestListener); + public Handle createRequestHandlerSource(= final RequestListener requestListener, final String serviceType, fina= l String groupName) throws IOException { + return delegate.createRequestHandlerSource(requestListener, servic= eType, groupName); } = /** @@ -66,4 +70,25 @@ public ClientSource createClientSource(final RequestHandl= erSource handlerSource) throws IOException { return delegate.createClientSource(handlerSource); } + + /** + * {@inheritDoc} This implementation calls the same method on the del= egate object. + */ + public IoFuture> locateService(final URI ser= viceUri) throws IllegalArgumentException { + return delegate.locateService(serviceUri); + } + + /** + * {@inheritDoc} This implementation calls the same method on the del= egate object. + */ + public SimpleCloseable registerRemoteService(final String serviceType,= final String groupName, final String endpointName, final RequestHandlerSou= rce handlerSource, final int metric) throws IllegalArgumentException, IOExc= eption { + return delegate.registerRemoteService(serviceType, groupName, endp= ointName, handlerSource, metric); + } + + /** + * {@inheritDoc} This implementation calls the same method on the del= egate object. + */ + public SimpleCloseable addServiceListener(final ServiceListener servic= eListener, final boolean onlyNew) { + return delegate.addServiceListener(serviceListener, true); + } } Modified: remoting3/trunk/api/src/test/java/org/jboss/cx/remoting/spi/Close= ableTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/api/src/test/java/org/jboss/cx/remoting/spi/CloseableTe= stCase.java 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/api/src/test/java/org/jboss/cx/remoting/spi/CloseableTe= stCase.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -46,7 +46,7 @@ try { final AtomicBoolean closed =3D new AtomicBoolean(); final CountDownLatch latch =3D new CountDownLatch(1); - final AbstractCloseable closeable =3D new AbstractClos= eable(executorService) { + final AbstractHandleableCloseable closeable =3D new Ab= stractHandleableCloseable(executorService) { // empty }; try { Modified: remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/Abs= tractContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/AbstractC= ontextImpl.java 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/AbstractC= ontextImpl.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -25,12 +25,12 @@ import java.util.concurrent.ConcurrentMap; import java.util.concurrent.Executor; import org.jboss.cx.remoting.util.CollectionUtil; -import org.jboss.cx.remoting.spi.AbstractCloseable; +import org.jboss.cx.remoting.spi.AbstractHandleableCloseable; = /** * */ -public abstract class AbstractContextImpl extends AbstractCloseable { +public abstract class AbstractContextImpl extends AbstractHandleableClo= seable { = private final ConcurrentMap attributes =3D CollectionU= til.concurrentMap(); = Modified: remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/Cli= entSourceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/ClientSou= rceImpl.java 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/ClientSou= rceImpl.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -29,14 +29,14 @@ import org.jboss.cx.remoting.spi.remote.RequestHandler; import org.jboss.cx.remoting.spi.remote.RequestHandlerSource; import org.jboss.cx.remoting.spi.remote.Handle; -import org.jboss.cx.remoting.spi.AbstractCloseable; +import org.jboss.cx.remoting.spi.AbstractHandleableCloseable; import org.jboss.xnio.IoUtils; import java.io.IOException; = /** * */ -public final class ClientSourceImpl extends AbstractCloseable> implements ClientSource { +public final class ClientSourceImpl extends AbstractHandleableClosea= ble> implements ClientSource { = private final Handle handle; private final Endpoint endpoint; Modified: remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/End= pointImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/EndpointI= mpl.java 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/EndpointI= mpl.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -6,22 +6,32 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.Set; +import java.util.Map; +import java.util.List; import java.io.Closeable; import java.io.IOException; +import java.net.URI; import org.jboss.cx.remoting.Endpoint; import org.jboss.cx.remoting.RequestListener; import org.jboss.cx.remoting.CloseHandler; import org.jboss.cx.remoting.Client; import org.jboss.cx.remoting.ClientSource; +import org.jboss.cx.remoting.SimpleCloseable; +import org.jboss.cx.remoting.ServiceListener; import org.jboss.cx.remoting.core.util.OrderedExecutorFactory; import org.jboss.cx.remoting.spi.remote.RequestHandler; import org.jboss.cx.remoting.spi.remote.RequestHandlerSource; import org.jboss.cx.remoting.spi.remote.Handle; +import org.jboss.cx.remoting.spi.AbstractSimpleCloseable; import org.jboss.cx.remoting.util.CollectionUtil; import org.jboss.cx.remoting.util.NamingThreadFactory; +import org.jboss.cx.remoting.util.ServiceURI; import org.jboss.cx.remoting.version.Version; import org.jboss.xnio.log.Logger; import org.jboss.xnio.IoUtils; +import org.jboss.xnio.IoFuture; +import org.jboss.xnio.FinishedIoFuture; +import org.jboss.xnio.FailedIoFuture; = /** * @@ -41,6 +51,10 @@ private final Set resources =3D CollectionUtil.synchronized= WeakHashSet(); private final ConcurrentMap endpointMap =3D Collection= Util.concurrentMap(); = + private final Object serviceLock =3D new Object(); + private final Map serviceListener= Map =3D CollectionUtil.hashMap(); + private final Set serviceRegistrations =3D Collec= tionUtil.hashSet(); + public EndpointImpl() { } = @@ -128,8 +142,40 @@ return localRequestHandler.getHandle(); } = - public Handle createRequestHandlerSource(= final RequestListener requestListener) throws IOException { + public Handle createRequestHandlerSource(= final RequestListener requestListener, final String serviceType, fina= l String groupName) throws IOException { + if (serviceType =3D=3D null) { + throw new NullPointerException("serviceType is null"); + } + if (groupName =3D=3D null) { + throw new NullPointerException("groupName is null"); + } + if (serviceType.length() =3D=3D 0) { + throw new IllegalArgumentException("serviceType is empty"); + } + if (groupName.length() =3D=3D 0) { + throw new IllegalArgumentException("groupName is empty"); + } final LocalRequestHandlerSource localRequestHandlerSource = =3D new LocalRequestHandlerSource(executor, requestListener); + final ServiceRegistration registration =3D new ServiceRegistration= (serviceType, groupName, name, localRequestHandlerSource); + final AbstractSimpleCloseable newHandle =3D new AbstractSimpleClos= eable(executor) { + protected void closeAction() throws IOException { + synchronized (serviceLock) { + serviceRegistrations.remove(registration); + } + } + }; + registration.setHandle(newHandle); + synchronized (serviceLock) { + serviceRegistrations.add(registration); + for (final ServiceListenerRegistration slr : serviceListenerMa= p.values()) { + final ServiceListener listener =3D slr.getServiceListener(= ); + slr.getExecutor().execute(new Runnable() { + public void run() { + listener.localServiceCreated(slr.handle, serviceTy= pe, groupName, localRequestHandlerSource); + } + }); + } + } localRequestHandlerSource.addCloseHandler(remover); localRequestHandlerSource.open(); return localRequestHandlerSource.getHandle(); @@ -168,6 +214,188 @@ } } = + public IoFuture> locateService(final URI ser= viceUri) throws IllegalArgumentException { + // todo - should this be typesafe? + if (serviceUri =3D=3D null) { + throw new NullPointerException("serviceUri is null"); + } + if (! ServiceURI.isRemotingServiceUri(serviceUri)) { + throw new IllegalArgumentException("Not a valid remoting servi= ce URI"); + } + final String endpointName =3D ServiceURI.getEndpointName(serviceUr= i); + final String groupName =3D ServiceURI.getGroupName(serviceUri); + final String serviceType =3D ServiceURI.getServiceType(serviceUri); + synchronized (serviceLock) { + int bestMetric =3D Integer.MAX_VALUE; + List candidates =3D CollectionUtil.arrayL= ist(); + for (ServiceRegistration svc : serviceRegistrations) { + if (svc.matches(serviceType, groupName, endpointName)) { + final int metric =3D svc.getMetric(); + if (metric < bestMetric) { + candidates.clear(); + candidates.add(svc); + } else if (metric =3D=3D bestMetric) { + candidates.add(svc); + } + } + } + final int size =3D candidates.size(); + if (size =3D=3D 0) { + final FutureClientSource futureClientSource =3D new = FutureClientSource(); + final SimpleCloseable listenerHandle =3D addServiceListene= r(new ServiceListener() { + + public void localServiceCreated(final SimpleCloseable = listenerHandle, final String addedServiceType, final String addedGroupName,= final RequestHandlerSource requestHandlerSource) { + remoteServiceRegistered(listenerHandle, name, adde= dServiceType, addedGroupName, 0, requestHandlerSource, null); + } + + public void remoteServiceRegistered(final SimpleClosea= ble listenerHandle, final String addedEndpointName, final String addedServi= ceType, final String addedGroupName, final int metric, final RequestHandler= Source requestHandlerSource, final SimpleCloseable handle) { + if (endpointName !=3D null && endpointName.length(= ) > 0 && !endpointName.equals(addedEndpointName)) { + // no match + return; + } + if (serviceType !=3D null && serviceType.length() = > 0 && !serviceType.equals(addedServiceType)) { + // no match + return; + } + if (groupName !=3D null && groupName.length() > 0 = && !groupName.equals(addedGroupName)) { + // no match + return; + } + try { + // match! + final ClientSource clientSource =3D crea= teClientSource(requestHandlerSource); + futureClientSource.setResult(clientSource); + } catch (IOException e) { + futureClientSource.setException(e); + } finally { + IoUtils.safeClose(listenerHandle); + } + } + }, true); + futureClientSource.setListenerHandle(listenerHandle); + return futureClientSource; + } + final RequestHandlerSource handlerSource; + if (size =3D=3D 1) { + handlerSource =3D candidates.get(0).getHandlerSource(); + } else { + int idx =3D (int) ((double) candidates.size() * Math.rando= m()); + handlerSource =3D candidates.get(idx).getHandlerSource(); + } + try { + return new FinishedIoFuture>(EndpointImp= l.this.createClientSource(handlerSource)); + } catch (IOException e) { + return new FailedIoFuture>(e); + } + } + } + + public SimpleCloseable registerRemoteService(final String serviceType,= final String groupName, final String endpointName, final RequestHandlerSou= rce handlerSource, final int metric) throws IllegalArgumentException, IOExc= eption { + if (serviceType =3D=3D null) { + throw new NullPointerException("serviceType is null"); + } + if (groupName =3D=3D null) { + throw new NullPointerException("groupName is null"); + } + if (endpointName =3D=3D null) { + throw new NullPointerException("endpointName is null"); + } + if (serviceType.length() =3D=3D 0) { + throw new IllegalArgumentException("serviceType is empty"); + } + if (groupName.length() =3D=3D 0) { + throw new IllegalArgumentException("groupName is empty"); + } + if (endpointName.length() =3D=3D 0) { + throw new IllegalArgumentException("endpointName is empty"); + } + if (endpointName.equals(name)) { + throw new IllegalArgumentException("remote endpoint has the sa= me name as the local endpoint"); + } + if (metric < 1) { + throw new IllegalArgumentException("metric must be greater tha= n zero"); + } + final ServiceRegistration registration =3D new ServiceRegistration= (serviceType, groupName, endpointName, metric, handlerSource); + final AbstractSimpleCloseable newHandle =3D new AbstractSimpleClos= eable(executor) { + protected void closeAction() throws IOException { + synchronized (serviceLock) { + serviceRegistrations.remove(registration); + } + } + }; + registration.setHandle(newHandle); + synchronized (serviceLock) { + serviceRegistrations.add(registration); + for (final ServiceListenerRegistration slr : serviceListenerMa= p.values()) { + final ServiceListener listener =3D slr.getServiceListener(= ); + slr.getExecutor().execute(new Runnable() { + public void run() { + listener.remoteServiceRegistered(slr.handle, endpo= intName, serviceType, groupName, metric, handlerSource, newHandle); + } + }); + } + } + return newHandle; + } + + public SimpleCloseable addServiceListener(final ServiceListener servic= eListener, final boolean onlyNew) { + final Object key =3D new Object(); + synchronized (serviceLock) { + final Executor orderedExecutor =3D getOrderedExecutor(); + final ServiceListenerRegistration registration =3D new Service= ListenerRegistration(serviceListener, orderedExecutor); + serviceListenerMap.put(key, registration); + final AbstractSimpleCloseable handle =3D new AbstractSimpleClo= seable(executor) { + protected void closeAction() throws IOException { + synchronized (serviceLock) { + serviceListenerMap.remove(key); + } + } + }; + registration.setHandle(handle); + if (! onlyNew) { + for (final ServiceRegistration reg : serviceRegistrations)= { + if (reg.isRemote()) { // x is remote + orderedExecutor.execute(new Runnable() { + public void run() { + serviceListener.remoteServiceRegistered(ha= ndle, reg.getEndpointName(), reg.getServiceType(), reg.getGroupName(), reg.= getMetric(), reg.getHandlerSource(), reg.getHandle()); + } + }); + } else { // x is local + orderedExecutor.execute(new Runnable() { + public void run() { + serviceListener.localServiceCreated(handle= , reg.getServiceType(), reg.getGroupName(), reg.getHandlerSource()); + } + }); + } + } + } + return handle; + } + } + + private static final class ServiceListenerRegistration { + private final ServiceListener serviceListener; + private final Executor executor; + private volatile SimpleCloseable handle; + + private ServiceListenerRegistration(final ServiceListener serviceL= istener, final Executor executor) { + this.serviceListener =3D serviceListener; + this.executor =3D executor; + } + + ServiceListener getServiceListener() { + return serviceListener; + } + + Executor getExecutor() { + return executor; + } + + void setHandle(final SimpleCloseable handle) { + this.handle =3D handle; + } + } + private final ResourceRemover remover =3D new ResourceRemover(); = private final class ResourceRemover implements CloseHandler= { Added: remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/Future= ClientSource.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/FutureCli= entSource.java (rev 0) +++ remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/FutureCli= entSource.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -0,0 +1,55 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2008, 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.cx.remoting.core; + +import org.jboss.xnio.AbstractIoFuture; +import org.jboss.xnio.IoFuture; +import org.jboss.xnio.IoUtils; +import org.jboss.cx.remoting.ClientSource; +import org.jboss.cx.remoting.SimpleCloseable; +import java.io.IOException; + +/** + * + */ +public final class FutureClientSource extends AbstractIoFuture> { + + private volatile SimpleCloseable listenerHandle; + + protected boolean setException(final IOException exception) { + return super.setException(exception); + } + + protected boolean setResult(final ClientSource result) { + return super.setResult(result); + } + + public IoFuture> cancel() { + IoUtils.safeClose(listenerHandle); + return this; + } + + void setListenerHandle(final SimpleCloseable listenerHandle) { + this.listenerHandle =3D listenerHandle; + } +} Added: remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/Servic= eRegistration.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/ServiceRe= gistration.java (rev 0) +++ remoting3/trunk/core/src/main/java/org/jboss/cx/remoting/core/ServiceRe= gistration.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -0,0 +1,95 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2008, 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.cx.remoting.core; + +import org.jboss.cx.remoting.spi.remote.RequestHandlerSource; +import org.jboss.cx.remoting.SimpleCloseable; + +/** + * + */ +public final class ServiceRegistration { + private final boolean remote; + private final String serviceType; + private final String groupName; + private final String endpointName; + private final int metric; + private final RequestHandlerSource handlerSource; + private volatile SimpleCloseable handle; + + ServiceRegistration(final String serviceType, final String groupName, = final String endpointName, final int metric, final RequestHandlerSource han= dlerSource) { + remote =3D true; + this.serviceType =3D serviceType; + this.groupName =3D groupName; + this.endpointName =3D endpointName; + this.metric =3D metric; + this.handlerSource =3D handlerSource; + } + + ServiceRegistration(final String serviceType, final String groupName, = final String endpointName, final RequestHandlerSource handlerSource) { + remote =3D false; + metric =3D 0; + this.serviceType =3D serviceType; + this.groupName =3D groupName; + this.endpointName =3D endpointName; + this.handlerSource =3D handlerSource; + } + + public boolean matches(final String serviceType, final String groupNam= e, final String endpointName) { + return (serviceType =3D=3D null || serviceType.length() =3D=3D 0 = || serviceType.equals(this.serviceType)) && + (groupName =3D=3D null || groupName.length() =3D=3D 0 || g= roupName.equals(this.groupName)) && + (endpointName =3D=3D null || endpointName.length() =3D=3D = 0 || endpointName.equals(this.endpointName)); + } + + public boolean isRemote() { + return remote; + } + + public String getServiceType() { + return serviceType; + } + + public String getGroupName() { + return groupName; + } + + public String getEndpointName() { + return endpointName; + } + + public int getMetric() { + return metric; + } + + public RequestHandlerSource getHandlerSource() { + return handlerSource; + } + + public SimpleCloseable getHandle() { + return handle; + } + + void setHandle(final SimpleCloseable handle) { + this.handle =3D handle; + } +} Modified: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remotin= g/protocol/basic/AbstractConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/AbstractConnection.java 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/AbstractConnection.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -22,13 +22,13 @@ = package org.jboss.cx.remoting.protocol.basic; = -import org.jboss.cx.remoting.spi.AbstractCloseable; +import org.jboss.cx.remoting.spi.AbstractHandleableCloseable; import java.util.concurrent.Executor; = /** * */ -public abstract class AbstractConnection extends AbstractCloseable implements Connection { +public abstract class AbstractConnection extends AbstractHandleableCloseab= le implements Connection { /** * Basic constructor. * Modified: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remotin= g/protocol/basic/Connection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/Connection.java 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/Connection.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -24,12 +24,12 @@ = import org.jboss.cx.remoting.spi.remote.RequestHandlerSource; import org.jboss.cx.remoting.spi.remote.Handle; -import org.jboss.cx.remoting.Closeable; +import org.jboss.cx.remoting.HandleableCloseable; import org.jboss.cx.remoting.RemotingException; = /** * */ -public interface Connection extends Closeable { +public interface Connection extends HandleableCloseable { Handle getServiceForId(int id) throws RemotingEx= ception; } Modified: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remotin= g/protocol/basic/MessageType.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/MessageType.java 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/MessageType.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -33,11 +33,16 @@ public static final int CANCEL_REQUEST =3D 4; public static final int CANCEL_ACK =3D 5; public static final int REQUEST_FAILED =3D 6; - // Remote side called .close() on a forwarded RemoteClientEndpoint + // Remote side called .close() on a forwarded RequestHandler public static final int CLIENT_CLOSE =3D 7; - // Remote side called .close() on a forwarded RemoteClientEndpoint + // Remote side pulled a new RequestHandler off of a forwarded RequestH= andlerSource public static final int CLIENT_OPEN =3D 8; + // Remote side called .close() on a forwarded RequestHandlerSource public static final int SERVICE_CLOSE =3D 9; + // Remote side brought a new service online + public static final int SERVICE_ADVERTISE =3D 10; + // Remote side's service is no longer available + public static final int SERVICE_UNADVERTISE=3D 11; = private MessageType() { } Modified: remoting3/trunk/protocol/basic/src/test/java/org/jboss/cx/remotin= g/protocol/basic/ConnectionTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/test/java/org/jboss/cx/remoting/prot= ocol/basic/ConnectionTestCase.java 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/protocol/basic/src/test/java/org/jboss/cx/remoting/prot= ocol/basic/ConnectionTestCase.java 2008-08-05 02:59:58 UTC (rev 4463) @@ -93,7 +93,7 @@ problems.add(e); } } - }); + }, INIT_ME, INIT_ME); try { serviceRegistry.bind(requestHandlerSourceHandl= e.getResource(), 13); final IoHandlerFactory handlerFactory =3D BasicProtocol.createServer(closeableExecutor, allocato= r, serviceRegistry); Modified: remoting3/trunk/standalone/src/main/java/org/jboss/cx/remoting/Re= moting.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/standalone/src/main/java/org/jboss/cx/remoting/Remoting= .java 2008-08-04 04:21:46 UTC (rev 4462) +++ remoting3/trunk/standalone/src/main/java/org/jboss/cx/remoting/Remoting= .java 2008-08-05 02:59:58 UTC (rev 4463) @@ -42,7 +42,7 @@ } = public static ClientSource createLocalClientSource(Endpoi= nt endpoint, RequestListener requestListener) throws IOException { - final Handle handle =3D endpoint.createReque= stHandlerSource(requestListener); + final Handle handle =3D endpoint.createReque= stHandlerSource(requestListener, INIT_ME, INIT_ME); try { return endpoint.createClientSource(handle.getResource()); } finally { --===============8621564708833983135==-- From jboss-remoting-commits at lists.jboss.org Mon Aug 4 23:01:12 2008 Content-Type: multipart/mixed; boundary="===============0902850376596830193==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4464 - remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/protocol/basic. Date: Mon, 04 Aug 2008 23:01:12 -0400 Message-ID: --===============0902850376596830193== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: david.lloyd(a)jboss.com Date: 2008-08-04 23:01:12 -0400 (Mon, 04 Aug 2008) New Revision: 4464 Modified: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/proto= col/basic/BasicHandler.java Log: Fix compile error from exception type refactor Modified: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remotin= g/protocol/basic/BasicHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/BasicHandler.java 2008-08-05 02:59:58 UTC (rev 4463) +++ remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/BasicHandler.java 2008-08-05 03:01:12 UTC (rev 4464) @@ -52,7 +52,6 @@ import static org.jboss.cx.remoting.protocol.basic.MessageType.REQUEST_FAI= LED; import static org.jboss.cx.remoting.protocol.basic.MessageType.CANCEL_ACK; import static org.jboss.cx.remoting.protocol.basic.MessageType.VERSION; -import org.jboss.cx.remoting.RemotingException; import org.jboss.cx.remoting.CloseHandler; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.BlockingQueue; @@ -491,7 +490,7 @@ public void openClientForForwardedService(int id, RequestHandler clien= tEndpoint) { try { forwardedClients.put(Integer.valueOf(id), clientEndpoint.getHa= ndle()); - } catch (RemotingException e) { + } catch (IOException e) { // TODO fix e.printStackTrace(); } @@ -767,7 +766,7 @@ }); } = - public Handle createRequestHandler() throws Remoti= ngException { + public Handle createRequestHandler() throws IOExce= ption { final int clientId =3D openClientFromService(); final ByteBuffer buffer =3D allocator.allocate(); buffer.put((byte) MessageType.CLIENT_OPEN); --===============0902850376596830193==-- From jboss-remoting-commits at lists.jboss.org Mon Aug 4 23:03:08 2008 Content-Type: multipart/mixed; boundary="===============7993672875501881029==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4465 - in remoting3/trunk/protocol/basic/src: test/java/org/jboss/cx/remoting/protocol/basic and 1 other directory. Date: Mon, 04 Aug 2008 23:03:07 -0400 Message-ID: --===============7993672875501881029== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: david.lloyd(a)jboss.com Date: 2008-08-04 23:03:07 -0400 (Mon, 04 Aug 2008) New Revision: 4465 Modified: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/proto= col/basic/BasicProtocol.java remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/proto= col/basic/Connection.java remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/proto= col/basic/ServiceRegistry.java remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/proto= col/basic/ServiceRegistryImpl.java remoting3/trunk/protocol/basic/src/test/java/org/jboss/cx/remoting/proto= col/basic/ConnectionTestCase.java Log: More compile fixes Modified: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remotin= g/protocol/basic/BasicProtocol.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/BasicProtocol.java 2008-08-05 03:01:12 UTC (rev 4464) +++ remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/BasicProtocol.java 2008-08-05 03:03:07 UTC (rev 4465) @@ -79,7 +79,7 @@ return new AbstractConvertingIoFuture(futureChannel) { protected Connection convert(final AllocatedMessageChannel cha= nnel) throws RemotingException { return new AbstractConnection(executor) { - public Handle getServiceForId(fi= nal int id) throws RemotingException { + public Handle getServiceForId(fi= nal int id) throws IOException { return basicHandler.getRemoteService(id).getHandle= (); } }; Modified: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remotin= g/protocol/basic/Connection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/Connection.java 2008-08-05 03:01:12 UTC (rev 4464) +++ remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/Connection.java 2008-08-05 03:03:07 UTC (rev 4465) @@ -26,10 +26,11 @@ import org.jboss.cx.remoting.spi.remote.Handle; import org.jboss.cx.remoting.HandleableCloseable; import org.jboss.cx.remoting.RemotingException; +import java.io.IOException; = /** * */ public interface Connection extends HandleableCloseable { - Handle getServiceForId(int id) throws RemotingEx= ception; + Handle getServiceForId(int id) throws IOExceptio= n; } Modified: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remotin= g/protocol/basic/ServiceRegistry.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/ServiceRegistry.java 2008-08-05 03:01:12 UTC (rev 4464) +++ remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/ServiceRegistry.java 2008-08-05 03:03:07 UTC (rev 4465) @@ -25,18 +25,19 @@ import org.jboss.cx.remoting.spi.remote.RequestHandlerSource; import org.jboss.cx.remoting.spi.remote.Handle; import org.jboss.cx.remoting.RemotingException; +import java.io.IOException; = /** * */ public interface ServiceRegistry { - int bind(RequestHandlerSource requestHandlerSource) throws RemotingExc= eption; + int bind(RequestHandlerSource requestHandlerSource) throws IOException; = - void bind(RequestHandlerSource requestHandlerSource, int id) throws Re= motingException; + void bind(RequestHandlerSource requestHandlerSource, int id) throws IO= Exception; = void unbind(int id) throws RemotingException; = void clear(); = - Handle lookup(int id) throws RemotingException; + Handle lookup(int id) throws IOException; } Modified: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remotin= g/protocol/basic/ServiceRegistryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/ServiceRegistryImpl.java 2008-08-05 03:01:12 UTC (rev 4464) +++ remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/ServiceRegistryImpl.java 2008-08-05 03:03:07 UTC (rev 4465) @@ -30,6 +30,7 @@ import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicInteger; import java.util.Iterator; +import java.io.IOException; = /** * @@ -50,7 +51,7 @@ parent =3D null; } = - public int bind(final RequestHandlerSource requestHandlerSource) throw= s RemotingException { + public int bind(final RequestHandlerSource requestHandlerSource) throw= s IOException { final Handle handle =3D requestHandlerSource= .getHandle(); boolean ok =3D false; try { @@ -72,7 +73,7 @@ } } = - public void bind(final RequestHandlerSource requestHandlerSource, fina= l int id) throws RemotingException { + public void bind(final RequestHandlerSource requestHandlerSource, fina= l int id) throws IOException { final Handle handle =3D requestHandlerSource= .getHandle(); boolean ok =3D false; try { @@ -99,7 +100,7 @@ } } = - public Handle lookup(final int id) throws Remoti= ngException { + public Handle lookup(final int id) throws IOExce= ption { final Handle handle =3D map.get(Integer.valu= eOf(id)); return handle !=3D null || parent =3D=3D null ? handle.getResource= ().getHandle() : parent.lookup(id); } Modified: remoting3/trunk/protocol/basic/src/test/java/org/jboss/cx/remotin= g/protocol/basic/ConnectionTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/test/java/org/jboss/cx/remoting/prot= ocol/basic/ConnectionTestCase.java 2008-08-05 03:01:12 UTC (rev 4464) +++ remoting3/trunk/protocol/basic/src/test/java/org/jboss/cx/remoting/prot= ocol/basic/ConnectionTestCase.java 2008-08-05 03:03:07 UTC (rev 4465) @@ -30,6 +30,7 @@ import java.util.concurrent.TimeUnit; import java.net.InetSocketAddress; import java.io.Closeable; +import java.io.IOException; import junit.framework.TestCase; import org.jboss.cx.remoting.core.EndpointImpl; import org.jboss.cx.remoting.test.support.LoggingHelper; @@ -37,7 +38,6 @@ import org.jboss.cx.remoting.RemoteExecutionException; import org.jboss.cx.remoting.ClientSource; import org.jboss.cx.remoting.Client; -import org.jboss.cx.remoting.RemotingException; import org.jboss.cx.remoting.AbstractRequestListener; import org.jboss.cx.remoting.spi.remote.RequestHandlerSource; import org.jboss.cx.remoting.spi.remote.Handle; @@ -89,11 +89,11 @@ public void handleRequest(final RequestContext= context, final Object request) throws RemoteExecutionException { try { context.sendReply(REPLY); - } catch (RemotingException e) { + } catch (IOException e) { problems.add(e); } } - }, INIT_ME, INIT_ME); + }, null, null); try { serviceRegistry.bind(requestHandlerSourceHandl= e.getResource(), 13); final IoHandlerFactory handlerFactory =3D BasicProtocol.createServer(closeableExecutor, allocato= r, serviceRegistry); --===============7993672875501881029==-- From jboss-remoting-commits at lists.jboss.org Tue Aug 5 00:03:59 2008 Content-Type: multipart/mixed; boundary="===============8826738885175922657==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4466 - remoting2/branches/2.x/src/main/org/jboss/remoting/detection/multicast. Date: Tue, 05 Aug 2008 00:03:59 -0400 Message-ID: --===============8826738885175922657== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-05 00:03:59 -0400 (Tue, 05 Aug 2008) New Revision: 4466 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/detection/multicast/M= ulticastDetector.java Log: JBREM-991: If heartbeat() creates a null Detection, it returns instead of s= ending it. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/detection/mult= icast/MulticastDetector.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/detection/multicast/= MulticastDetector.java 2008-08-05 03:03:07 UTC (rev 4465) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/detection/multicast/= MulticastDetector.java 2008-08-05 04:03:59 UTC (rev 4466) @@ -230,6 +230,9 @@ if(socket !=3D null) { Detection msg =3D createDetection(); + if (msg =3D=3D null) + return; + = try { if(log.isTraceEnabled()) --===============8826738885175922657==-- From jboss-remoting-commits at lists.jboss.org Tue Aug 5 19:28:58 2008 Content-Type: multipart/mixed; boundary="===============1007037950627567280==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4467 - remoting2/branches/2.2/src/main/org/jboss/remoting/serialization/impl/java. Date: Tue, 05 Aug 2008 19:28:58 -0400 Message-ID: --===============1007037950627567280== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-05 19:28:58 -0400 (Tue, 05 Aug 2008) New Revision: 4467 Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/serialization/impl/ja= va/JavaSerializationManager.java Log: JBREM-1021: Reduced log level in receiveObjectVersion1_2() to DEBUG. Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/serialization/= impl/java/JavaSerializationManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.2/src/main/org/jboss/remoting/serialization/impl/j= ava/JavaSerializationManager.java 2008-08-05 04:03:59 UTC (rev 4466) +++ remoting2/branches/2.2/src/main/org/jboss/remoting/serialization/impl/j= ava/JavaSerializationManager.java 2008-08-05 23:28:58 UTC (rev 4467) @@ -27,7 +27,6 @@ import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; -import java.io.OptionalDataException; import java.io.OutputStream; import org.jboss.logging.Logger; import org.jboss.remoting.Version; @@ -181,7 +180,7 @@ } catch (IOException e) { - log.error("", e); + log.debug("", e); throw e; } = --===============1007037950627567280==-- From jboss-remoting-commits at lists.jboss.org Tue Aug 5 23:47:09 2008 Content-Type: multipart/mixed; boundary="===============2476719876007864342==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4468 - remoting2/branches/2.x/src/main/org/jboss/remoting. Date: Tue, 05 Aug 2008 23:47:08 -0400 Message-ID: --===============2476719876007864342== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-05 23:47:08 -0400 (Tue, 05 Aug 2008) New Revision: 4468 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvo= ker.java Log: JBREM-1019: Moved retrieval of parent first classloading parameter to new i= nit() method. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteCli= entInvoker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInv= oker.java 2008-08-05 23:28:58 UTC (rev 4467) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInv= oker.java 2008-08-06 03:47:08 UTC (rev 4468) @@ -45,17 +45,20 @@ private final Object clientLeaseLock =3D new Object(); private LeasePinger leasePinger =3D null; private String invokerSessionID =3D new GUID().toString(); + protected boolean parentFirstClassLoading =3D true; = protected List connectHomes; = public MicroRemoteClientInvoker(InvokerLocator locator) { super(locator); + init(); } = public MicroRemoteClientInvoker(InvokerLocator locator, Map configurati= on) { super(locator, configuration); + init(); } = /** @@ -117,19 +120,6 @@ // classes. If possible, will simply reset context classloader o= n existing // RemotingClassLoader. final ClassLoader contextClassLoader =3D SecurityUtility.getConte= xtClassLoader(Thread.currentThread()); - // Get the parent delegation order flag, default is parent first - Object flag =3D super.getConfiguration().get(Remoting.CLASSLOADIN= G_PARENT_FIRST_DELEGATION); - if(flag =3D=3D null) - { - // Fallback to the system property - flag =3D SecurityUtility.getSystemProperty(Remoting.CLASSLOADI= NG_PARENT_FIRST_DELEGATION_PROP); - } - boolean parentFirst =3D true; - if (flag !=3D null) - { - String sflag =3D flag.toString(); - parentFirst =3D Boolean.valueOf(sflag).booleanValue(); - } if (unmarshaller instanceof UpdateableClassloaderUnMarshaller) { UpdateableClassloaderUnMarshaller uclum =3D (UpdateableClasslo= aderUnMarshaller) unmarshaller; @@ -141,13 +131,13 @@ } else { - rcl =3D SecurityUtility.createRemotingClassLoader(getClassL= oader(), contextClassLoader, parentFirst); + rcl =3D SecurityUtility.createRemotingClassLoader(getClassL= oader(), contextClassLoader, parentFirstClassLoading); unmarshaller.setClassLoader(rcl); } } else { - rcl =3D SecurityUtility.createRemotingClassLoader(getClassLoad= er(), contextClassLoader, parentFirst); + rcl =3D SecurityUtility.createRemotingClassLoader(getClassLoad= er(), contextClassLoader, parentFirstClassLoading); unmarshaller.setClassLoader(rcl); = } } @@ -535,6 +525,24 @@ } return type; } + = + protected void init() + { + // Get the parent delegation order flag, default is parent first + Object flag =3D super.getConfiguration().get(Remoting.CLASSLOADING_P= ARENT_FIRST_DELEGATION); + if(flag =3D=3D null) + { + // Fallback to the system property + flag =3D SecurityUtility.getSystemProperty(Remoting.CLASSLOADING_= PARENT_FIRST_DELEGATION_PROP); + } + boolean parentFirst =3D true; + if (flag !=3D null) + { + String sflag =3D flag.toString(); + parentFirst =3D Boolean.valueOf(sflag).booleanValue(); + } + parentFirstClassLoading =3D parentFirst; + } = /** * Each implementation of the remote client invoker should have --===============2476719876007864342==-- From jboss-remoting-commits at lists.jboss.org Tue Aug 5 23:48:45 2008 Content-Type: multipart/mixed; boundary="===============3390342508011742312==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4469 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/classloader/parentfirst. Date: Tue, 05 Aug 2008 23:48:45 -0400 Message-ID: --===============3390342508011742312== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-05 23:48:45 -0400 (Tue, 05 Aug 2008) New Revision: 4469 Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/classloader/par= entfirst/ParentFirstClassloaderTestCase.java Log: JBREM-1019: (1) Added testByInvokerLocator(); (2) in testBySystemProperty()= , moved setting of system property to before client invoker is created. Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/classloa= der/parentfirst/ParentFirstClassloaderTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/classloader/pa= rentfirst/ParentFirstClassloaderTestCase.java 2008-08-06 03:47:08 UTC (rev = 4468) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/classloader/pa= rentfirst/ParentFirstClassloaderTestCase.java 2008-08-06 03:48:45 UTC (rev = 4469) @@ -130,6 +130,46 @@ /** * Verify that by the context classloader is called first if = * org.jboss.remoting.Remoting.CLASSLOADING_PARENT_FIRST_DELEGATION is = set to "true" + * in the InvokerLocator. + */ + public void testByInvokerLocator() throws Throwable + { + log.info("entering " + getName()); + = + // Start server. + setupServer(); + = + // Create client. + String clientLocatorURI =3D locatorURI; + clientLocatorURI +=3D "/?" + Remoting.CLASSLOADING_PARENT_FIRST_DELE= GATION + "=3Dfalse"; + InvokerLocator clientLocator =3D new InvokerLocator(clientLocatorURI= ); + HashMap clientConfig =3D new HashMap(); + clientConfig.put(InvokerLocator.FORCE_REMOTE, "true"); + addExtraClientConfig(clientConfig); + Client client =3D new Client(clientLocator, clientConfig); + client.connect(); + log.info("client is connected"); + = + TestClassLoader tcl =3D new TestClassLoader(); + setContextClassLoader(tcl); + = + // Test connection. + client.invoke("abc"); + log.info("connection is good"); + = + // Verify that TestClassLoader has been queried. + assertTrue(tcl.visited); + log.info("context classloader has been queried"); + = + client.disconnect(); + shutdownServer(); + log.info(getName() + " PASSES"); + } + = + = + /** + * Verify that by the context classloader is called first if = + * org.jboss.remoting.Remoting.CLASSLOADING_PARENT_FIRST_DELEGATION is = set to "true" * in the config map. */ public void testByConfigMap() throws Throwable @@ -183,11 +223,11 @@ HashMap clientConfig =3D new HashMap(); clientConfig.put(InvokerLocator.FORCE_REMOTE, "true"); addExtraClientConfig(clientConfig); + System.setProperty(Remoting.CLASSLOADING_PARENT_FIRST_DELEGATION_PRO= P, "false"); Client client =3D new Client(clientLocator, clientConfig); client.connect(); log.info("client is connected"); = - System.setProperty(Remoting.CLASSLOADING_PARENT_FIRST_DELEGATION_PRO= P, "false"); TestClassLoader tcl =3D new TestClassLoader(); setContextClassLoader(tcl); = --===============3390342508011742312==-- From jboss-remoting-commits at lists.jboss.org Wed Aug 6 02:24:21 2008 Content-Type: multipart/mixed; boundary="===============3541673663052631110==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4470 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http. Date: Wed, 06 Aug 2008 02:24:20 -0400 Message-ID: --===============3541673663052631110== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-06 02:24:20 -0400 (Wed, 06 Aug 2008) New Revision: 4470 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPCl= ientInvoker.java Log: JBREM-990: Changed calls to HttpURLConnection.getResponseCode() and getResp= onseMessage() to SecurityUtility calls. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http= /HTTPClientInvoker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPC= lientInvoker.java 2008-08-06 03:48:45 UTC (rev 4469) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPC= lientInvoker.java 2008-08-06 06:24:20 UTC (rev 4470) @@ -348,7 +348,8 @@ } } = - metadata.put(HTTPMetadataConstants.RESPONSE_CODE_MESSAGE, conn= .getResponseMessage()); + String responseMessage =3D SecurityUtility.getResponseMessage(= conn); + metadata.put(HTTPMetadataConstants.RESPONSE_CODE_MESSAGE, resp= onseMessage); metadata.put(HTTPMetadataConstants.RESPONSE_CODE, new Integer(= responseCode)); metadata.put(HTTPMetadataConstants.RESPONSE_HEADERS, headers); = @@ -372,7 +373,8 @@ metadata =3D new HashMap(); } metadata.putAll(headers); - metadata.put(HTTPMetadataConstants.RESPONSE_CODE_MESSAGE, conn= .getResponseMessage()); + String responseMessage =3D SecurityUtility.getResponseMessage(= conn); + metadata.put(HTTPMetadataConstants.RESPONSE_CODE_MESSAGE, resp= onseMessage); responseCode =3D SecurityUtility.getResponseCode(conn); metadata.put(HTTPMetadataConstants.RESPONSE_CODE, new Integer(= responseCode)); metadata.put(HTTPMetadataConstants.RESPONSE_HEADERS, conn.getH= eaderFields()); @@ -386,8 +388,8 @@ = try { - String responseMessage =3D conn.getResponseMessage(); - int code =3D conn.getResponseCode(); + String responseMessage =3D SecurityUtility.getResponseMessage(= conn); + int code =3D SecurityUtility.getResponseCode(conn); message +=3D " Response: " + responseMessage + "/" + code + ".= "; } catch (IOException e1) --===============3541673663052631110==-- From jboss-remoting-commits at lists.jboss.org Wed Aug 6 02:24:55 2008 Content-Type: multipart/mixed; boundary="===============3693785450351943942==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4471 - remoting2/branches/2.x/src/main/org/jboss/remoting/util. Date: Wed, 06 Aug 2008 02:24:55 -0400 Message-ID: --===============3693785450351943942== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-06 02:24:54 -0400 (Wed, 06 Aug 2008) New Revision: 4471 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/util/SecurityUtility.= java Log: JBREM-990: Added getResponseMessage(). Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/util/SecurityU= tility.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/util/SecurityUtility= .java 2008-08-06 06:24:20 UTC (rev 4470) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/util/SecurityUtility= .java 2008-08-06 06:24:54 UTC (rev 4471) @@ -1488,6 +1488,31 @@ } = = + static public String getResponseMessage(final HttpURLConnection conn) + throws IOException + { + if (skipAccessControl) + { + return conn.getResponseMessage(); + } + = + try + { + return (String) AccessController.doPrivileged( new PrivilegedExce= ptionAction() + { + public Object run() throws IOException + { + return conn.getResponseMessage(); + } + }); + } + catch (PrivilegedActionException e) + { + throw (IOException) e.getCause(); + } + } + = + = static public Object callTransport(final RMIServerInvokerInf server, fi= nal Object payload) throws IOException { --===============3693785450351943942==-- From jboss-remoting-commits at lists.jboss.org Wed Aug 6 03:02:04 2008 Content-Type: multipart/mixed; boundary="===============1010514411434199978==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4472 - remoting2/branches/2.x/docs/guide/en. Date: Wed, 06 Aug 2008 03:02:04 -0400 Message-ID: --===============1010514411434199978== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-06 03:02:03 -0400 (Wed, 06 Aug 2008) New Revision: 4472 Modified: remoting2/branches/2.x/docs/guide/en/chap9.xml Log: JBREM-1012: Updated discussion of configuring a server side ConnectionListe= ner. Modified: remoting2/branches/2.x/docs/guide/en/chap9.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/docs/guide/en/chap9.xml 2008-08-06 06:24:54 UTC = (rev 4471) +++ remoting2/branches/2.x/docs/guide/en/chap9.xml 2008-08-06 07:02:03 UTC = (rev 4472) @@ -94,11 +94,16 @@ = public void addConnectionListener(ConnectionListener l= istener) = - or though the use of the + or through the use of the ServerInvoker.CONNECTION_LISTENER parameter (actual value "connectionListener") in the Connector's - configuration map or XML configuration file. Once both criteria are me= t, the - remoting server will turn on client leasing. + configuration map, XML configuration file, or + ServerConfiguration POJO. If the + ServerInvoker.CONNECTION_LISTENER parameter is used, the = value + can be either a JMX object name or the fully qualified name of a class= that + implements ConnectionListener and has a default + constructor. Once both criteria are met, the remoting server will turn= on + client leasing. = The ConnectionListener will be notified of both client failures = and client disconnects via the handleConnectionException() method. If the = client --===============1010514411434199978==-- From jboss-remoting-commits at lists.jboss.org Thu Aug 7 19:00:23 2008 Content-Type: multipart/mixed; boundary="===============7300496062358510070==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4473 - remoting2/branches/2.x/src/main/org/jboss/remoting. Date: Thu, 07 Aug 2008 19:00:22 -0400 Message-ID: --===============7300496062358510070== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-07 19:00:22 -0400 (Thu, 07 Aug 2008) New Revision: 4473 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java Log: JBREM-1022: Fixed javadoc. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator= .java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java = 2008-08-06 07:02:03 UTC (rev 4472) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java = 2008-08-07 23:00:22 UTC (rev 4473) @@ -62,9 +62,11 @@ *

* rmi://localhost

*

- * NOTE: the hostname will automatically be resolved to the outside IP add= ress of the local machine - * if localhost or 127.0.0.1 is used as the hostname in = the URI. If it cannot be - * determined or resolved, it will use what was passed. + * NOTE: If no hostname is given (e.g., "socket://:5555"), then the hostna= me will + * automatically be resolved to the outside IP address of the local machin= e. = + * If the given hostname is 0.0.0.0 and the system + * property "jboss.bind.address" is set, then the hostname will be replace= d by the value + * associated with 'jboss.bind.address". * * @author Jeff Haynie * @author Tom Elrod --===============7300496062358510070==-- From jboss-remoting-commits at lists.jboss.org Thu Aug 7 19:00:51 2008 Content-Type: multipart/mixed; boundary="===============4345105635966196266==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4474 - remoting2/branches/2.2/src/main/org/jboss/remoting. Date: Thu, 07 Aug 2008 19:00:50 -0400 Message-ID: --===============4345105635966196266== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-07 19:00:50 -0400 (Thu, 07 Aug 2008) New Revision: 4474 Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/InvokerLocator.java Log: JBREM-1022: Fixed javadoc. Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/InvokerLocator= .java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.2/src/main/org/jboss/remoting/InvokerLocator.java = 2008-08-07 23:00:22 UTC (rev 4473) +++ remoting2/branches/2.2/src/main/org/jboss/remoting/InvokerLocator.java = 2008-08-07 23:00:50 UTC (rev 4474) @@ -58,9 +58,11 @@ *

* rmi://localhost

*

- * NOTE: the hostname will automatically be resolved to the outside IP add= ress of the local machine - * if localhost or 127.0.0.1 is used as the hostname in = the URI. If it cannot be - * determined or resolved, it will use what was passed. + * NOTE: If no hostname is given (e.g., "socket://:5555"), then the hostna= me will + * automatically be resolved to the outside IP address of the local machin= e. = + * If the given hostname is 0.0.0.0 and the system + * property "jboss.bind.address" is set, then the hostname will be replace= d by the value + * associated with 'jboss.bind.address". * * @author Jeff Haynie * @author Tom Elrod --===============4345105635966196266==-- From jboss-remoting-commits at lists.jboss.org Thu Aug 7 19:51:33 2008 Content-Type: multipart/mixed; boundary="===============1680949688963721981==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4475 - remoting2/branches/2.2/docs/guide/en. Date: Thu, 07 Aug 2008 19:51:33 -0400 Message-ID: --===============1680949688963721981== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-07 19:51:33 -0400 (Thu, 07 Aug 2008) New Revision: 4475 Modified: remoting2/branches/2.2/docs/guide/en/chap5.xml Log: JBREM-925: Disambiguated SSLSocketBuilder configuration table. Modified: remoting2/branches/2.2/docs/guide/en/chap5.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.2/docs/guide/en/chap5.xml 2008-08-07 23:00:50 UTC = (rev 4474) +++ remoting2/branches/2.2/docs/guide/en/chap5.xml 2008-08-07 23:51:33 UTC = (rev 4475) @@ -5107,7 +5107,13 @@ = The configuration properties for - SSLSocketBuilderare as follows: + SSLSocketBuilderare as follows. Note that in = the + "key name" column, the name in capital letters (e.g., + REMOTING_CLIENT_AUTH_MODE) is a handy constant in the + SSLSocketBuilder class with the value given in + parentheses (e.g. "org.jboss.remoting.clientAuthMode"). It is the la= tter + that should be used for declarative configuration in, for example, M= Bean + descriptors. = <classname>SSLSocketBuilder</classname> configuration @@ -5142,7 +5148,7 @@ <row> <entry><para>ClientAuthMode</para></entry> = - <entry><para>REMOTING_CLIENT_AUTH_MODE</para></entry> + <entry><para>REMOTING_CLIENT_AUTH_MODE ("org.jboss.remoting.= clientAuthMode")</para></entry> = <entry><para>String</para></entry> = @@ -5157,7 +5163,7 @@ <row> <entry><para>KeyAlias</para></entry> = - <entry><para>REMOTING_KEY_ALIAS</para></entry> + <entry><para>REMOTING_KEY_ALIAS ("org.jboss.remoting.keyAlia= s")</para></entry> = <entry><para>String</para></entry> = @@ -5170,7 +5176,7 @@ <row> <entry><para>KeyPassword</para></entry> = - <entry><para>REMOTING_KEY_PASSWORD</para></entry> + <entry><para>REMOTING_KEY_PASSWORD ("org.jboss.remoting.keyP= assword")</para></entry> = <entry><para>String</para></entry> = @@ -5187,7 +5193,7 @@ <row> <entry><para>KeyStoreAlgorithm</para></entry> = - <entry><para>REMOTING_KEY_STORE_ALGORITHM</para></entry> + <entry><para>REMOTING_KEY_STORE_ALGORITHM ("org.jboss.remoti= ng.keyStoreAlgorithm")</para></entry> = <entry><para>String</para></entry> = @@ -5200,7 +5206,7 @@ <row> <entry><para>KeyStorePassword</para></entry> = - <entry><para>REMOTING_KEY_STORE_PASSWORD</para></entry> + <entry><para>REMOTING_KEY_STORE_PASSWORD ("org.jboss.remotin= g.keyStorePassword")</para></entry> = <entry><para>String</para></entry> = @@ -5217,7 +5223,7 @@ <row> <entry><para>KeyStoreType</para></entry> = - <entry><para>REMOTING_KEY_STORE_TYPE</para></entry> + <entry><para>REMOTING_KEY_STORE_TYPE ("org.jboss.remoting.ke= yStoreType")</para></entry> = <entry><para>String</para></entry> = @@ -5234,7 +5240,7 @@ <row> <entry><para>KeyStoreURL</para></entry> = - <entry><para>REMOTING_KEY_STORE_FILE_PATH</para></entry> + <entry><para>REMOTING_KEY_STORE_FILE_PATH ("org.jboss.remoti= ng.keyStore")</para></entry> = <entry><para>String</para></entry> = @@ -5263,7 +5269,7 @@ <row> <entry><para>ProviderName</para></entry> = - <entry><para>REMOTING_SSL_PROVIDER_NAME</para></entry> + <entry><para>REMOTING_SSL_PROVIDER_NAME ("org.jboss.remoting= .sslProviderName")</para></entry> = <entry><para>String</para></entry> = @@ -5288,7 +5294,7 @@ <row> <entry><para>SecureSocketProtocol</para></entry> = - <entry><para>REMOTING_SSL_PROTOCOL</para></entry> + <entry><para>REMOTING_SSL_PROTOCOL ("org.jboss.remoting.sslP= rotocol")</para></entry> = <entry><para>String</para></entry> = @@ -5302,7 +5308,7 @@ <row> <entry><para>ServerAuthMode</para></entry> = - <entry><para>REMOTING_SERVER_AUTH_MODE</para></entry> + <entry><para>REMOTING_SERVER_AUTH_MODE ("org.jboss.remoting.= serverAuthMode")</para></entry> = <entry><para>boolean/String</para></entry> = @@ -5316,7 +5322,7 @@ <row> <entry><para>ServerSocketUseClientMode</para></entry> = - <entry><para>REMOTING_SERVER_SOCKET_USE_CLIENT_MODE</para></= entry> + <entry><para>REMOTING_SERVER_SOCKET_USE_CLIENT_MODE ("org.jb= oss.remoting.serversocket.useClientMode")</para></entry> = <entry><para>boolean/String</para></entry> = @@ -5329,7 +5335,7 @@ <row> <entry><para>SocketUseClientMode</para></entry> = - <entry><para>REMOTING_SOCKET_USE_CLIENT_MODE</para></entry> + <entry><para>REMOTING_SOCKET_USE_CLIENT_MODE ("org.jboss.rem= oting.socket.useClientMode")</para></entry> = <entry><para>boolean/String</para></entry> = @@ -5342,7 +5348,7 @@ <row> <entry><para>TrustStoreAlgorithm</para></entry> = - <entry><para>REMOTING_TRUST_STORE_ALGORITHM</para></entry> + <entry><para>REMOTING_TRUST_STORE_ALGORITHM ("org.jboss.remo= ting.trustStoreAlgorithm")</para></entry> = <entry><para>String</para></entry> = @@ -5355,7 +5361,7 @@ <row> <entry><para>TrustStorePassword</para></entry> = - <entry><para>REMOTING_TRUST_STORE_PASSWORD</para></entry> + <entry><para>REMOTING_TRUST_STORE_PASSWORD ("org.jboss.remot= ing.trustStorePassword")</para></entry> = <entry><para>String</para></entry> = @@ -5367,7 +5373,7 @@ <row> <entry><para>TrustStoreType</para></entry> = - <entry><para>REMOTING_TRUST_STORE_TYPE</para></entry> + <entry><para>REMOTING_TRUST_STORE_TYPE ("org.jboss.remoting.= trustStoreType")</para></entry> = <entry><para>String</para></entry> = @@ -5380,7 +5386,7 @@ <row> <entry><para>TrustStoreURL</para></entry> = - <entry><para>REMOTING_TRUST_STORE_FILE_PATH</para></entry> + <entry><para>REMOTING_TRUST_STORE_FILE_PATH ("org.jboss.remo= ting.trustStore")</para></entry> = <entry><para>String</para></entry> = --===============1680949688963721981==-- From jboss-remoting-commits at lists.jboss.org Thu Aug 7 19:52:28 2008 Content-Type: multipart/mixed; boundary="===============6929511196720216271==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4476 - remoting2/branches/2.x/docs/guide/en. Date: Thu, 07 Aug 2008 19:52:28 -0400 Message-ID: <E1KRFHQ-0001jM-Dw@committer01.frg.pub.inap.atl.jboss.com> --===============6929511196720216271== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-07 19:52:28 -0400 (Thu, 07 Aug 2008) New Revision: 4476 Modified: remoting2/branches/2.x/docs/guide/en/chap5.xml Log: JBREM-925: Disambiguated SSLSocketBuilder configuration table. Modified: remoting2/branches/2.x/docs/guide/en/chap5.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/docs/guide/en/chap5.xml 2008-08-07 23:51:33 UTC = (rev 4475) +++ remoting2/branches/2.x/docs/guide/en/chap5.xml 2008-08-07 23:52:28 UTC = (rev 4476) @@ -4657,7 +4657,13 @@ </orderedlist> = <para>The configuration properties for - <classname>SSLSocketBuilder</classname>are as follows:</para> + <classname>SSLSocketBuilder</classname>are as follows. Note that in = the + "key name" column, the name in capital letters (e.g., + REMOTING_CLIENT_AUTH_MODE) is a handy constant in the + <classname>SSLSocketBuilder</classname> class with the value given in + parentheses (e.g. "org.jboss.remoting.clientAuthMode"). It is the la= tter + that should be used for declarative configuration in, for example, M= Bean + descriptors.</para> = <table frame=3D"all" id=3D"SSLSocketBuilderTable" xreflabel=3D"Table= 1"> <title><classname>SSLSocketBuilder</classname> configuration @@ -4692,7 +4698,7 @@ <row> <entry><para>ClientAuthMode</para></entry> = - <entry><para>REMOTING_CLIENT_AUTH_MODE</para></entry> + <entry><para>REMOTING_CLIENT_AUTH_MODE ("org.jboss.remoting.= clientAuthMode")</para></entry> = <entry><para>String</para></entry> = @@ -4707,8 +4713,8 @@ <row> <entry><para>KeyAlias</para></entry> = - <entry><para>REMOTING_KEY_ALIAS</para></entry> - + <entry><para>REMOTING_KEY_ALIAS ("org.jboss.remoting.keyAlia= s")</para></entry> + = <entry><para>String</para></entry> = <entry><para></para></entry> @@ -4720,7 +4726,7 @@ <row> <entry><para>KeyPassword</para></entry> = - <entry><para>REMOTING_KEY_PASSWORD</para></entry> + <entry><para>REMOTING_KEY_PASSWORD ("org.jboss.remoting.keyP= assword")</para></entry> = <entry><para>String</para></entry> = @@ -4737,7 +4743,7 @@ <row> <entry><para>KeyStoreAlgorithm</para></entry> = - <entry><para>REMOTING_KEY_STORE_ALGORITHM</para></entry> + <entry><para>REMOTING_KEY_STORE_ALGORITHM ("org.jboss.remoti= ng.keyStoreAlgorithm")</para></entry> = <entry><para>String</para></entry> = @@ -4750,7 +4756,7 @@ <row> <entry><para>KeyStorePassword</para></entry> = - <entry><para>REMOTING_KEY_STORE_PASSWORD</para></entry> + <entry><para>REMOTING_KEY_STORE_PASSWORD ("org.jboss.remotin= g.keyStorePassword")</para></entry> = <entry><para>String</para></entry> = @@ -4767,7 +4773,7 @@ <row> <entry><para>KeyStoreType</para></entry> = - <entry><para>REMOTING_KEY_STORE_TYPE</para></entry> + <entry><para>REMOTING_KEY_STORE_TYPE ("org.jboss.remoting.ke= yStoreType")</para></entry> = <entry><para>String</para></entry> = @@ -4784,7 +4790,7 @@ <row> <entry><para>KeyStoreURL</para></entry> = - <entry><para>REMOTING_KEY_STORE_FILE_PATH</para></entry> + <entry><para>REMOTING_KEY_STORE_FILE_PATH ("org.jboss.remoti= ng.keyStore")</para></entry> = <entry><para>String</para></entry> = @@ -4813,7 +4819,7 @@ <row> <entry><para>ProviderName</para></entry> = - <entry><para>REMOTING_SSL_PROVIDER_NAME</para></entry> + <entry><para>REMOTING_SSL_PROVIDER_NAME ("org.jboss.remoting= .sslProviderName")</para></entry> = <entry><para>String</para></entry> = @@ -4838,7 +4844,7 @@ <row> <entry><para>SecureSocketProtocol</para></entry> = - <entry><para>REMOTING_SSL_PROTOCOL</para></entry> + <entry><para>REMOTING_SSL_PROTOCOL ("org.jboss.remoting.sslP= rotocol")</para></entry> = <entry><para>String</para></entry> = @@ -4852,7 +4858,7 @@ <row> <entry><para>ServerAuthMode</para></entry> = - <entry><para>REMOTING_SERVER_AUTH_MODE</para></entry> + <entry><para>REMOTING_SERVER_AUTH_MODE ("org.jboss.remoting.= serverAuthMode")</para></entry> = <entry><para>boolean/String</para></entry> = @@ -4866,7 +4872,7 @@ <row> <entry><para>ServerSocketUseClientMode</para></entry> = - <entry><para>REMOTING_SERVER_SOCKET_USE_CLIENT_MODE</para></= entry> + <entry><para>REMOTING_SERVER_SOCKET_USE_CLIENT_MODE ("org.jb= oss.remoting.serversocket.useClientMode")</para></entry> = <entry><para>boolean/String</para></entry> = @@ -4879,7 +4885,7 @@ <row> <entry><para>SocketUseClientMode</para></entry> = - <entry><para>REMOTING_SOCKET_USE_CLIENT_MODE</para></entry> + <entry><para>REMOTING_SOCKET_USE_CLIENT_MODE ("org.jboss.rem= oting.socket.useClientMode")</para></entry> = <entry><para>boolean/String</para></entry> = @@ -4892,7 +4898,7 @@ <row> <entry><para>TrustStoreAlgorithm</para></entry> = - <entry><para>REMOTING_TRUST_STORE_ALGORITHM</para></entry> + <entry><para>REMOTING_TRUST_STORE_ALGORITHM ("org.jboss.remo= ting.trustStoreAlgorithm")</para></entry> = <entry><para>String</para></entry> = @@ -4905,7 +4911,7 @@ <row> <entry><para>TrustStorePassword</para></entry> = - <entry><para>REMOTING_TRUST_STORE_PASSWORD</para></entry> + <entry><para>REMOTING_TRUST_STORE_PASSWORD ("org.jboss.remot= ing.trustStorePassword")</para></entry> = <entry><para>String</para></entry> = @@ -4917,7 +4923,7 @@ <row> <entry><para>TrustStoreType</para></entry> = - <entry><para>REMOTING_TRUST_STORE_TYPE</para></entry> + <entry><para>REMOTING_TRUST_STORE_TYPE ("org.jboss.remoting.= trustStoreType")</para></entry> = <entry><para>String</para></entry> = @@ -4930,7 +4936,7 @@ <row> <entry><para>TrustStoreURL</para></entry> = - <entry><para>REMOTING_TRUST_STORE_FILE_PATH</para></entry> + <entry><para>REMOTING_TRUST_STORE_FILE_PATH ("org.jboss.remo= ting.trustStore")</para></entry> = <entry><para>String</para></entry> = --===============6929511196720216271==-- From jboss-remoting-commits at lists.jboss.org Fri Aug 8 01:27:13 2008 Content-Type: multipart/mixed; boundary="===============4443456540617317818==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4477 - remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/http. Date: Fri, 08 Aug 2008 01:27:13 -0400 Message-ID: <E1KRKVN-0008Mn-3X@committer01.frg.pub.inap.atl.jboss.com> --===============4443456540617317818== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-08 01:27:12 -0400 (Fri, 08 Aug 2008) New Revision: 4477 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/http/HTTPUnMa= rshaller.java Log: JBREM-1006: read() checks for transfer-encoding=3Dchunked, and, if so, does= n't apply byteOutputStream.size() > contentLength test while reading from i= nputStream. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/http/H= TTPUnMarshaller.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/http/HTTPUnM= arshaller.java 2008-08-07 23:52:28 UTC (rev 4476) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/http/HTTPUnM= arshaller.java 2008-08-08 05:27:12 UTC (rev 4477) @@ -82,6 +82,7 @@ byte[] byteBuffer =3D new byte[bufferSize]; ByteArrayOutputStream byteOutputStream =3D new ByteArrayOutputStream= (); boolean preserveLines =3D false; + boolean isChunked =3D false; = // check the metadat to see if is entry for content length if(metadata !=3D null) @@ -126,6 +127,12 @@ preserveLines =3D Boolean.valueOf((String) value).booleanVa= lue(); } } + = + value =3D metadata.get("transfer-encoding"); + if (value instanceof String && "chunked".equalsIgnoreCase((String= )value)) + { + isChunked =3D true; + } } = int pointer =3D 0; @@ -133,7 +140,7 @@ while(amtRead > 0) { byteOutputStream.write(byteBuffer, pointer, amtRead); - if(amtRead < bufferSize && byteOutputStream.size() >=3D contentLe= ngth) + if(!isChunked && (amtRead < bufferSize && byteOutputStream.size()= >=3D contentLength)) { //done reading, so process break; --===============4443456540617317818==-- From jboss-remoting-commits at lists.jboss.org Fri Aug 8 01:30:51 2008 Content-Type: multipart/mixed; boundary="===============8776205594631274121==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4478 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/chunked. Date: Fri, 08 Aug 2008 01:30:51 -0400 Message-ID: <E1KRKYt-00013r-10@committer01.frg.pub.inap.atl.jboss.com> --===============8776205594631274121== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-08 01:30:50 -0400 (Fri, 08 Aug 2008) New Revision: 4478 Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/= chunked/ChunkedUnmarshallingTestCase.java Log: JBREM-1006: New unit test. Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/h= ttp/chunked/ChunkedUnmarshallingTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http= /chunked/ChunkedUnmarshallingTestCase.java (rev 0) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http= /chunked/ChunkedUnmarshallingTestCase.java 2008-08-08 05:30:50 UTC (rev 447= 8) @@ -0,0 +1,187 @@ +/* +* 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.transport.http.chunked; + +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.ServerInvocationHandler; +import org.jboss.remoting.ServerInvoker; +import org.jboss.remoting.callback.Callback; +import org.jboss.remoting.callback.HandleCallbackException; +import org.jboss.remoting.callback.InvokerCallbackHandler; +import org.jboss.remoting.transport.Connector; +import org.jboss.remoting.transport.PortUtil; + + +/** + * Unit test for JBREM-1006. + * = + * @author <a href=3D"ron.sigal(a)jboss.com">Ron Sigal</a> + * @version $Revision: 1.1 $ + * <p> + * Copyright Aug 8, 2008 + * </p> + */ +public class ChunkedUnmarshallingTestCase extends TestCase +{ + private static Logger log =3D Logger.getLogger(ChunkedUnmarshallingTest= Case.class); + = + private static boolean firstTime =3D 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 =3D false; + Logger.getLogger("org.jboss.remoting").setLevel(XLevel.INFO); + Logger.getLogger("org.jboss.test.remoting").setLevel(Level.INFO); + String pattern =3D "[%d{ABSOLUTE}] [%t] %5p (%F:%L) - %m%n"; + PatternLayout layout =3D new PatternLayout(pattern); + ConsoleAppender consoleAppender =3D new ConsoleAppender(layout); + Logger.getRootLogger().addAppender(consoleAppender); = + } + } + + = + public void tearDown() + { + } + = + = + public void testChunkedTransmission() throws Throwable + { + log.info("entering " + getName()); + = + // Start server. + setupServer(); + = + // Create client. + InvokerLocator clientLocator =3D new InvokerLocator(locatorURI); + HashMap clientConfig =3D new HashMap(); + clientConfig.put(InvokerLocator.FORCE_REMOTE, "true"); + addExtraClientConfig(clientConfig); + Client client =3D new Client(clientLocator, clientConfig); + client.connect(); + log.info("client is connected"); + = + // Test connections. + HashMap metadata =3D new HashMap(); + metadata.put(Client.RAW, "true"); + String message =3D "abcdefghijklmnopqrstuvwxyz"; + assertEquals(message, client.invoke(message, metadata)); + log.info("connection is good"); + assertTrue(invocationHandler.isChunked); + log.info("invocation was sent chunked"); + = + client.disconnect(); + shutdownServer(); + log.info(getName() + " PASSES"); + } + = + = + protected String getTransport() + { + return "http"; + } + = + = + protected void addExtraClientConfig(Map config) {} + protected void addExtraServerConfig(Map config) {} + = + + protected void setupServer() throws Exception + { + host =3D InetAddress.getLocalHost().getHostAddress(); + port =3D PortUtil.findFreePort(host); + locatorURI =3D getTransport() + "://" + host + ":" + port; + locatorURI +=3D "/?chunkedLength=3D10"; + serverLocator =3D new InvokerLocator(locatorURI); + log.info("Starting remoting server with locator uri of: " + locatorU= RI); + HashMap config =3D new HashMap(); + config.put(InvokerLocator.FORCE_REMOTE, "true"); + addExtraServerConfig(config); + connector =3D new Connector(serverLocator, config); + connector.create(); + invocationHandler =3D new TestInvocationHandler(); + connector.addInvocationHandler("test", invocationHandler); + connector.start(); + } + = + = + protected void shutdownServer() throws Exception + { + if (connector !=3D null) + connector.stop(); + } + = + = + static class TestInvocationHandler implements ServerInvocationHandler + { + boolean isChunked; + = + public void addListener(InvokerCallbackHandler callbackHandler) {} + public Object invoke(final InvocationRequest invocation) throws Thro= wable + { + Map requestMap =3D invocation.getRequestPayload(); + if (requestMap !=3D null) + { + String transferEncoding =3D (String) requestMap.get("transfer-= encoding"); + isChunked =3D "chunked".equalsIgnoreCase(transferEncoding); + } + return invocation.getParameter(); + } + public void removeListener(InvokerCallbackHandler callbackHandler) {} + public void setMBeanServer(MBeanServer server) {} + public void setInvoker(ServerInvoker invoker) {} + } + = + = + static class TestCallbackHandler implements InvokerCallbackHandler + { + public void handleCallback(Callback callback) throws HandleCallbackE= xception + { + log.info("received callback"); + } = + } +} \ No newline at end of file --===============8776205594631274121==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 9 03:59:47 2008 Content-Type: multipart/mixed; boundary="===============0161300813493712445==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4479 - remoting2/branches/2.x/src/main/org/jboss/remoting. Date: Sat, 09 Aug 2008 03:59:47 -0400 Message-ID: <E1KRjMZ-00043Y-NB@committer01.frg.pub.inap.atl.jboss.com> --===============0161300813493712445== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-09 03:59:47 -0400 (Sat, 09 Aug 2008) New Revision: 4479 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/Remoting.java Log: JBREM-1000: Added REMOTE_CLASS_LOADERS. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/Remoting.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/Remoting.java 2008-0= 8-08 05:30:50 UTC (rev 4478) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/Remoting.java 2008-0= 8-09 07:59:47 UTC (rev 4479) @@ -88,4 +88,10 @@ */ public static final String CLASSLOADING_PARENT_FIRST_DELEGATION =3D "cl= assloadingParentFirstDelegation"; public static final String CLASSLOADING_PARENT_FIRST_DELEGATION_PROP = =3D "org.jboss.remoting.classloadingParentFirstDelegation"; + + /** + * Key for injecting into Connector a list of classloaders for remote + * classloading facility. + */ + public static final String REMOTE_CLASS_LOADERS =3D "remoteClassLoaders= "; } --===============0161300813493712445==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 9 04:01:20 2008 Content-Type: multipart/mixed; boundary="===============8010104293821564714==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4480 - remoting2/branches/2.x/src/main/org/jboss/remoting/marshal. Date: Sat, 09 Aug 2008 04:01:20 -0400 Message-ID: <E1KRjO4-0005AT-6f@committer01.frg.pub.inap.atl.jboss.com> --===============8010104293821564714== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-09 04:01:20 -0400 (Sat, 09 Aug 2008) New Revision: 4480 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshallerLoa= derHandler.java Log: JBREM-1000: Replaced class repositories with classloaders. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/Marsha= llerLoaderHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshallerLo= aderHandler.java 2008-08-09 07:59:47 UTC (rev 4479) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshallerLo= aderHandler.java 2008-08-09 08:01:20 UTC (rev 4480) @@ -53,13 +53,13 @@ { private ServerInvoker invoker =3D null; private MBeanServer server =3D null; - private List repositories; + private List classLoaders; = protected final static Logger log =3D Logger.getLogger(MarshallerLoader= Handler.class); = - public MarshallerLoaderHandler(List repositories) + public MarshallerLoaderHandler(List classLoaders) { - this.repositories =3D repositories; + this.classLoaders =3D classLoaders; } = /** @@ -173,31 +173,18 @@ { byte[] classDefinition =3D ClassUtil.getClassBytes(className, cla= ssLoader); = - if (classDefinition =3D=3D null && repositories !=3D null) + if (classDefinition =3D=3D null && classLoaders !=3D null) { - Iterator it =3D repositories.iterator(); + Iterator it =3D classLoaders.iterator(); while (it.hasNext()) { - ObjectName name =3D (ObjectName) it.next(); - log.debug("searching repository " + name); - = - try + ClassLoader cl =3D (ClassLoader) it.next(); + log.debug("trying classLoader " + cl); + classDefinition =3D ClassUtil.getClassBytes(className, cl); + if (classDefinition !=3D null) { - Object o =3D server.getAttribute(name, "Instance"); - LoaderRepository repository =3D (LoaderRepository) o; - Class c =3D repository.getCachedClass(className); - if (c =3D=3D null) - { - continue; - } - log.debug("found class in repository " + name); - RepositoryClassLoader cl =3D (RepositoryClassLoader) c.g= etClassLoader(); - classDefinition =3D loadByteCode(cl, className); + break; } - catch (Exception e) - { - log.debug("unable to get class from " + name + ": " + e.= getMessage(), e); - } } } = --===============8010104293821564714==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 9 04:01:58 2008 Content-Type: multipart/mixed; boundary="===============2202932522346055903==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4481 - remoting2/branches/2.x/src/main/org/jboss/remoting/marshal. Date: Sat, 09 Aug 2008 04:01:58 -0400 Message-ID: <E1KRjOg-0005CW-Iv@committer01.frg.pub.inap.atl.jboss.com> --===============2202932522346055903== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-09 04:01:58 -0400 (Sat, 09 Aug 2008) New Revision: 4481 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshallLoade= rFactory.java Log: JBREM-1000: Replaced class repositories with classloaders. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/Marsha= llLoaderFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshallLoad= erFactory.java 2008-08-09 08:01:20 UTC (rev 4480) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshallLoad= erFactory.java 2008-08-09 08:01:58 UTC (rev 4481) @@ -47,11 +47,11 @@ * listen on. Will return null if can not create the connector. * * @param locator - * @param repositories + * @param classLoaders * @param mbeanServer * @return */ - public static Connector createMarshallLoader(InvokerLocator locator, Li= st repositories, MBeanServer mbeanServer) + public static Connector createMarshallLoader(InvokerLocator locator, Li= st classLoaders, MBeanServer mbeanServer) { Connector marshallerConnector =3D null; try @@ -60,7 +60,7 @@ marshallerConnector.setInvokerLocator(locator.getLocatorURI()); marshallerConnector.start(); = - MarshallerLoaderHandler loader =3D new MarshallerLoaderHandler(re= positories); + MarshallerLoaderHandler loader =3D new MarshallerLoaderHandler(cl= assLoaders); marshallerConnector.addInvocationHandler("loader", loader); = // Set after Connector.addInvocationHandler(), which also sets MB= eanServer. --===============2202932522346055903==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 9 04:06:05 2008 Content-Type: multipart/mixed; boundary="===============4059263281346786701==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4482 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport. Date: Sat, 09 Aug 2008 04:06:04 -0400 Message-ID: <E1KRjSe-0006Ya-Dg@committer01.frg.pub.inap.atl.jboss.com> --===============4059263281346786701== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-09 04:06:04 -0400 (Sat, 09 Aug 2008) New Revision: 4482 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Connector.j= ava Log: JBREM-1000: Replaced class repositories with classloaders. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Conn= ector.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Connector.= java 2008-08-09 08:01:58 UTC (rev 4481) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Connector.= java 2008-08-09 08:06:04 UTC (rev 4482) @@ -26,6 +26,7 @@ import org.jboss.remoting.ConnectionListener; import org.jboss.remoting.InvokerLocator; import org.jboss.remoting.InvokerRegistry; +import org.jboss.remoting.Remoting; import org.jboss.remoting.ServerConfiguration; import org.jboss.remoting.ServerInvocationHandler; import org.jboss.remoting.ServerInvocationHandlerWrapper; @@ -141,6 +142,7 @@ = private Connector marshallerLoaderConnector =3D null; private boolean isMarshallerLoader =3D false; + private List remoteClassLoaders; = private boolean isStarted =3D false; private boolean isCreated =3D false; @@ -471,6 +473,18 @@ // keep the local cache in synch locatorURI =3D invoker.getLocator().getLocatorURI(); = + if (remoteClassLoaders =3D=3D null) + { + Object o =3D configuration.get(Remoting.REMOTE_CLASS_LOADERS); + if (o instanceof List) + { + setRemoteClassLoaders((List) o); + } + else + { + log.warn("value of " + Remoting.REMOTE_CLASS_LOADERS + " must = be a List"); + } + } = if (!isMarshallerLoader) { @@ -508,8 +522,7 @@ // if loaderLocator is null, then probably not defined to have loade= r service (i.e. no loader port specified) if (loaderLocator !=3D null) { - List repositories =3D getLoaderRepositories(); - marshallerLoader =3D MarshallLoaderFactory.createMarshallLoader(l= oaderLocator, repositories, server); + marshallerLoader =3D MarshallLoaderFactory.createMarshallLoader(l= oaderLocator, remoteClassLoaders, server); } return marshallerLoader; } @@ -973,41 +986,6 @@ } } = - private List getLoaderRepositories() - { - if (xml =3D=3D null) - { - return null; - } - - NodeList repositoryNodes =3D xml.getElementsByTagName("repository"); - if (repositoryNodes.getLength() =3D=3D 0) - { - return null; - } - = - List repositories =3D new ArrayList(); - for (int i =3D 0; i < repositoryNodes.getLength(); i++) - { - Node node =3D repositoryNodes.item(i); - String repositoryName =3D node.getFirstChild().getNodeValue(); - - try - { - ObjectName objName =3D new ObjectName(repositoryName); - repositories.add(objName); - log.info("repository: " + repositoryName); - } - catch (MalformedObjectNameException e) - { - log.debug("repository name is not an object name: " + reposito= ryName); - continue; - } - } - = - return repositories; - } - = private ServerInvocationHandler createHandlerProxy(ObjectName objName) { ServerInvocationHandler handler; @@ -1459,4 +1437,17 @@ { this.serverConfiguration =3D serverConfig; } + = + public void setRemoteClassLoaders(List classLoaders) + { + if (classLoaders =3D=3D null) + return; + + SecurityManager sm =3D System.getSecurityManager(); + if (sm !=3D null) + { + sm.checkPermission(new RuntimePermission("setContextClassLoader")= ); + } + this.remoteClassLoaders =3D classLoaders; + } } --===============4059263281346786701==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 9 04:07:44 2008 Content-Type: multipart/mixed; boundary="===============6369963692846233996==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4483 - remoting2/branches/2.x/src/etc. Date: Sat, 09 Aug 2008 04:07:43 -0400 Message-ID: <E1KRjUF-0006dU-SC@committer01.frg.pub.inap.atl.jboss.com> --===============6369963692846233996== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-09 04:07:43 -0400 (Sat, 09 Aug 2008) New Revision: 4483 Modified: remoting2/branches/2.x/src/etc/remoting.security.policy.core Log: JBREM-1000: Added "setContextClassLoader" RuntimePermission for Connector. Modified: remoting2/branches/2.x/src/etc/remoting.security.policy.core =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/etc/remoting.security.policy.core 2008-08-09= 08:06:04 UTC (rev 4482) +++ remoting2/branches/2.x/src/etc/remoting.security.policy.core 2008-08-09= 08:07:43 UTC (rev 4483) @@ -158,6 +158,7 @@ // Used by remote class loading system permission java.lang.RuntimePermission "createClassLoader"; permission java.lang.RuntimePermission "getClassLoader"; + permission java.lang.RuntimePermission "setContextClassLoader"; = // Used by: // org.jboss.remoting.security.SSLSocketBuilder --===============6369963692846233996==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 9 04:08:28 2008 Content-Type: multipart/mixed; boundary="===============6372209202549046162==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4484 - remoting2/branches/2.x/src/etc. Date: Sat, 09 Aug 2008 04:08:27 -0400 Message-ID: <E1KRjUx-0006fD-TF@committer01.frg.pub.inap.atl.jboss.com> --===============6372209202549046162== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-09 04:08:27 -0400 (Sat, 09 Aug 2008) New Revision: 4484 Modified: remoting2/branches/2.x/src/etc/remoting.security.policy.tests.marshal Log: JBREM-1000: Added permission to read jboss-remoting-loading-tests.jar. Modified: remoting2/branches/2.x/src/etc/remoting.security.policy.tests.mar= shal =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/etc/remoting.security.policy.tests.marshal 2= 008-08-09 08:07:43 UTC (rev 4483) +++ remoting2/branches/2.x/src/etc/remoting.security.policy.tests.marshal 2= 008-08-09 08:08:27 UTC (rev 4484) @@ -51,6 +51,7 @@ = // Used by the descendents of org.jboss.test.remoting.shutdown.Shutdow= nTestParent. permission java.io.FilePermission "<<ALL FILES>>", "execute"; + permission java.io.FilePermission "${build.home}${/}output${/}lib${/}j= boss-remoting-loading-tests.jar", "read"; = permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; = --===============6372209202549046162==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 9 04:11:27 2008 Content-Type: multipart/mixed; boundary="===============5499010750650048766==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4485 - remoting2/branches/2.x. Date: Sat, 09 Aug 2008 04:11:26 -0400 Message-ID: <E1KRjXq-0007oZ-Ut@committer01.frg.pub.inap.atl.jboss.com> --===============5499010750650048766== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-09 04:11:26 -0400 (Sat, 09 Aug 2008) New Revision: 4485 Modified: remoting2/branches/2.x/build.xml Log: JBREM-1000: Added ResponseImpl to jboss-remoting-loading-tests.jar. Modified: remoting2/branches/2.x/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/build.xml 2008-08-09 08:08:27 UTC (rev 4484) +++ remoting2/branches/2.x/build.xml 2008-08-09 08:11:26 UTC (rev 4485) @@ -577,6 +577,7 @@ <exclude name=3D"org/jboss/test/remoting/marshall/dynamic/remo= te/**/Test*Marshaller*"/> <exclude name=3D"org/jboss/test/remoting/marshall/dynamic/remo= te/**/TestWrapper*"/> <exclude name=3D"org/jboss/test/remoting/marshall/dynamic/remo= te/**/TestObject*"/> + <exclude name=3D"org/jboss/test/remoting/marshall/dynamic/remo= te/**/ResponseImpl*"/> </fileset> </jar> <jar jarfile=3D"${output.lib.dir}/jboss-remoting-loading-tests.jar" @@ -585,6 +586,7 @@ <include name=3D"org/jboss/test/remoting/marshall/dynamic/remo= te/**/Test*Marshaller*"/> <include name=3D"org/jboss/test/remoting/marshall/dynamic/remo= te/**/TestWrapper*"/> <include name=3D"org/jboss/test/remoting/marshall/dynamic/remo= te/**/TestObject*"/> + <include name=3D"org/jboss/test/remoting/marshall/dynamic/remo= te/classloaders/ResponseImpl.class"/> </fileset> </jar> = --===============5499010750650048766==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 9 04:12:14 2008 Content-Type: multipart/mixed; boundary="===============7719993752307793944==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4486 - in remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynamic/remote: classloaders and 1 other directory. Date: Sat, 09 Aug 2008 04:12:13 -0400 Message-ID: <E1KRjYb-0007r4-R7@committer01.frg.pub.inap.atl.jboss.com> --===============7719993752307793944== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-09 04:12:13 -0400 (Sat, 09 Aug 2008) New Revision: 4486 Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynami= c/remote/classloaders/ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynami= c/remote/classloaders/InjectedClassloadersTestCase.java remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynami= c/remote/classloaders/Response.java remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynami= c/remote/classloaders/ResponseImpl.java remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynami= c/remote/classloaders/TestClassLoader1.java remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynami= c/remote/classloaders/TestClassLoader2.java Log: JBREM-1000: New unit test. Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dy= namic/remote/classloaders/InjectedClassloadersTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/classloaders/InjectedClassloadersTestCase.java = (rev 0) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/classloaders/InjectedClassloadersTestCase.java 2008-08-09 08:12:1= 3 UTC (rev 4486) @@ -0,0 +1,299 @@ +/* +* 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.marshall.dynamic.remote.classloaders; + +import java.net.InetAddress; +import java.util.ArrayList; +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.ServerConfiguration; +import org.jboss.remoting.ServerInvocationHandler; +import org.jboss.remoting.ServerInvoker; +import org.jboss.remoting.callback.InvokerCallbackHandler; +import org.jboss.remoting.transport.Connector; +import org.jboss.remoting.transport.PortUtil; + + +public class InjectedClassloadersTestCase extends TestCase +{ + private static Logger log =3D Logger.getLogger(InjectedClassloadersTest= Case.class); + private static String jarFileName =3D "C:/cygwin/home/rsigal/workspace/= JBossRemoting-2.x/output/lib/jboss-remoting-loading-tests.jar"; + private static String targetClassName =3D "org.jboss.test.remoting.mars= hall.dynamic.remote.classloaders.ResponseImpl"; + = + private static final int BY_DIRECT_INJECTION =3D 1; + private static final int BY_SERVER_CONFIGURATION =3D 2; + private static final int BY_CONFIG_MAP =3D 3; + = + private static Object RESPONSE_VALUE; + private static boolean firstTime =3D true; + = + protected String host; + protected int port; + protected String locatorURI; + protected InvokerLocator serverLocator; + protected Connector connector; + protected TestClassLoader1 classLoader1; + protected TestClassLoader2 classLoader2; + protected TestInvocationHandler invocationHandler; + + = + public static void main(String[] args) + { + InjectedClassloadersTestCase server =3D new InjectedClassloadersTest= Case(); + try + { + server.setUp(); + + while(true) + { + Thread.sleep(5000); + } + } + catch(Exception e) + { + e.printStackTrace(); + } + } + = + = + public void setUp() throws Exception + { + if (firstTime) + { + firstTime =3D false; + Logger.getLogger("org.jboss.remoting").setLevel(XLevel.INFO); + Logger.getLogger("org.jboss.test.remoting").setLevel(Level.INFO); + String pattern =3D "[%d{ABSOLUTE}] [%t] %5p (%F:%L) - %m%n"; + PatternLayout layout =3D new PatternLayout(pattern); + ConsoleAppender consoleAppender =3D new ConsoleAppender(layout); + Logger.getRootLogger().addAppender(consoleAppender); + ClassLoader cl =3D new TestClassLoader2(getClass().getClassLoader= (), jarFileName, targetClassName); + Class c =3D Class.forName(targetClassName, false, cl); + RESPONSE_VALUE =3D c.newInstance(); + } + } + = + = + public void tearDown() throws Exception + { + if(connector !=3D null) + { + connector.stop(); + connector.destroy(); + } + } + = + = + public void testByDirectInjection() throws Throwable + { + log.info("entering " + getName()); + = + // Start server. + setupServer(BY_DIRECT_INJECTION); + = + // Create client. + InvokerLocator clientLocator =3D new InvokerLocator(locatorURI); + HashMap clientConfig =3D new HashMap(); + clientConfig.put(InvokerLocator.FORCE_REMOTE, "true"); + addExtraClientConfig(clientConfig); + Client client =3D new Client(clientLocator, clientConfig); + client.connect(); + log.info("client is connected"); + = + // Verify that unmarshaller can get ResponseImpl class. + Object response =3D client.invoke("abc"); + log.info("response: " + response); + assertEquals(targetClassName, response.getClass().getName()); + = + // Verify that MarshallerLoaderHandler tried both configured classLo= aders. + assertTrue(classLoader1.queriedForTarget); + assertTrue(classLoader2.queriedForTarget); + + client.disconnect(); + shutdownServer(); + log.info(getName() + " PASSES"); + } + = + = + public void testByServerConfiguration() throws Throwable + { + log.info("entering " + getName()); + = + // Start server. + setupServer(BY_SERVER_CONFIGURATION); + = + // Create client. + InvokerLocator clientLocator =3D new InvokerLocator(locatorURI); + HashMap clientConfig =3D new HashMap(); + clientConfig.put(InvokerLocator.FORCE_REMOTE, "true"); + addExtraClientConfig(clientConfig); + Client client =3D new Client(clientLocator, clientConfig); + client.connect(); + log.info("client is connected"); + = + // Verify that unmarshaller can get ResponseImpl class. + Object response =3D client.invoke("abc"); + log.info("response: " + response); + assertEquals(targetClassName, response.getClass().getName()); + = + // Verify that MarshallerLoaderHandler tried both configured classLo= aders. + assertTrue(classLoader1.queriedForTarget); + assertTrue(classLoader2.queriedForTarget); + + client.disconnect(); + shutdownServer(); + log.info(getName() + " PASSES"); + } + = + = + public void testByConfigMap() throws Throwable + { + log.info("entering " + getName()); + = + // Start server. + setupServer(BY_CONFIG_MAP); + = + // Create client. + InvokerLocator clientLocator =3D new InvokerLocator(locatorURI); + HashMap clientConfig =3D new HashMap(); + clientConfig.put(InvokerLocator.FORCE_REMOTE, "true"); + addExtraClientConfig(clientConfig); + Client client =3D new Client(clientLocator, clientConfig); + client.connect(); + log.info("client is connected"); + = + // Verify that unmarshaller can get ResponseImpl class. + Object response =3D client.invoke("abc"); + log.info("response: " + response); + assertEquals(targetClassName, response.getClass().getName()); + = + // Verify that MarshallerLoaderHandler tried both configured classLo= aders. + assertTrue(classLoader1.queriedForTarget); + assertTrue(classLoader2.queriedForTarget); + + client.disconnect(); + shutdownServer(); + log.info(getName() + " PASSES"); + } + = + = + protected String getTransport() + { + return "socket"; + } + = + = + protected void addExtraClientConfig(Map config) {} + protected void addExtraServerConfig(Map config) {} + = + + protected void setupServer(int configMethod) throws Exception + { + host =3D InetAddress.getLocalHost().getHostAddress(); + port =3D PortUtil.findFreePort(host); + locatorURI =3D getTransport() + "://" + host + ":" + port; + locatorURI +=3D "/?" + InvokerLocator.LOADER_PORT + "=3D4444"; + serverLocator =3D new InvokerLocator(locatorURI); + HashMap config =3D new HashMap(); + config.put(InvokerLocator.FORCE_REMOTE, "true"); + addExtraServerConfig(config); + = + ArrayList classLoaders =3D new ArrayList(); + classLoader1 =3D new TestClassLoader1(targetClassName); + classLoader2 =3D new TestClassLoader2(getClass().getClassLoader(), j= arFileName, targetClassName); + classLoaders.add(classLoader1); + classLoaders.add(classLoader2); + = + switch (configMethod) + { + case BY_DIRECT_INJECTION: + log.info("injecting: BY_DIRECT_INJECTION"); + connector =3D new Connector(serverLocator, config); + connector.setRemoteClassLoaders(classLoaders); + break; + = + case BY_SERVER_CONFIGURATION: + log.info("injecting: BY_SERVER_CONFIGURATION"); + ServerConfiguration serverConfiguration =3D new ServerConfigur= ation(getTransport()); + Map serverParameters =3D new HashMap(); + serverParameters.put(Remoting.REMOTE_CLASS_LOADERS, classLoade= rs); + serverConfiguration.setServerParameters(serverParameters); + Map invokerLocatorParameters =3D new HashMap(); + invokerLocatorParameters.put(InvokerLocator.LOADER_PORT, "4444= "); + serverConfiguration.setInvokerLocatorParameters(invokerLocator= Parameters); + connector =3D new Connector(config); + connector.setServerConfiguration(serverConfiguration); + break; + = + case BY_CONFIG_MAP: + log.info("injecting: BY_CONFIG_MAP"); + config.put(Remoting.REMOTE_CLASS_LOADERS, classLoaders); + connector =3D new Connector(locatorURI, config); + break; + = + default: + log.error("unrecognized configMethod: " + configMethod); + return; + } + + connector.create(); + invocationHandler =3D new TestInvocationHandler(); + connector.addInvocationHandler("test", invocationHandler); + connector.start(); + locatorURI =3D connector.getInvokerLocator(); + log.info("Started remoting server with locator uri of: " + locatorUR= I); + } + = + = + protected void shutdownServer() throws Exception + { + if (connector !=3D null) + connector.stop(); + } + = + = + static class TestInvocationHandler implements ServerInvocationHandler + { + public void addListener(InvokerCallbackHandler callbackHandler) {} + public Object invoke(final InvocationRequest invocation) throws Thro= wable + { + return RESPONSE_VALUE; + } + 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/marshall/dy= namic/remote/classloaders/Response.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/classloaders/Response.java (rev 0) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/classloaders/Response.java 2008-08-09 08:12:13 UTC (rev 4486) @@ -0,0 +1,36 @@ + +/* +* 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.marshall.dynamic.remote.classloaders; + +/** + * @author <a href=3D"ron.sigal(a)jboss.com">Ron Sigal</a> + * @version $Revision: 1.1 $ + * <p> + * Copyright Aug 8, 2008 + * </p> + */ +public interface Response +{ + public Object getResult(); +} + Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dy= namic/remote/classloaders/ResponseImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/classloaders/ResponseImpl.java (rev 0) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/classloaders/ResponseImpl.java 2008-08-09 08:12:13 UTC (rev 4486) @@ -0,0 +1,44 @@ + +/* +* 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.marshall.dynamic.remote.classloaders; + +import java.io.Serializable; + +/** + * @author <a href=3D"ron.sigal(a)jboss.com">Ron Sigal</a> + * @version $Revision: 1.1 $ + * <p> + * Copyright Aug 8, 2008 + * </p> + */ +public class ResponseImpl implements Response, Serializable +{ + /** The serialVersionUID */ + private static final long serialVersionUID =3D -1012825226667853526L; + + public Object getResult() + { + return "result"; + } +} + Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dy= namic/remote/classloaders/TestClassLoader1.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/classloaders/TestClassLoader1.java (rev 0) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/classloaders/TestClassLoader1.java 2008-08-09 08:12:13 UTC (rev 4= 486) @@ -0,0 +1,72 @@ + +/* +* 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.marshall.dynamic.remote.classloaders; + +import java.io.InputStream; + +import org.apache.log4j.Logger; + +/** + * @author <a href=3D"ron.sigal(a)jboss.com">Ron Sigal</a> + * @version $Revision: 1.1 $ + * <p> + * Copyright Aug 8, 2008 + * </p> + */ +public class TestClassLoader1 extends ClassLoader +{ + public boolean queriedForTarget; + + private static Logger log =3D Logger.getLogger(TestClassLoader1.class); + = + private String targetClassName; + private String targetClassFileName; + = + public TestClassLoader1(String targetClassName) + { + this.targetClassName =3D targetClassName; + this.targetClassFileName =3D targetClassName.replace('.', '/') + ".c= lass"; + } + = + protected Class loadClass(String name, boolean resolve) throws ClassNot= FoundException + { + log.info(this + " queried for class: " + name); + if (targetClassName.equals(name)) + { + queriedForTarget =3D true; + } + return null; + } + + public InputStream getResourceAsStream(String name) = + { + log.info(this + " queried for resource InputStream: " + name); + if (targetClassFileName.equals(name)) + { + log.info(this + " looking for resource InputStream: " + name); + queriedForTarget =3D true; + } + return null; + } +} + Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dy= namic/remote/classloaders/TestClassLoader2.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/classloaders/TestClassLoader2.java (rev 0) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/classloaders/TestClassLoader2.java 2008-08-09 08:12:13 UTC (rev 4= 486) @@ -0,0 +1,178 @@ + +/* +* 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.marshall.dynamic.remote.classloaders; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.jar.JarInputStream; +import java.util.zip.ZipEntry; + +import org.apache.log4j.Logger; + +/** + * @author <a href=3D"ron.sigal(a)jboss.com">Ron Sigal</a> + * @version $Revision: 1.1 $ + * <p> + * Copyright Aug 8, 2008 + * </p> + */ +public class TestClassLoader2 extends ClassLoader +{ + public boolean queriedForTarget; + = + private static Logger log =3D Logger.getLogger(TestClassLoader2.class); + = + private String jarFileName; + private String targetClassName; + private String targetClassFileName; + = + = + public static void main(String[] args) + { + String jarFileName =3D "C:/cygwin/home/rsigal/workspace/JBossRemotin= g-2.x/output/lib/jboss-remoting-loading-tests.jar"; + String className =3D "org.jboss.test.remoting.marshall.dynamic.remot= e.classloaders.ResponseImpl"; + ClassLoader cl =3D TestClassLoader2.class.getClassLoader(); + TestClassLoader2 tcl2 =3D new TestClassLoader2(cl, jarFileName, clas= sName); + try + { + Class c =3D tcl2.loadClass(className); + Object o =3D c.newInstance(); + log.info("new object: " + o); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + = + = + public TestClassLoader2(ClassLoader parent, String jarFileName, String = targetClassName) + { + super(parent); + this.jarFileName =3D jarFileName; + this.targetClassName =3D targetClassName; + this.targetClassFileName =3D targetClassName.replace('.', '/') + ".c= lass"; + } + = + = + public InputStream getResourceAsStream(String name) = + { + try + { + log.info(this + " queried for resource InputStream: " + name); + if (targetClassFileName.equals(name)) + { + log.info(this + " looking for resource InputStream: " + name); + queriedForTarget =3D true; + byte[] bytecode =3D loadByteCodeFromClassFileName(name); + log.info(this + " returning resource InputStream: " + name); + return new ByteArrayInputStream(bytecode); + } + else + { + return super.getResourceAsStream(name); + } + } + catch (Exception e) + { + log.error(this + " unable to find resource: " + name); + return null; + } + } + = + = + protected Class loadClass(String name, boolean resolve) throws ClassNot= FoundException + { + try + { + log.info(this + " queried for class: " + name); + if (targetClassName.equals(name)) + { + log.info(this + " loading class: " + name); + queriedForTarget =3D true; + byte[] bytes =3D loadByteCodeFromClassName(name); + Class c =3D defineClass(name, bytes, 0, bytes.length); + if (resolve) + { + resolveClass(c); + } + return c; + } + else + { + return super.loadClass(name, resolve); + } + } + catch (IOException e) + { + throw new ClassNotFoundException(name); + } + } + = + = + private byte[] loadByteCodeFromClassName(String classname) + throws ClassNotFoundException, IOException + { + String classFileName =3D classname.replace('.', '/') + ".class"; + return loadByteCodeFromClassFileName(classFileName); + } + = + = + private byte[] loadByteCodeFromClassFileName(String classFileName) + throws ClassNotFoundException, IOException + { + File file =3D new File(jarFileName); + JarInputStream jis =3D new JarInputStream(new FileInputStream(file)); + ZipEntry entry =3D jis.getNextEntry(); + = + try + { + while (entry !=3D null) + { + log.info("name: " + entry.getName()); + if (classFileName.equals(entry.getName())) + break; + entry =3D jis.getNextEntry(); + } + log.info("size: " + entry.getSize()); + ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); + byte[] tmp =3D new byte[1024]; + int read =3D 0; + while( (read =3D jis.read(tmp)) > 0 ) + { + baos.write(tmp, 0, read); + } + byte[] bytecode =3D baos.toByteArray(); + return bytecode; + } + finally + { + if( jis !=3D null ) + jis.close(); + } + } +} --===============7719993752307793944==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 9 04:12:49 2008 Content-Type: multipart/mixed; boundary="===============8595571877738306285==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4487 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynamic/remote/classloaders. Date: Sat, 09 Aug 2008 04:12:49 -0400 Message-ID: <E1KRjZB-0007sk-1s@committer01.frg.pub.inap.atl.jboss.com> --===============8595571877738306285== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-09 04:12:48 -0400 (Sat, 09 Aug 2008) New Revision: 4487 Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynami= c/remote/classloaders/InjectedClassloadersTestCase.java Log: JBREM-1000: Added javadoc. Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall= /dynamic/remote/classloaders/InjectedClassloadersTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/classloaders/InjectedClassloadersTestCase.java 2008-08-09 08:12:1= 3 UTC (rev 4486) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/classloaders/InjectedClassloadersTestCase.java 2008-08-09 08:12:4= 8 UTC (rev 4487) @@ -47,6 +47,15 @@ import org.jboss.remoting.transport.PortUtil; = = +/** + * Unit test for JBREM-1000. + * = + * @author <a href=3D"ron.sigal(a)jboss.com">Ron Sigal</a> + * @version $Revision: 1.1 $ + * <p> + * Copyright Aug 9, 2008 + * </p> + */ public class InjectedClassloadersTestCase extends TestCase { private static Logger log =3D Logger.getLogger(InjectedClassloadersTest= Case.class); --===============8595571877738306285==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 9 13:35:41 2008 Content-Type: multipart/mixed; boundary="===============7991517453939371489==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4488 - remoting2/branches/2.x. Date: Sat, 09 Aug 2008 13:35:41 -0400 Message-ID: <E1KRsLt-0003vG-Em@committer01.frg.pub.inap.atl.jboss.com> --===============7991517453939371489== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-09 13:35:41 -0400 (Sat, 09 Aug 2008) New Revision: 4488 Modified: remoting2/branches/2.x/build.xml Log: JBREM-1006: Turned on execution of http chunked tests. Modified: remoting2/branches/2.x/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/build.xml 2008-08-09 08:12:48 UTC (rev 4487) +++ remoting2/branches/2.x/build.xml 2008-08-09 17:35:41 UTC (rev 4488) @@ -989,6 +989,13 @@ <param name=3D"classpath" value=3D"tests.classpath"/> <param name=3D"version" value=3D"jbossweb"/> </antcall> + <antcall target=3D"tests.functional.main.http.isJDK5.core" inheritre= fs=3D"true"> + <param name=3D"remoting.metadata.key" value=3D"remoting.metadata"= /> + <param name=3D"metadata" value=3D"serializationtype=3D${serializa= tion}"/> + <param name=3D"jboss-junit-configuration" value=3D"${serializatio= n}_serialization_jbossweb"/> + <param name=3D"classpath" value=3D"tests.classpath"/> + <param name=3D"version" value=3D"jbossweb"/> + </antcall> <antcall target=3D"tests.functional.main.http.security" inheritrefs= =3D"true"> <param name=3D"remoting.metadata.key" value=3D"remoting.metadata"= /> <param name=3D"metadata" value=3D"serializationtype=3D${serializa= tion}"/> @@ -1006,6 +1013,13 @@ <param name=3D"classpath" value=3D"tests.classpath.tomcat"/> <param name=3D"version" value=3D"tomcat"/> </antcall> + <antcall target=3D"tests.functional.main.http.isJDK5.core" inheritre= fs=3D"true"> + <param name=3D"remoting.metadata.key" value=3D"remoting.metadata"= /> + <param name=3D"metadata" value=3D"serializationtype=3D${serializa= tion}"/> + <param name=3D"jboss-junit-configuration" value=3D"${serializatio= n}_serialization_tomcat"/> + <param name=3D"classpath" value=3D"tests.classpath.tomcat"/> + <param name=3D"version" value=3D"tomcat"/> + </antcall> <antcall target=3D"tests.functional.main.http.security" inheritrefs= =3D"true"> <param name=3D"remoting.metadata.key" value=3D"remoting.metadata"= /> <param name=3D"metadata" value=3D"serializationtype=3D${serializa= tion}"/> @@ -1208,14 +1222,14 @@ </junit> </target> = - <target name=3D"tests.functional.main.isJDK5.core" depends=3D"tests.jar= s" unless=3D"isJDK4"> + <target name=3D"tests.functional.main.http.isJDK5.core" unless=3D"isJDK= 4"> <mkdir dir=3D"${output.tests.results}"/> <mkdir dir=3D"${output.tests.tmp}"/> <junit printsummary=3D"true" fork=3D"yes" includeantruntime=3D"true"= tempdir=3D"${output.tests.tmp}"> <jvmarg value=3D"-Dloader.path=3D${output.lib.dir}/jboss-remoting= -loading-tests.jar"/> <jvmarg value=3D"-D${remoting.metadata.key}=3D${metadata}"/> <classpath> - <path refid=3D"tests.classpath"/> + <path refid=3D"${classpath}"/> </classpath> <sysproperty key=3D"${java.security.manager.key}" value=3D"${java= .security.manager}"/> <sysproperty key=3D"java.security.policy" value=3D"${java.securit= y.policy}"/> --===============7991517453939371489==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 9 21:25:46 2008 Content-Type: multipart/mixed; boundary="===============7242029460378429705==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4489 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynamic/remote/classloaders. Date: Sat, 09 Aug 2008 21:25:46 -0400 Message-ID: <E1KRzgo-00026V-Lr@committer01.frg.pub.inap.atl.jboss.com> --===============7242029460378429705== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-09 21:25:46 -0400 (Sat, 09 Aug 2008) New Revision: 4489 Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynami= c/remote/classloaders/InjectedClassloadersTestCase.java Log: JBREM-1000: Get jboss-remoting-loading-tests.jar address from System proper= ty "loader.path". Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall= /dynamic/remote/classloaders/InjectedClassloadersTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/classloaders/InjectedClassloadersTestCase.java 2008-08-09 17:35:4= 1 UTC (rev 4488) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/classloaders/InjectedClassloadersTestCase.java 2008-08-10 01:25:4= 6 UTC (rev 4489) @@ -22,6 +22,9 @@ package org.jboss.test.remoting.marshall.dynamic.remote.classloaders; = import java.net.InetAddress; +import java.security.AccessController; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; @@ -59,7 +62,7 @@ public class InjectedClassloadersTestCase extends TestCase { private static Logger log =3D Logger.getLogger(InjectedClassloadersTest= Case.class); - private static String jarFileName =3D "C:/cygwin/home/rsigal/workspace/= JBossRemoting-2.x/output/lib/jboss-remoting-loading-tests.jar"; + private static String jarFileName; private static String targetClassName =3D "org.jboss.test.remoting.mars= hall.dynamic.remote.classloaders.ResponseImpl"; = private static final int BY_DIRECT_INJECTION =3D 1; @@ -109,6 +112,8 @@ PatternLayout layout =3D new PatternLayout(pattern); ConsoleAppender consoleAppender =3D new ConsoleAppender(layout); Logger.getRootLogger().addAppender(consoleAppender); + = + jarFileName =3D getSystemProperty("loader.path"); ClassLoader cl =3D new TestClassLoader2(getClass().getClassLoader= (), jarFileName, targetClassName); Class c =3D Class.forName(targetClassName, false, cl); RESPONSE_VALUE =3D c.newInstance(); @@ -294,6 +299,28 @@ } = = + private String getSystemProperty(final String name) + { = + String value =3D null; + try + { + value =3D (String)AccessController.doPrivileged( new PrivilegedEx= ceptionAction() + { + public Object run() throws Exception + { + return System.getProperty(name); + } + }); + } + catch (PrivilegedActionException e) + { + throw (RuntimeException) e.getCause(); + } + = + return value; + } + = + = static class TestInvocationHandler implements ServerInvocationHandler { public void addListener(InvokerCallbackHandler callbackHandler) {} --===============7242029460378429705==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 9 21:32:01 2008 Content-Type: multipart/mixed; boundary="===============7850978132092907176==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4490 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynamic/remote/classloaders. Date: Sat, 09 Aug 2008 21:32:01 -0400 Message-ID: <E1KRzmr-0003Nx-MH@committer01.frg.pub.inap.atl.jboss.com> --===============7850978132092907176== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-09 21:32:01 -0400 (Sat, 09 Aug 2008) New Revision: 4490 Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynami= c/remote/classloaders/InjectedClassloadersTestCase.java Log: JBREM-1000: Gets random port for loader port. Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall= /dynamic/remote/classloaders/InjectedClassloadersTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/classloaders/InjectedClassloadersTestCase.java 2008-08-10 01:25:4= 6 UTC (rev 4489) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/classloaders/InjectedClassloadersTestCase.java 2008-08-10 01:32:0= 1 UTC (rev 4490) @@ -238,8 +238,9 @@ { host =3D InetAddress.getLocalHost().getHostAddress(); port =3D PortUtil.findFreePort(host); + String loaderPort =3D Integer.toString(PortUtil.findFreePort(host)); locatorURI =3D getTransport() + "://" + host + ":" + port; - locatorURI +=3D "/?" + InvokerLocator.LOADER_PORT + "=3D4444"; + locatorURI +=3D "/?" + InvokerLocator.LOADER_PORT + "=3D" + loaderPo= rt; serverLocator =3D new InvokerLocator(locatorURI); HashMap config =3D new HashMap(); config.put(InvokerLocator.FORCE_REMOTE, "true"); @@ -266,7 +267,7 @@ serverParameters.put(Remoting.REMOTE_CLASS_LOADERS, classLoade= rs); serverConfiguration.setServerParameters(serverParameters); Map invokerLocatorParameters =3D new HashMap(); - invokerLocatorParameters.put(InvokerLocator.LOADER_PORT, "4444= "); + invokerLocatorParameters.put(InvokerLocator.LOADER_PORT, loade= rPort); serverConfiguration.setInvokerLocatorParameters(invokerLocator= Parameters); connector =3D new Connector(config); connector.setServerConfiguration(serverConfiguration); --===============7850978132092907176==-- From jboss-remoting-commits at lists.jboss.org Sun Aug 10 19:00:26 2008 Content-Type: multipart/mixed; boundary="===============1763225590077360948==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4491 - remoting2/branches/2.x/src/main/org/jboss/remoting/loading. Date: Sun, 10 Aug 2008 19:00:26 -0400 Message-ID: <E1KSJti-0007vO-97@committer01.frg.pub.inap.atl.jboss.com> --===============1763225590077360948== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-10 19:00:26 -0400 (Sun, 10 Aug 2008) New Revision: 4491 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/loading/RemotingClass= Loader.java Log: JBREM-302: Corrected error message. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/loading/Remoti= ngClassLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/loading/RemotingClas= sLoader.java 2008-08-10 01:32:01 UTC (rev 4490) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/loading/RemotingClas= sLoader.java 2008-08-10 23:00:26 UTC (rev 4491) @@ -109,7 +109,7 @@ { if(isTrace) { - log.trace("Could not load class (" + name + ") using parent re= moting class loader (" + getParent() + ")"); + log.trace("Could not load class (" + name + ") using primary c= lass loader (" + primary + ")"); } if(secondary !=3D null) { @@ -121,7 +121,7 @@ { if(isTrace) { - log.trace("Could not load class (" + name + ") using par= ent remoting class loader (" + getParent() + ")"); + log.trace("Could not load class (" + name + ") using sec= ondary class loader (" + secondary + ")"); } } } --===============1763225590077360948==-- From jboss-remoting-commits at lists.jboss.org Sun Aug 10 19:06:17 2008 Content-Type: multipart/mixed; boundary="===============3990210774113089653==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4492 - remoting2/branches/2.x/src/main/org/jboss/remoting/marshal. Date: Sun, 10 Aug 2008 19:06:17 -0400 Message-ID: <E1KSJzN-0000z9-JW@committer01.frg.pub.inap.atl.jboss.com> --===============3990210774113089653== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-10 19:06:17 -0400 (Sun, 10 Aug 2008) New Revision: 4492 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshallerLoa= derClient.java Log: JBREM-1023: Gets "serializationtype" from InvokerLocator. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/Marsha= llerLoaderClient.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshallerLo= aderClient.java 2008-08-10 23:00:26 UTC (rev 4491) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/MarshallerLo= aderClient.java 2008-08-10 23:06:17 UTC (rev 4492) @@ -54,10 +54,27 @@ Marshaller marshaller =3D null; try { - Marshaller loaderMarshaller =3D new SerializableMarshaller(); - UnMarshaller loaderUnMarshaller =3D new SerializableUnMarshaller(= ); + SerializableMarshaller loaderMarshaller =3D new SerializableMarsh= aller(); + SerializableUnMarshaller loaderUnMarshaller =3D new SerializableU= nMarshaller(); loaderUnMarshaller.setClassLoader(classByteLoader); - + = + String serializationType =3D "java"; + Map parameters =3D loaderLocator.getParameters(); + if (parameters !=3D null) + { + Object o =3D parameters.get(InvokerLocator.SERIALIZATIONTYPE); + if (o =3D=3D null) + { + o =3D parameters.get(InvokerLocator.SERIALIZATIONTYPE_CASED= );; + } + if (o !=3D null) + { + serializationType =3D (String) o; + } + } + loaderMarshaller.setSerializationType(serializationType); + loaderUnMarshaller.setSerializationType(serializationType); + = String marshallerMethodName =3D GET_MARSHALLER_METHOD; Map metadata =3D new HashMap(); metadata.put(InvokerLocator.DATATYPE, dataType); @@ -104,6 +121,23 @@ SerializableMarshaller loaderMarshaller =3D new SerializableMarsh= aller(); SerializableUnMarshaller loaderUnMarshaller =3D new SerializableU= nMarshaller(); loaderUnMarshaller.setClassLoader(classByteLoader); + = + String serializationType =3D "java"; + Map parameters =3D loaderLocator.getParameters(); + if (parameters !=3D null) + { + Object o =3D parameters.get(InvokerLocator.SERIALIZATIONTYPE); + if (o =3D=3D null) + { + o =3D parameters.get(InvokerLocator.SERIALIZATIONTYPE_CASED= );; + } + if (o !=3D null) + { + serializationType =3D (String) o; + } + } + loaderMarshaller.setSerializationType(serializationType); + loaderUnMarshaller.setSerializationType(serializationType); = String marshallerMethodName =3D GET_UNMARSHALLER_METHOD; Map metadata =3D new HashMap(); --===============3990210774113089653==-- From jboss-remoting-commits at lists.jboss.org Sun Aug 10 19:10:15 2008 Content-Type: multipart/mixed; boundary="===============6857885717950750728==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4493 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynamic/remote/http. Date: Sun, 10 Aug 2008 19:10:15 -0400 Message-ID: <E1KSK3D-0002AU-Dz@committer01.frg.pub.inap.atl.jboss.com> --===============6857885717950750728== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-10 19:10:15 -0400 (Sun, 10 Aug 2008) New Revision: 4493 Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynami= c/remote/http/HTTPMarshallerLoadingTestCase.java Log: JBREM-302, JBREM-1023: Sets "serializationtype" on command line. Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall= /dynamic/remote/http/HTTPMarshallerLoadingTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/http/HTTPMarshallerLoadingTestCase.java 2008-08-10 23:06:17 UTC (= rev 4492) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/http/HTTPMarshallerLoadingTestCase.java 2008-08-10 23:10:15 UTC (= rev 4493) @@ -71,4 +71,27 @@ 1, MarshallerLoadingServer.class.getName()); } + = + protected String getClientJVMArguments() + { + return getJVMArguments(); + } + + protected String getServerJVMArguments() + { + return getJVMArguments(); + } + = + protected String getJVMArguments() + { + String vmArgs =3D ""; + + String metadata =3D System.getProperty("remoting.metadata"); + if(metadata !=3D null && metadata.length() > 0) + { + vmArgs =3D "-Dremoting.metadata=3D" + metadata; + } + + return vmArgs; + } } \ No newline at end of file --===============6857885717950750728==-- From jboss-remoting-commits at lists.jboss.org Sun Aug 10 19:11:02 2008 Content-Type: multipart/mixed; boundary="===============2350117450611506235==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4494 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynamic/remote/http. Date: Sun, 10 Aug 2008 19:11:02 -0400 Message-ID: <E1KSK3y-0002DZ-5r@committer01.frg.pub.inap.atl.jboss.com> --===============2350117450611506235== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-10 19:11:02 -0400 (Sun, 10 Aug 2008) New Revision: 4494 Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynami= c/remote/http/MarshallerLoadingClient.java Log: JBREM-302, JBREM-1023: Adds "serializationtype" to InvokerLocator. Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall= /dynamic/remote/http/MarshallerLoadingClient.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/http/MarshallerLoadingClient.java 2008-08-10 23:10:15 UTC (rev 44= 93) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/http/MarshallerLoadingClient.java 2008-08-10 23:11:02 UTC (rev 44= 94) @@ -51,8 +51,14 @@ = try { - InvokerLocator locator =3D new InvokerLocator(locatorURI); - System.out.println("Calling remoting server with locator uri of: = " + locatorURI); + String newLocatorURI =3D locatorURI; + String metadata =3D System.getProperty("remoting.metadata"); + if(metadata !=3D null) + { + newLocatorURI +=3D "&" + metadata; + } + InvokerLocator locator =3D new InvokerLocator(newLocatorURI); + System.out.println("Calling remoting server with locator uri of: = " + newLocatorURI); = remotingClient =3D new Client(locator); remotingClient.connect(); --===============2350117450611506235==-- From jboss-remoting-commits at lists.jboss.org Sun Aug 10 19:11:29 2008 Content-Type: multipart/mixed; boundary="===============3894301996457641512==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4495 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynamic/remote/http. Date: Sun, 10 Aug 2008 19:11:29 -0400 Message-ID: <E1KSK4P-0002F1-0l@committer01.frg.pub.inap.atl.jboss.com> --===============3894301996457641512== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-10 19:11:28 -0400 (Sun, 10 Aug 2008) New Revision: 4495 Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynami= c/remote/http/MarshallerLoadingServer.java Log: JBREM-302, JBREM-1023: Adds "serializationtype" to InvokerLocator. Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall= /dynamic/remote/http/MarshallerLoadingServer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/http/MarshallerLoadingServer.java 2008-08-10 23:11:02 UTC (rev 44= 94) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/http/MarshallerLoadingServer.java 2008-08-10 23:11:28 UTC (rev 44= 95) @@ -49,8 +49,15 @@ public void setupServer() throws Exception { System.out.println("locatorURI: " + locatorURI); - InvokerLocator locator =3D new InvokerLocator(locatorURI); - System.out.println("Starting remoting server with locator uri of: " = + locatorURI); + String newLocatorURI =3D locatorURI; + String metadata =3D System.getProperty("remoting.metadata"); + System.out.println("metadata: " + metadata); + if(metadata !=3D null) + { + newLocatorURI +=3D "&" + metadata; + } + InvokerLocator locator =3D new InvokerLocator(newLocatorURI); + System.out.println("Starting remoting server with locator uri of: " = + newLocatorURI); connector =3D new Connector(); connector.setInvokerLocator(locator.getLocatorURI()); connector.start(); --===============3894301996457641512==-- From jboss-remoting-commits at lists.jboss.org Sun Aug 10 19:12:03 2008 Content-Type: multipart/mixed; boundary="===============6975681396632600939==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4496 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynamic/remote/socket. Date: Sun, 10 Aug 2008 19:12:03 -0400 Message-ID: <E1KSK4x-0002Gq-Px@committer01.frg.pub.inap.atl.jboss.com> --===============6975681396632600939== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-10 19:12:03 -0400 (Sun, 10 Aug 2008) New Revision: 4496 Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynami= c/remote/socket/MarshallerLoadingClient.java Log: JBREM-302, JBREM-1023: Adds "serializationtype" to InvokerLocator. Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall= /dynamic/remote/socket/MarshallerLoadingClient.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/socket/MarshallerLoadingClient.java 2008-08-10 23:11:28 UTC (rev = 4495) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/socket/MarshallerLoadingClient.java 2008-08-10 23:12:03 UTC (rev = 4496) @@ -51,8 +51,14 @@ = try { - InvokerLocator locator =3D new InvokerLocator(locatorURI); - System.out.println("Calling remoting server with locator uri of: = " + locatorURI); + String newLocatorURI =3D locatorURI; + String metadata =3D System.getProperty("remoting.metadata"); + if(metadata !=3D null) + { + newLocatorURI +=3D "&" + metadata; + } + InvokerLocator locator =3D new InvokerLocator(newLocatorURI); + System.out.println("Calling remoting server with locator uri of: = " + newLocatorURI); = remotingClient =3D new Client(locator); remotingClient.connect(); --===============6975681396632600939==-- From jboss-remoting-commits at lists.jboss.org Sun Aug 10 19:15:20 2008 Content-Type: multipart/mixed; boundary="===============4061770075028309784==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4497 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynamic/remote/socket. Date: Sun, 10 Aug 2008 19:15:20 -0400 Message-ID: <E1KSK88-0003P5-1v@committer01.frg.pub.inap.atl.jboss.com> --===============4061770075028309784== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-10 19:15:19 -0400 (Sun, 10 Aug 2008) New Revision: 4497 Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynami= c/remote/socket/MarshallerLoadingServer.java Log: JBREM-302, JBREM-1023: Adds "serializationtype" to InvokerLocator. Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall= /dynamic/remote/socket/MarshallerLoadingServer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/socket/MarshallerLoadingServer.java 2008-08-10 23:12:03 UTC (rev = 4496) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/socket/MarshallerLoadingServer.java 2008-08-10 23:15:19 UTC (rev = 4497) @@ -49,8 +49,15 @@ public void setupServer() throws Exception { System.out.println("locatorURI: " + locatorURI); - InvokerLocator locator =3D new InvokerLocator(locatorURI); - System.out.println("Starting remoting server with locator uri of: " = + locatorURI); + String newLocatorURI =3D locatorURI; + String metadata =3D System.getProperty("remoting.metadata"); + System.out.println("metadata: " + metadata); + if(metadata !=3D null) + { + newLocatorURI +=3D "&" + metadata; + } + InvokerLocator locator =3D new InvokerLocator(newLocatorURI); + System.out.println("Starting remoting server with locator uri of: " = + newLocatorURI); connector =3D new Connector(); connector.setInvokerLocator(locator.getLocatorURI()); connector.start(); --===============4061770075028309784==-- From jboss-remoting-commits at lists.jboss.org Sun Aug 10 19:16:14 2008 Content-Type: multipart/mixed; boundary="===============2230846459786303225==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4498 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynamic/remote/socket. Date: Sun, 10 Aug 2008 19:16:14 -0400 Message-ID: <E1KSK90-0003SN-1g@committer01.frg.pub.inap.atl.jboss.com> --===============2230846459786303225== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-10 19:16:13 -0400 (Sun, 10 Aug 2008) New Revision: 4498 Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynami= c/remote/socket/SocketMarshallerLoadingTestCase.java Log: JBREM-302, JBREM-1023: Sets "serializationtype" on command line. Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall= /dynamic/remote/socket/SocketMarshallerLoadingTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/socket/SocketMarshallerLoadingTestCase.java 2008-08-10 23:15:19 U= TC (rev 4497) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/dynam= ic/remote/socket/SocketMarshallerLoadingTestCase.java 2008-08-10 23:16:13 U= TC (rev 4498) @@ -71,4 +71,27 @@ 1, MarshallerLoadingServer.class.getName()); } + = + protected String getClientJVMArguments() + { + return getJVMArguments(); + } + + protected String getServerJVMArguments() + { + return getJVMArguments(); + } + = + protected String getJVMArguments() + { + String vmArgs =3D ""; + + String metadata =3D System.getProperty("remoting.metadata"); + if(metadata !=3D null && metadata.length() > 0) + { + vmArgs =3D "-Dremoting.metadata=3D" + metadata; + } + + return vmArgs; + } } \ No newline at end of file --===============2230846459786303225==-- From jboss-remoting-commits at lists.jboss.org Sun Aug 10 19:27:37 2008 Content-Type: multipart/mixed; boundary="===============7507496719900856883==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4499 - remoting2/branches/2.x/lib/jboss. Date: Sun, 10 Aug 2008 19:27:37 -0400 Message-ID: <E1KSKK1-0005yH-5Q@committer01.frg.pub.inap.atl.jboss.com> --===============7507496719900856883== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-10 19:27:37 -0400 (Sun, 10 Aug 2008) New Revision: 4499 Modified: remoting2/branches/2.x/lib/jboss/jrunit.jar Log: JBREM-302: Removed quotes surrounding classpath passed to ServerTestHarness. Modified: remoting2/branches/2.x/lib/jboss/jrunit.jar =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) --===============7507496719900856883==-- From jboss-remoting-commits at lists.jboss.org Sun Aug 10 19:29:51 2008 Content-Type: multipart/mixed; boundary="===============0812943803926421538==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4500 - remoting2/branches/2.x/lib/jboss. Date: Sun, 10 Aug 2008 19:29:51 -0400 Message-ID: <E1KSKMB-00065P-Q0@committer01.frg.pub.inap.atl.jboss.com> --===============0812943803926421538== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-10 19:29:51 -0400 (Sun, 10 Aug 2008) New Revision: 4500 Modified: remoting2/branches/2.x/lib/jboss/README Log: JBREM-302: Added comment about new jrunit version. Modified: remoting2/branches/2.x/lib/jboss/README =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/lib/jboss/README 2008-08-10 23:27:37 UTC (rev 44= 99) +++ remoting2/branches/2.x/lib/jboss/README 2008-08-10 23:29:51 UTC (rev 45= 00) @@ -17,4 +17,6 @@ = 04/30/08: A new jrunit.jar has been committed, built from jrunit CVS vers= ion remoting_binary_043008. = -05/07/08: A new jrunit.jar has been committed, built from jrunit CVS vers= ion remoting_binary_050708. \ No newline at end of file +05/07/08: A new jrunit.jar has been committed, built from jrunit CVS vers= ion remoting_binary_050708. + +08/10/08: A new jrunit.jar has been committed, built from jrunit CVS vers= ionremoting_binary_081008 \ No newline at end of file --===============0812943803926421538==-- From jboss-remoting-commits at lists.jboss.org Sun Aug 10 19:36:33 2008 Content-Type: multipart/mixed; boundary="===============2124048309571054713==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4501 - remoting2/branches/2.x. Date: Sun, 10 Aug 2008 19:36:32 -0400 Message-ID: <E1KSKSe-0008QG-UC@committer01.frg.pub.inap.atl.jboss.com> --===============2124048309571054713== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-10 19:36:32 -0400 (Sun, 10 Aug 2008) New Revision: 4501 Modified: remoting2/branches/2.x/build.xml Log: JBREM-302, JBREM-1023: (1) tests.marshall now runs in linux; (2) tests.mars= hall now runs with both java and jboss serialization. Modified: remoting2/branches/2.x/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/build.xml 2008-08-10 23:29:51 UTC (rev 4500) +++ remoting2/branches/2.x/build.xml 2008-08-10 23:36:32 UTC (rev 4501) @@ -860,6 +860,9 @@ <param name=3D"jboss-junit-configuration" value=3D"java_serializa= tion_security"/> </antcall> <antcall target=3D"tests.marshall" inheritrefs=3D"true"> + <param name=3D"remoting.metadata.key" value=3D"remoting.metadata"/> + <param name=3D"metadata" value=3D"serializationtype=3Djava"/> + <param name=3D"jboss-junit-configuration" value=3D"java_serializat= ion"/> </antcall> </target> = @@ -898,6 +901,11 @@ </antcall> <antcall target=3D"tests.nonserializable" inheritrefs=3D"true"/> <antcall target=3D"tests.functional.main.serialization.jboss" inheri= trefs=3D"true"/> + <antcall target=3D"tests.marshall" inheritrefs=3D"true"> + <param name=3D"remoting.metadata.key" value=3D"remoting.metadata"/> + <param name=3D"metadata" value=3D"serializationtype=3Djboss"/> + <param name=3D"jboss-junit-configuration" value=3D"jboss_serializa= tion"/> + </antcall> </target> = = @@ -1539,8 +1547,8 @@ <!-- End of socket serialization smoke tests --> = <!-- Tests dynamic, remote loading of marshaller/unmarshaller --> - <target name=3D"tests.marshall" if=3D"os.windows"> - <echo>remote marshalling tests</echo> + <target name=3D"tests.marshall"> + <echo>remote marshalling tests: ${metadata}</echo> <mkdir dir=3D"${output.tests.results}"/> <mkdir dir=3D"${output.tests.tmp}"/> <junit printsummary=3D"true" fork=3D"yes" includeantruntime=3D"true"= tempdir=3D"${output.tests.tmp}"> @@ -1549,6 +1557,7 @@ <path refid=3D"tests.marshall.classpath"/> <pathelement location=3D"${output.lib.dir}/jboss-remoting-test= s.jar"/> </classpath> + <jvmarg value=3D"-D${remoting.metadata.key}=3D${metadata}"/> <sysproperty key=3D"${java.security.manager.key}" value=3D"${java= .security.manager}"/> <sysproperty key=3D"java.security.policy" value=3D"${java.securit= y.policy.marshal}"/> <sysproperty key=3D"java.security.debug" value=3D"${java.security= .debug}"/> @@ -1557,6 +1566,7 @@ <sysproperty key=3D"log4j.jar.dir" value=3D"${basedir}/lib/apache= -log4j/lib"/> <sysproperty key=3D"log4j.config.dir" value=3D"${basedir}/src/etc= "/> <sysproperty key=3D"ant.library.dir" value=3D"${ant.library.dir}"= /> + <sysproperty key=3D"jboss-junit-configuration" value=3D"${jboss-j= unit-configuration}"/> <sysproperty key=3D"jrunit.bind_addr" value=3D"${bind.address}"/> <sysproperty key=3D"jrunit.mcast_addr" value=3D"${multicast.addre= ss}"/> <sysproperty key=3D"jrunit.mcast_port" value=3D"${multicast.port}= "/> @@ -1566,10 +1576,10 @@ <sysproperty key=3D"jrunit.logdir" value=3D"${output.tests}"/> <!-- this is needed for the remoting.marshall.dynamic.remote.Mars= hallerLoadingServer --> <jvmarg value=3D"-Dloader.path=3D${output.lib.dir}/jboss-remoting= -loading-tests.jar"/> - <formatter type=3D"xml"/> + <formatter classname=3D"org.jboss.ant.taskdefs.XMLJUnitMultipleRe= sultFormatter" + extension=3D"-${jboss-junit-configuration}.xml"/> <batchtest fork=3D"yes" todir=3D"${output.tests.results}" haltonfailure=3D"no"> - <formatter type=3D"xml"/> <fileset dir=3D"${tests.compile.dir}"> <include name=3D"**/remoting/marshall/dynamic/remote/**/*Te= stCase.class"/> <exclude name=3D"**/remoting/**/performance/**"/> --===============2124048309571054713==-- From jboss-remoting-commits at lists.jboss.org Sun Aug 10 22:23:58 2008 Content-Type: multipart/mixed; boundary="===============6562241800013324503==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4502 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport. Date: Sun, 10 Aug 2008 22:23:58 -0400 Message-ID: <E1KSN4g-0007GD-Lp@committer01.frg.pub.inap.atl.jboss.com> --===============6562241800013324503== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-10 22:23:58 -0400 (Sun, 10 Aug 2008) New Revision: 4502 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Connector.j= ava Log: JBREM-1000: Fixed remoteClassLoaders type test in init(). Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Conn= ector.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Connector.= java 2008-08-10 23:36:32 UTC (rev 4501) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Connector.= java 2008-08-11 02:23:58 UTC (rev 4502) @@ -480,7 +480,7 @@ { setRemoteClassLoaders((List) o); } - else + else if (o !=3D null) { log.warn("value of " + Remoting.REMOTE_CLASS_LOADERS + " must = be a List"); } --===============6562241800013324503==-- From jboss-remoting-commits at lists.jboss.org Tue Aug 12 01:56:00 2008 Content-Type: multipart/mixed; boundary="===============4348217337842124043==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4503 - remoting2/branches/2.x/docs/guide/en. Date: Tue, 12 Aug 2008 01:55:59 -0400 Message-ID: <E1KSmrP-0003lA-1y@committer01.frg.pub.inap.atl.jboss.com> --===============4348217337842124043== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-12 01:55:58 -0400 (Tue, 12 Aug 2008) New Revision: 4503 Modified: remoting2/branches/2.x/docs/guide/en/chap1.xml Log: JBREM-1025: Added information about 2.4.0.SP1 release. Modified: remoting2/branches/2.x/docs/guide/en/chap1.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/docs/guide/en/chap1.xml 2008-08-11 02:23:58 UTC = (rev 4502) +++ remoting2/branches/2.x/docs/guide/en/chap1.xml 2008-08-12 05:55:58 UTC = (rev 4503) @@ -177,30 +177,54 @@ <section> <title>What's new in version 2.4? = - JBossRemoting 2.4.0.GA is an incremental release, with dozens of= bug fixes and several new features: - +
+ Release 2.4.0.SP1 + = + + + The remote classloading facility can be configured with li= sts of + classloaders. + + = + + Classloading in the client can optionally start with the t= hread + context classloader. + + = + + Leasing can be enabled declaratively. + + +
= - - - servers can be bound to multiple IP addresses - - - can run in the presence of a security manager - - - greater configurability - - - supports IPv6 addresses - - - improved connection monitoring - - - server gets client address in invocations - +
+ Release 2.4.0.GA = - - = + JBossRemoting 2.4.0.GA is an incremental release, with dozens = of bug + fixes and several new features: + = + + + servers can be bound to multiple IP addresses + + + can run in the presence of a security manager + + + greater configurability + + + supports IPv6 addresses + + + improved connection monitoring + + + server gets client address in invocations + + = + +
+ = \ No newline at end of file --===============4348217337842124043==-- From jboss-remoting-commits at lists.jboss.org Tue Aug 12 01:56:20 2008 Content-Type: multipart/mixed; boundary="===============7399076186027704690==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4504 - remoting2/branches/2.x/docs/guide/en. Date: Tue, 12 Aug 2008 01:56:20 -0400 Message-ID: --===============7399076186027704690== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-12 01:56:20 -0400 (Tue, 12 Aug 2008) New Revision: 4504 Modified: remoting2/branches/2.x/docs/guide/en/chap17.xml Log: JBREM-1025: Added release notes for 2.4.0.SP1 release. Modified: remoting2/branches/2.x/docs/guide/en/chap17.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/docs/guide/en/chap17.xml 2008-08-12 05:55:58 UTC= (rev 4503) +++ remoting2/branches/2.x/docs/guide/en/chap17.xml 2008-08-12 05:56:20 UTC= (rev 4504) @@ -52,6 +52,39 @@ =
Version 2.4 + = + Release Notes - JBoss Remoting - Version 2.4.0.SP1 (Pinto)= + = + Bug + = + * [JBREM-302] - remote dynamic marshall loading not working = on linux + * [JBREM-925] - SSLSocketBuilder config attribute names out = of sync with docs + * [JBREM-990] - CLONE [JBREM-960] - Remoting configured with= Servlet invoker can return misleading Exceptions when Servlet path is inco= rrect + * [JBREM-991] - Investigate MulticastDetector message flood<= /para> + * [JBREM-1000] - CLONE [JBREM-962] - Remote classloading doe= s not work with Isolated EARs + * [JBREM-1005] - Prevent build up of cancelled TimerTasks in= bisocket transport + * [JBREM-1006] - SOA MTOM bug points to bug in Remoting code= base + * [JBREM-1019] - RemotingClassLoader needs option to delegat= e to user class loader before parent + * [JBREM-1022] - Fix misleading javadoc in InvokerLocator + * [JBREM-1023] - Dynamic marshalling fails with JBossSeriali= zation + + Feature Request + = + * [JBREM-996] - CLONE [JBREM-971] - Enhance server-side conn= ection error handling so certain (potentially revealing) socket-related exc= eptins are not discarded + * [JBREM-997] - CLONE [JBREM-970] - Enhance client-side erro= r reporting so a misspelled truststore file name required by SSL can be eas= ily spotted + * [JBREM-1012] - CLONE [JBREM-1010] - Add feature to declara= tively turn on leasing for 2.4.0 + * [JBREM-1015] - CLONE [JBREM-1014] - Support injection of s= ocket factory class name into AbstractInvoker + = + Release + = + * [JBREM-1025] - Release 2.4.0.SP1 = + = + Task + = + * [JBREM-999] - Make sure all fixes on 2.2 branch are ported= to 2.x branch. + * [JBREM-1017] - Improve socket timeout log message + * [JBREM-1024] - Assure version compatibility with earlier v= ersions of Remoting + = Release Notes - JBoss Remoting - Version 2.4.0.GA (Pinto)<= /bridgehead> = Bug --===============7399076186027704690==-- From jboss-remoting-commits at lists.jboss.org Tue Aug 12 01:57:35 2008 Content-Type: multipart/mixed; boundary="===============1343128941132807689==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4505 - remoting2/branches/2.x/docs/guide/en. Date: Tue, 12 Aug 2008 01:57:35 -0400 Message-ID: --===============1343128941132807689== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-12 01:57:35 -0400 (Tue, 12 Aug 2008) New Revision: 4505 Modified: remoting2/branches/2.x/docs/guide/en/chap5.xml Log: JBREM-1000, JBREM-1019: Added chapter xreflabel for reference in classloade= r chapter. Modified: remoting2/branches/2.x/docs/guide/en/chap5.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/docs/guide/en/chap5.xml 2008-08-12 05:56:20 UTC = (rev 4504) +++ remoting2/branches/2.x/docs/guide/en/chap5.xml 2008-08-12 05:57:35 UTC = (rev 4505) @@ -1,5 +1,5 @@ - + Configuration = This covers the configuration for JBoss Remoting discovery, connec= tors, --===============1343128941132807689==-- From jboss-remoting-commits at lists.jboss.org Tue Aug 12 01:58:03 2008 Content-Type: multipart/mixed; boundary="===============6171899637300050544==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4506 - remoting2/branches/2.x/docs/guide/en. Date: Tue, 12 Aug 2008 01:58:03 -0400 Message-ID: --===============6171899637300050544== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-12 01:58:03 -0400 (Tue, 12 Aug 2008) New Revision: 4506 Added: remoting2/branches/2.x/docs/guide/en/chap-classloaders.xml Log: JBREM-1000, JBREM-1019: New chapter about classloading. Added: remoting2/branches/2.x/docs/guide/en/chap-classloaders.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/docs/guide/en/chap-classloaders.xml = (rev 0) +++ remoting2/branches/2.x/docs/guide/en/chap-classloaders.xml 2008-08-12 0= 5:58:03 UTC (rev 4506) @@ -0,0 +1,201 @@ + + + Remote classloading facility + + When a Remoting unmarshaller reads a serialized request or respons= e from + the network, it needs to have access to the classes of the objects conta= ined + in the serialized object. Frequently, these will be a simple combination= of + Remoting and Java objects. For example, if an application returns a + java.lang.String, it will be wrapped in an + org.jboss.remoting.InvocationResponse, and both c= lasses + will be known to the unmarshaller. But what if an application returns an + unknown implementation of a known interface? Remoting has a remote + classloading facility to support the latter scenario. + = +
+ Classloading in client invokers + + An instance of + org.jboss.remoting.marshal.serializable.SerializableUnMarsh= aller, + which is the default unmarshaller, or parent of the default unmarshall= er, + for the socket, bisocket, and http transports (marshalling and unmarsh= alling + in the rmi transport is handled by the RMI runtime), will look for cla= sses + in the following order: + = + + + + try system classloader, which loads from locations specifi= ed in the classpath; + + = + + try the Remoting classloader, that is, the classloader that + loaded the Remoting classes (which, depending on the context, ma= y or may not be the system classloader); + + = + + try to load from Remoting's remote classloading facility;<= /para> + + = + + try the current thread's context classloader. + + + = + The current thread's context classloader can be moved to the fro= nt of + the list to enable the alternative behavior: + + + = + + try the current thread's context classloader; + + + + try system classloader, which loads from locations specifi= ed in the classpath; + + = + + try the Remoting classloader, that is, the classloader that + loaded the Remoting classes (which, depending on the context, ma= y or may not be the system classloader); + + = + + try to load from Remoting's remote classloading facility.<= /para> + + + = + This alternative behavior may be enabled either by setting the + org.jboss.remoting.Remoting.CLASSLOADING_PARENT_FIRST_DELEGATION= + parameter (actual value "classloadingParentFirstDelegation") to "false= " in + the InvokerLocator or in the client invoker's + configuration map (see for m= ore on + configuration options) or by setting the system property + Remoting.CLASSLOADING_PARENT_FIRST_DELEGATION_PROP (actual value + "org.jboss.remoting.classloadingParentFirstDelegation") to "false". + = + Note that the default behavior, in the absence of any explicit a= ction + to the contrary, is for a thread's context classloader to be set to th= e same + classloader that loaded the application. However, somewhere outside of + Remoting, the context classloader may be set otherwise. For example, a + Remoting client invoker might be running inside an EJB3 container that + maintains a classloader associated with the EJB3's EAR file and sets t= he + thread context classloader to the EAR classloader whenever it passes c= ontrol + into code supplied in the EAR. This situation would arise when one EJB3 + calls another EJB3, where the invocation would ultimately be made by a + Remoting client invoker. Note, by t= he way, + the implication that this discussion about classloading in client invo= kers + applies not only to clients in the ordinary client server sense, but a= lso to + clients running inside the server. +
+ = +
+ Server side support for remote classloading + = + Remoting implements an optional remote classloading facility that + makes it possible for a client invoker unmarshaller to request copies = of + classes that it encounters during the deserialization process. This fa= cility + is provided by a special + org.jboss.remoting.transport.Connector that run= s an + org.jboss.remoting.ServerInvocationHandler desi= gned + to locate and return requested classes. This facility is enabled by + configuring a Connector with the parameter + org.jboss.remoting.InvokerLocator.LOADER_PORT (actual val= ue + "loaderport") set to an available port number. (See for more on configuration options.= ) Using + the "loaderport" parameter will result in the creation of a second + Connector which responds to requests to download + classes. + = + Prior to Remoting release 2.4.0.SP1, the classloading search + implemented by the classloading + SerrverInvocationHandler was the following: + + + + try system classloader, which loads from locations specifie= d in the classpath; + + = + + try the Remoting classloader, that is, the classloader that + loaded the Remoting classes (which, depending on the context, may= or + may not be the system classloader). + + + = + This original behavior is too restrictive in the context of the r= ich + classloading options of the JBoss Application Server. As of release + 2.4.0.SP1, it is possible to configure the classloading facility with a= list + of additional classloaders. One option is to pass a list of classloader= s to a + Connector programatically using the + org.jboss.remoting.Remoting.Remoting.REMOTE_CLASS_LOADERS + parameter (actual value "remoteClassLoaders") in either a configuration= map + or an org.jboss.remoting.ServerConfiguration. For + example: + = + +ServerConfiguration serverConfiguration =3D new ServerConfiguration("socke= t"); +Map invokerLocatorParameters =3D new HashMap(); +invokerLocatorParameters.put(InvokerLocator.LOADER_PORT, "5544"); +serverConfiguration.setInvokerLocatorParameters(invokerLocatorParameters); +Map serverParameters =3D new HashMap(); +ArrayList classLoaders =3D new ArrayList(); +classLoader1 =3D ... +classLoader2 =3D ... +classLoaders.add(classLoader1); +classLoaders.add(classLoader2); +serverParameters.put(Remoting.REMOTE_CLASS_LOADERS, classLoaders); +serverConfiguration.setServerParameters(serverParameters); +connector =3D new Connector(); +connector.setServerConfiguration(serverConfiguration); + + = + An alternative in the presence of the JBoss microcontainer, e.g.,= in + the Application Server, would be to achieve the same result declarative= ly. + For example: + = + <?xml version=3D"1.0" encoding=3D"UTF-8"?> +<deployment xmlns=3D"urn:jboss:bean-deployer:2.0"> + = + <bean name=3D"remoting:serverConfiguration" + class=3D"org.jboss.remoting.ServerConfiguration"> + <constructor> + <parameter>socket</parameter> + </constructor> + <property name=3D"invokerLocatorParameters"> + <map keyClass=3D"java.lang.String" valueClass=3D"java.lang.Str= ing"> + <entry> + <key>loaderport</key> + <value>5544</value> + </entry> + </map> + </property> + <property name=3D"serverParameters"> + <map keyClass=3D"java.lang.String" valueClass=3D"java.lang.Obj= ect"> + <entry> + <key>remoteClassLoaders</key> + <value> + <list elementClass=3D"java.lang.ClassLoader"> + <value>ear1:classloader</value> + <value>ear2:classloader</value> + </list> + </value> + </entry> + </map> + </property> + <property name=3D"invocationHandlers"> + ... + </property> + </bean> + = + <bean name=3D"remoting:connector" class=3D"org.jboss.remoting.transp= ort.Connector"> + <property name=3D"serverConfiguration"> + <inject bean=3D"remoting:serverConfiguration"/> + </property> + </bean> + = +</deployment> +
+
--===============6171899637300050544==-- From jboss-remoting-commits at lists.jboss.org Tue Aug 12 01:59:00 2008 Content-Type: multipart/mixed; boundary="===============3317451893325611942==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4507 - remoting2/branches/2.x/docs/guide/en. Date: Tue, 12 Aug 2008 01:59:00 -0400 Message-ID: --===============3317451893325611942== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-12 01:59:00 -0400 (Tue, 12 Aug 2008) New Revision: 4507 Modified: remoting2/branches/2.x/docs/guide/en/master.xml Log: JBREM-1000, JBREM-1019: New chapter about classloading; JBREM-1025: Changed= version to 2.4.0.SP1. Modified: remoting2/branches/2.x/docs/guide/en/master.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/docs/guide/en/master.xml 2008-08-12 05:58:03 UTC= (rev 4506) +++ remoting2/branches/2.x/docs/guide/en/master.xml 2008-08-12 05:59:00 UTC= (rev 4507) @@ -9,6 +9,7 @@ + @@ -23,9 +24,9 @@ JBoss Remoting Guide = - JBoss Remoting version 2.4.0.GA + JBoss Remoting version 2.4.0.SP1 = - May 28, 2008 + August 12, 2008 = @@ -55,6 +56,8 @@ &chap7; = &chap8; + = + &chap_cl; = &chap9; = --===============3317451893325611942==-- From jboss-remoting-commits at lists.jboss.org Tue Aug 12 02:02:14 2008 Content-Type: multipart/mixed; boundary="===============8179241517294528361==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4508 - remoting2/branches/2.x/docs. Date: Tue, 12 Aug 2008 02:02:14 -0400 Message-ID: --===============8179241517294528361== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-12 02:02:14 -0400 (Tue, 12 Aug 2008) New Revision: 4508 Modified: remoting2/branches/2.x/docs/README.txt Log: JBREM-1025: Added release notes for 2.4.0.SP1 release. Modified: remoting2/branches/2.x/docs/README.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/docs/README.txt 2008-08-12 05:59:00 UTC (rev 450= 7) +++ remoting2/branches/2.x/docs/README.txt 2008-08-12 06:02:14 UTC (rev 450= 8) @@ -30,6 +30,38 @@ in Jira, please create one. = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D +Release Notes - JBoss Remoting - Version 2.4.0.SP1 (Pinto) +Bug + + * [JBREM-302] - remote dynamic marshall loading not working on linux + * [JBREM-925] - SSLSocketBuilder config attribute names out of sync wi= th docs + * [JBREM-990] - CLONE [JBREM-960] - Remoting configured with Servlet i= nvoker can return misleading Exceptions when Servlet path is incorrect + * [JBREM-991] - Investigate MulticastDetector message flood + * [JBREM-1000] - CLONE [JBREM-962] - Remote classloading does not work= with Isolated EARs + * [JBREM-1005] - Prevent build up of cancelled TimerTasks in bisocket = transport + * [JBREM-1006] - SOA MTOM bug points to bug in Remoting codebase + * [JBREM-1019] - RemotingClassLoader needs option to delegate to user = class loader before parent + * [JBREM-1022] - Fix misleading javadoc in InvokerLocator + * [JBREM-1023] - Dynamic marshalling fails with JBossSerialization + +Feature Request + + * [JBREM-996] - CLONE [JBREM-971] - Enhance server-side connection err= or handling so certain (potentially revealing) socket-related exceptins are= not discarded + * [JBREM-997] - CLONE [JBREM-970] - Enhance client-side error reportin= g so a misspelled truststore file name required by SSL can be easily spotted + * [JBREM-1012] - CLONE [JBREM-1010] - Add feature to declaratively tur= n on leasing for 2.4.0 + * [JBREM-1015] - CLONE [JBREM-1014] - Support injection of socket fact= ory class name into AbstractInvoker + +Release + + * [JBREM-1025] - Release 2.4.0.SP1 + +Task + + * [JBREM-999] - Make sure all fixes on 2.2 branch are ported to 2.x br= anch. + * [JBREM-1017] - Improve socket timeout log message + * [JBREM-1024] - Assure version compatibility with earlier versions of= Remoting + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D Release Notes - JBoss Remoting - Version 2.4.0.GA = Bug --===============8179241517294528361==-- From jboss-remoting-commits at lists.jboss.org Tue Aug 12 03:03:22 2008 Content-Type: multipart/mixed; boundary="===============6039531653313794070==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4509 - remoting2/branches/2.x. Date: Tue, 12 Aug 2008 03:03:22 -0400 Message-ID: --===============6039531653313794070== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-12 03:03:21 -0400 (Tue, 12 Aug 2008) New Revision: 4509 Modified: remoting2/branches/2.x/build.xml Log: JBREM-1024: Added versioning test for 2.4.0.GA; (2) JBREM-1025: updated ver= sion to 2.4.0.SP1. Modified: remoting2/branches/2.x/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/build.xml 2008-08-12 06:02:14 UTC (rev 4508) +++ remoting2/branches/2.x/build.xml 2008-08-12 07:03:21 UTC (rev 4509) @@ -224,9 +224,9 @@ - + - + = @@ -1661,6 +1661,21 @@ = + + + + + + + + + + + + + + = + --===============6039531653313794070==-- From jboss-remoting-commits at lists.jboss.org Tue Aug 12 03:04:08 2008 Content-Type: multipart/mixed; boundary="===============1591620010947618068==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4510 - remoting2/branches/2.x/src/main/org/jboss/remoting. Date: Tue, 12 Aug 2008 03:04:08 -0400 Message-ID: --===============1591620010947618068== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-12 03:04:07 -0400 (Tue, 12 Aug 2008) New Revision: 4510 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java Log: JBREM-1025: Updated version to 2.4.0.SP1. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java 2008-08= -12 07:03:21 UTC (rev 4509) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java 2008-08= -12 07:04:07 UTC (rev 4510) @@ -34,7 +34,7 @@ public static final byte VERSION_2 =3D 2; public static final byte VERSION_2_2 =3D 22; = - public static final String VERSION =3D "2.4.0.GA (Pinto)"; + public static final String VERSION =3D "2.4.0.SP1 (Pinto)"; private static final byte byteVersion =3D VERSION_2_2; private static byte defaultByteVersion =3D byteVersion; private static boolean performVersioning =3D true; --===============1591620010947618068==-- From jboss-remoting-commits at lists.jboss.org Tue Aug 12 03:22:17 2008 Content-Type: multipart/mixed; boundary="===============2571276028138457136==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4511 - in remoting2/branches/2.x/src/etc/lib: remoting_2_4_0_GA and 1 other directory. Date: Tue, 12 Aug 2008 03:22:17 -0400 Message-ID: --===============2571276028138457136== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-12 03:22:17 -0400 (Tue, 12 Aug 2008) New Revision: 4511 Added: remoting2/branches/2.x/src/etc/lib/remoting_2_4_0_GA/ remoting2/branches/2.x/src/etc/lib/remoting_2_4_0_GA/jboss-remoting.jar Log: JBREM-1024: Added 2.4.0.GA jboss-remoting.jar for versioning test. Added: remoting2/branches/2.x/src/etc/lib/remoting_2_4_0_GA/jboss-remoting.= jar =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Property changes on: remoting2/branches/2.x/src/etc/lib/remoting_2_4_0_GA/j= boss-remoting.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream --===============2571276028138457136==-- From jboss-remoting-commits at lists.jboss.org Tue Aug 12 03:23:59 2008 Content-Type: multipart/mixed; boundary="===============7641098282771519085==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4512 - remoting2/tags. Date: Tue, 12 Aug 2008 03:23:58 -0400 Message-ID: --===============7641098282771519085== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-12 03:23:58 -0400 (Tue, 12 Aug 2008) New Revision: 4512 Added: remoting2/tags/2.4.0-SP1/ Log: Copied: remoting2/tags/2.4.0-SP1 (from rev 4511, remoting2/branches/2.x) --===============7641098282771519085==-- From jboss-remoting-commits at lists.jboss.org Wed Aug 13 02:00:09 2008 Content-Type: multipart/mixed; boundary="===============5639503892283330041==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4513 - remoting2/tags/2.4.0-SP1/docs/guide/en. Date: Wed, 13 Aug 2008 02:00:07 -0400 Message-ID: --===============5639503892283330041== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-13 02:00:06 -0400 (Wed, 13 Aug 2008) New Revision: 4513 Modified: remoting2/tags/2.4.0-SP1/docs/guide/en/chap10.xml remoting2/tags/2.4.0-SP1/docs/guide/en/chap12.xml remoting2/tags/2.4.0-SP1/docs/guide/en/chap15.xml remoting2/tags/2.4.0-SP1/docs/guide/en/chap7.xml Log: JBREM-1025: Fixed guide files mixup in tag 2.4.0.SP1. Modified: remoting2/tags/2.4.0-SP1/docs/guide/en/chap10.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/tags/2.4.0-SP1/docs/guide/en/chap10.xml 2008-08-12 07:23:58 U= TC (rev 4512) +++ remoting2/tags/2.4.0-SP1/docs/guide/en/chap10.xml 2008-08-13 06:00:06 U= TC (rev 4513) @@ -1,2634 +1,19 @@ - - - How to use it - sample code + + Transporters - beaming POJOs = - Sample code demonstrating different remoting features can be found= in - the examples directory. They can be compiled and run manually via your I= DE - or via an ant build file found in the examples directory. There are many - sets of sample code, each with their own package. Within most of these - packages, there will be a server and a client class that will need to be - executed + There are many ways in which to expose a remote interface to a j= ava + object. Some require a complex framework API based on a standard + specification and some require new technologies like annotations and A= OP. + Each of these have their own benefits. JBoss Remoting transporters pro= vide + the same behavior via a simple API without the need for any of the new= er + technologies. = -
- Simple invocation - - The simple invocation sample (found in the - org.jboss.remoting.samples.simple package), has two classes; SimpleCli= ent - and SimpleServer. It demonstrates making a simple invocation from a - remoting client to a remoting server. The SimpleClient class will crea= te - an InvokerLocator object from a simple url-like string that identifies= the - remoting server to call upon (which will be socket://localhost:5400 by - default). Then the SimpleClient will create a remoting Client class, - passing the newly created InvokerLocator. Next the Client will be call= ed - to make an invocation on the remoting server, passing the request payl= oad - object (which is a String with the value of "Do something"). The server - will return a response from this call which is printed to standard - output. - - Within the SimpleServer, a remoting server is created and starte= d. - This is done by first creating an InvokerLocator, just like was done in - the SimpleClient. Then constructing a Connector, passing the - InvokerLocator. Next, need to call create() on the Connector to initia= lize - all the resources, such as the remoting server invoker. Once created, = need - to create the invocation handler. The invocation handler is the class = that - the remoting server will pass client requests on to. The invocation - handler in this sample simply returns the simple String "This is the - return to SampleInvocationHandler invocation". Once created, the handl= er - is added to the Connector. Finally, the Connector is started and will - start listening for incoming client requests. - - To run this example, can compile both the SimpleClient and - SimpleServer class, then first run the SimpleServer and then the - SimpleClient. Or can go to the examples directory and run the ant targ= et - 'run-simple-server' and then in another console window run the ant tar= get - 'run-simple-client'. For example: - - ant run-simple-serverant - then: - - ant run-simple-clientThe output - when running the SimpleClient should look like: - - Calling remoting server with locator uri of: socket://= localhost:5400 -Invoking server with request of 'Do something' -Invocation response: This is the return to SampleInvocationHandler invocat= ion - - The output when running the SimpleServer should look like: - - Starting remoting server with locator uri of: socket:/= /localhost:5400 -Invocation request is: Do something -Returning response of: This is the return to SampleInvocationHandler invoc= ation - - Note: will have to manually shut down the SimpleServer once - started. -
- -
- HTTP invocation - - This http invocation sample (found in the - org.jboss.remoting.samples.http package), demonstrates how the http - invoker can be used for a variety of http based invocations. This time, - will start with the server side. The SimpleServer class is much like t= he - one from the previous simple invocation example, except that instead of - using the 'socket' transport, will be using the 'http' transport. Also, - instead of using the SampleInvocationHandler class as the handler, wil= l be - using the WebInvocationHandler (code shown below). - - public class WebInvocationHand= ler implements ServerInvocationHandler -{ - // Pre-defined returns to be sent back to client based on type of reque= st. - public static final String RESPONSE_VALUE =3D "This is the return to si= mple text based http invocation."; - public static final ComplexObject OBJECT_RESPONSE_VALUE =3D new Complex= Object(5, "dub", false); - public static final String HTML_PAGE_RESPONSE =3D "<html><head= ><title>Test HTML page</title></head><body>" + - "<h1>HTTP/Servlet= Test HTML page</h1><p>This is a simple page served for test." + - "<p>Should show u= p in browser or via invoker client</body></html>"; - - // Different request types that client may make - public static final String NULL_RETURN_PARAM =3D "return_null"; - public static final String OBJECT_RETURN_PARAM =3D "return_object"; - public static final String STRING_RETURN_PARAM =3D "return_string"; - - - /** - * called to handle a specific invocation - * - * @param invocation - * @return - * @throws Throwable - */ - public Object invoke(InvocationRequest invocati= on) throws Throwable - { - // Print out the invocation request - System.out.println("Invocation request from client is: " + invocatio= n.getParameter()); - if(NULL_RETURN_PARAM.equals(invocation.getParameter())) - { - return null; - } - else if(invocation.getParameter() instanceof ComplexObject) - { - return OBJECT_RESPONSE_VALUE; - } - else if(STRING_RETURN_PARAM.equals(invocation.getParameter())) - { - Map responseMetadata =3D invocation.getReturnPayload(); - responseMetadata.put(HTTPMetadataConstants.RESPONSE_CODE, new In= teger(207)); - responseMetadata.put(HTTPMetadataConstants.RESPONSE_CODE_MESSAGE,= "Custom response code and message from remoting server"); - // Just going to return static string as this is just simple exam= ple code. - return RESPONSE_VALUE; - } - else - { - return HTML_PAGE_RESPONSE; - } - } - - - The most interesting part of the WebInvocationHandler is its - invoke() method implementation. First it will check to see what the - request parameter was from the InvocationRequest and based on what the - value is, will return different responses. The first check is to see if - the client passed a request to return a null value. The second will ch= eck - to see if the request parameter from the client was of type ComplexObj= ect. - If so, return the pre-built ComplexObject that was created as a static - variable. - - After that, will check to see if the request parameter was for - returning a simple String. Notice in this block, will set the desired - response code and message to be returned to the client. In this case, = are - setting the response code to be returned to 207 and the response messa= ge - to "Custom response code and message from remoting server". These are - non-standard code and message, but can be anything desired. - - Last, if have not found a matching invocation request parameter, - will just return some simple html. - - Now onto the client side for making the calls to this handler, w= hich - can be found in SimpleClient (code shown below). - - public class SimpleClient -{ - // Default locator values - private static String transport =3D "http"; - private static String host =3D "localhost"; - private static int port =3D 5400; - - public void makeInvocation(String locatorURI) throws Throwable - { - // create InvokerLocator with the url type string - // indicating the target remoting server to call upon. - InvokerLocator locator =3D new InvokerLocator(locatorURI); - System.out.println("Calling remoting server with locator uri of: " += locatorURI); - - Client remotingClient =3D new Client(locator); - - // make invocation on remoting server and send complex data object - // by default, the remoting http client invoker will use method type= of POST, - // which is needed when ever sending objects to the server. So no m= etadata map needs - // to be passed to the invoke() method. - Object response =3D remotingClient.invoke(ne= w ComplexObject(2, "foo", true), null); - - System.out.println("\nResponse from remoting http server when making= http POST request and sending a complex data object:\n" + response); - - - Map metadata =3D new HashMap(); - // set the metadata so remoting client knows to use http GET method = type - metadata.put("TYPE", "GET"); - // not actually sending any data to the remoting server, just want t= o get its response - response =3D remotingClient.invoke((Object) = null, metadata); - - System.out.println("\nResponse from remoting http server when making= GET request:\n" + response); - - // now set type back to POST and send a plain text based request - metadata.put("TYPE", "POST"); - response =3D remotingClient.invoke(WebInvoca= tionHandler.STRING_RETURN_PARAM, metadata); - - System.out.println("\nResponse from remoting http server when making= http POST request and sending a text based request:\n" + response); - - // notice are getting custom response code and message set by web in= vocation handler - Integer responseCode =3D (Integer) metadata.= get(HTTPMetadataConstants.RESPONSE_CODE); - String responseMessage =3D (String) metadata.get(HTTPMetadataConstan= ts.RESPONSE_CODE_MESSAGE); - System.out.println("Response code from server: " + responseCode); - System.out.println("Response message from server: " + responseMessag= e); - - } - - - This SimpleClient, like the one before in the simple invocation - example, starts off by creating an InvokerLocator and remoting Client - instance, except is using http transport instead of socket. The first - invocation made is to send a newly constructed ComplexObject. If remem= ber - from the WebInvocationHandler above, will expect this invocation to re= turn - a different ComplexObject, which can be seen in the following system - output line. - - The next invocation to be made is a simple http GET request. To = do - this, must first let the remoting client know that the method type nee= ds - to be changed from the default, which is POST, to be GET. Then make the - invocation with a null payload (since not wanting to send any data, ju= st - get data in response) and the metadata map just populated with the GET - type. This invocation request will return a response of html. - - Then, will change back to being a POST type request and will pas= s a - simple String as the payload to the invocation request. This will retu= rn a - simple String as the response from the WebInvocationHandler. Afterward, - will see the specific response code and message printed to standard - output, as well as the exception itself. - - To run this example, can compile all the classes in the package, - then first run the SimpleServer and then the SimpleClient. Or can go to - the examples directory and run the ant target 'run-http-server' and th= en - in another console window run the ant target 'run-http-client'. For - example: - - ant run-http-server - - and then: - - ant run-http-client - - The output when running the SimpleClient should look like: - - Response from remoting http server when making http PO= ST request and sending a complex data object: -ComplexObject (i =3D 5, s =3D dub, b =3D false, bytes.length =3D 0) - -Response from remoting http server when making GET request: -<html><head><title>Test HTML page</title></head= ><body><h1>HTTP/Servlet Test HTML page</h1><p>Th= is is a simple page served for test.<p>Should show up in browser or v= ia invoker client</body></html> - -Response from remoting http server when making http POST request and sendi= ng a text based request: -This is the return to simple text based http invocation. -Response code from server: 207 -Response message from server: Custom response code and message from remoti= ng server - - Notice that the first response is the ComplexObject from the sta= tic - variable returned within WebInvocationHandler. The next response is ht= ml - and then simple text from the WebInvocationHandler. Can see the specif= ic - response code and message set in the WebInvocationHandler. - - The output from the SimpleServer should look like: - - Starting remoting server with locator uri of: http://l= ocalhost:5400 -Jan 26, 2006 11:39:53 PM org.apache.coyote.http11.Http11BaseProtocol init -INFO: Initializing Coyote HTTP/1.1 on http-127.0.0.1-5400 -Jan 26, 2006 11:39:53 PM org.apache.coyote.http11.Http11BaseProtocol start -INFO: Starting Coyote HTTP/1.1 on http-127.0.0.1-5400 -Invocation request from client is: ComplexObject (i =3D 2, s =3D foo, b = =3D true, bytes.length =3D 0) -Invocation request from client is: null -Invocation request from client is: return_string - - First the information for the http server invoker is written, wh= ich - includes the locator uri used to start the server and the output from - starting the Tomcat connector. Then will see the invocation parameter - passed for each client request. - - Since the SimpleServer should still be running, can open a web - browser and enter the locator uri, http://localhost:5400. This should - cause the browser to render the html returned from the - WebInvocationHandler. -
- -
- Oneway invocation - - The oneway invocation sample (found in the - org.jboss.remoting.samples.oneway package) is very similar to the simp= le - invocation example, except in this sample, the client will make - asynchronous invocations on the server. - - The OnewayClient class sets up the remoting client as in the sim= ple - invocation sample, but instead of using the invoke() method, it uses t= he - invokeOneway() method on the Client class. There are two basic modes w= hen - making a oneway invocation in remoting. The first is to have the calli= ng - thread to be the one that makes the actual call to the server. This al= lows - the caller to ensure that the invocation request at least made it to t= he - server. Once the server receives the invocation request, the call will - return (and the request will be processed by a separate worker thread = on - the server). The other mode, which is demonstrated in the second call = to - invokeOneway, allows for the calling thread to return immediately and a - worker thread on the client side will make the actual invocation on the - server. This is faster of the two modes, but if there is a problem mak= ing - the request on the server, the original caller will be unaware. - - The OnewayServer is exactly the same as the SimpleServer from the - previous example, with the exception that invocation handler returns n= ull - (since even if did return a response, would not be delivered to the - original caller). - - To run this example, can compile both the OnewayClient and - OnewayServer class, then run the OnewayServer and then the OnewayClien= t. - Or can go to the examples directory and run the ant target - 'run-oneway-server' and then in another console window run the ant tar= get - 'run-oneway-client'. For example: - - ant run-oneway-server - - and then: - - ant run-oneway-client - - The output when running the OnewayClient should look like: - - Calling remoting server with locator uri of: socket://= localhost:5400 -Making oneway invocation with payload of 'Oneway call 1.' -Making oneway invocation with payload of 'Oneway call 2.' - - The output when running the OnewayServer should look like: - - Starting remoting server with locator uri of: socket:/= /localhost:5400 -Invocation request is: Oneway call 1. -Invocation request is: Oneway call 2. - - Note: will have to manually shut down the OnewayServer once - started. - - Although this example only demonstrates making one way invocatio= ns, - could include this with callbacks (see further down) to have asynchron= ous - invocations with callbacks to verify was processed. -
- -
- Discovery and invocation - - The discovery sample (found in the - org.jboss.remoting.samples.detection package) is similar to the simple - invocation example in that it makes a simple invocation from the clien= t to - the server. However, in this example, instead of explicitly specifying= the - invoker locator to use for the target remoting server, it is discovered - dynamically during runtime. This example is composed of two classes; - SimpleDetectorClient and SimpleDetectorServer. - - The SimpleDetectorClient starts off by setting up the remoting - detector. Detection on the client side requires a few components; a JMX - MBeanServer, one or more Detectors, and a NetworkRegistry. The Detecto= rs - will listen for detection messages from remoting servers and then add = the - information for the detected servers to the NetworkRegistry. They use = JMX - to lookup and call on the NetworkRegistry. The NetworkRegistry uses JMX - Notifications to emit changes in network topology (remoting servers be= ing - added or removed). - - In this particular example, the SimpleDetectorClient is register= ed - with the NetworkRegistry as a notification listener. When it receives - notifications from the NetworkRegistry (via the handleNotification() - method), it will check to see if the notification is for adding or - removing a remoting server. If it is for adding a remoting server, the - SimpleDetectorClient will get the array of InvokerLocators from the - NetworkNotification and make a remote call for each. If the notificati= on - is for removing a remoting server, the SimpleDetectorClient will simply - print out a message saying which server has been removed. - - The biggest change between the SimpleDetectorServer and the - SimpleServer from the first sample is that have added a method, - setupDetector(), to create and start a remoting Detector. On the server - side, only two components are needed for detection; the Detector and a= JMX - MBeanServer. As for the setup of the Connector, it is exactly the same= as - before. Notice that even though we have added a Detector on the server - side, the Connector is not directly aware of either Detector or the - MBeanServer, so no code changes for the Connector setup is - required. - - To run this example, can compile both the SimpleDetectorClient a= nd - SimpleDetectorServer class, then run the SimpleDetectorServer and then= the - SimpleDetectorClient. Or can go to the examples directory and run the = ant - target 'run-detector-server' and then in another window run the ant ta= rget - 'run-detector-client'. For example: - - ant run-detector-server - - and then: - - ant run-detector-client - - The initial output when running the SimpleDetectorClient should = look - like: - - ri Jan 13 09:36:50 EST 2006: [CLIENT]: Starting JBoss/= Remoting client... to stop this client, kill it manually via Control-C -Fri Jan 13 09:36:50 EST 2006: [CLIENT]: NetworkRegistry has been created -Fri Jan 13 09:36:50 EST 2006: [CLIENT]: NetworkRegistry has added the clie= nt as a listener -Fri Jan 13 09:36:50 EST 2006: [CLIENT]: MulticastDetector has been created= and is listening for new NetworkRegistries to come online -Fri Jan 13 09:36:50 EST 2006: [CLIENT]: GOT A NETWORK-REGISTRY NOTIFICATIO= N: jboss.network.server.added -Fri Jan 13 09:36:50 EST 2006: [CLIENT]: New server(s) have been detected -= getting locators and sending welcome messages -Fri Jan 13 09:36:50 EST 2006: [CLIENT]: Sending welcome message to remotin= g server with locator uri of: socket://127.0.0.1:5400/ -Fri Jan 13 09:36:50 EST 2006: [CLIENT]: The newly discovered server sent t= his response to our welcome message: Received your welcome message. Thank = you! - - The output when running the SimpleDetectorServer should look - like: - - Fri Jan 13 09:36:46 EST 2006: [SERVER]: Starting JBoss= /Remoting server... to stop this server, kill it manually via Control-C -Fri Jan 13 09:36:46 EST 2006: [SERVER]: This server's endpoint will be: so= cket://localhost:5400 -Fri Jan 13 09:36:46 EST 2006: [SERVER]: MulticastDetector has been created= and is listening for new NetworkRegistries to come online -Fri Jan 13 09:36:46 EST 2006: [SERVER]: Starting remoting server with loca= tor uri of: socket://localhost:5400 -Fri Jan 13 09:36:46 EST 2006: [SERVER]: Added our invocation handler; we a= re now ready to begin accepting messages from clients -Fri Jan 13 09:36:50 EST 2006: [SERVER]: RECEIVED A CLIENT MESSAGE: Welcome= Aboard! -Fri Jan 13 09:36:50 EST 2006: [SERVER]: Returning the following message ba= ck to the client: Received your welcome message. Thank you! - - At this point, try stopping the SimpleDetectorServer (notice that - the SimpleDetectorClient should still be running). After a few seconds, - the client detector should detect that the server is no longer availab= le - and will see something like the following appended in the - SimpleDetectorClient console window: - - Fri Jan 13 09:37:04 EST 2006: [CLIENT]: GOT A NETWORK-= REGISTRY NOTIFICATION: jboss.network.server.removed -Fri Jan 13 09:37:04 EST 2006: [CLIENT]: It has been detected that a server= has gone down with a locator of: InvokerLocator [socket://127.0.0.1:5400/]= -
- -
- Callbacks - - The callback sample (found in the - org.jboss.remoting.samples.callback package) illustrates how to perform - callbacks from a remoting server to a remoting client. This example is - composed of two classes; CallbackClient and CallbackServer. - - Within remoting, there are two approaches in which a callback ca= n be - received. The first is to actively ask for callback messages from the - remoting server, which is called a pull callback (since are pulling the - callbacks from the server). The second is to have the server send the - callbacks to the client as they are generated, which is called a push - callback. This sample demonstrates how to do both pull and push - callbacks. - - Looking at the CallbackClient class, will see that the first thi= ng - done is to create a remoting Client, which is done in the same manner = as - previous examples. Next, we'll perform a pull callback, which requires= the - creation of a CallbackHandler. The CallbackHandler, which implements t= he - InvokerCallbackHandler interface, is what is called upon with a Callba= ck - object when a callback is received. The Callback object contains - information such as the callback message (in Object form), the server - locator from where the callback originally came from, and a handle obj= ect - which can help to identify callback context (similar to the handle obj= ect - within a JMX Notification). Once created, the CallbackHandler is then - registered as a listener within the Client. This will cause the client= to - make a call to the server to notify the server it has a callback liste= ner - (more on this below in the server section). Although the CallbackHandl= er - is not called upon directly when doing pull callbacks, it is needed as= an - identifier for the callbacks. - - Then the client will wait a few seconds, make a simple invocatio= n on - the server, and then call on the remoting Client instance to get any - callbacks that may be available for our CallbackHandler. This will ret= urn - a list of callbacks, if any exist. The list will be iterated and each - callback will be printed to standard output. Finally, the callback han= dler - will be removed as a listener from the remoting Client (which in turns - removes it from the remoting server). - - After performing a pull callback, will perform a push callback. = This - is a little more involved as requires creating a callback server to wh= ich - the remoting target server can callback on when it generates a callback - message. To do this, will need to create a remoting Connector, just as - have seen in previous examples. For this particular example, we use the - same locator url as our target remoting server, but increment the port= to - listen on by one. Will also notice that use the SampleInvocationHandler - hander from the CallbackServer (more in this in a minute). After creat= ing - our callback server, a CallbackHandler and callback handle object is - created. Next, remoting Client is called to add our callback listener. - Here we pass not only the CallbackHandler, but the InvokerLocator for = the - callback server (so the target server will know where to deliver callb= ack - messages to), and the callback handle object (which will be included in - all the callback messages delivered for this particular callback - listener). - - Then the client will wait a few seconds, to allow the target ser= ver - time to generate and deliver callback messages. After that, we remove = the - callback listener and clean up our callback server. - - The CallbackServer is pretty much the same as the previous sampl= es - in setting up the remoting server, via the Connector. The biggest chan= ge - resides in the ServerInvocationHandler implementation, - SampleInvocationHandler (which is an inner class to CallbackServer). T= he - first thing to notice is now have a variable called listeners, which i= s a - List to hold any callback listeners that get registered. Also, in the - constructor of the SampleInvocationHandler, we set up a new thread to = run - in the background. This thread, executing the run() method in - SampleInvocationHandler, will continually loop looking to see if the - shouldGenerateCallbacks has been set. If it has been, will create a - Callback object and loop through its list of listeners and tell each - listener to handle the newly created callback. Have also added - implementation to the addListener() and removeListener() methods where - will either add or remove specified callback listener from the internal - callback listener list and set the shouldGenerateCallbacks flag - accordingly. The invoke() method remains the same as in previous - samples. - - To run this example, can compile both the CallbackClient and - CallbackServer class, then run the CallbackServer and then the - CallbackClient. Or can go to the examples directory and run the ant ta= rget - 'run-callback-server' and then in another window run the ant target - 'run-callback-client. For example: - - ant run-callback-server - - and then: - - ant run-callback-client - - The output in the CallbackClient console window should look - like: - - Calling remoting server with locator uri of: socket://= localhost:5400 -Invocation response: This is the return to SampleInvocationHandler invocat= ion -Pull Callback value =3D Callback 1: This is the payload of callback invoca= tion. -Pull Callback value =3D Callback 2: This is the payload of callback invoca= tion. -Starting remoting server with locator uri of: InvokerLocator [socket://127= .0.0.1:5401/] -Received push callback. -Received callback value of: Callback 3: This is the payload of callback in= vocation. -Received callback handle object of: myCallbackHandleObject -Received callback server invoker of: InvokerLocator [socket://127.0.0.1:54= 00/] -Received push callback. -Received callback value of: Callback 4: This is the payload of callback in= vocation. -Received callback handle object of: myCallbackHandleObject -Received callback server invoker of: InvokerLocator [socket://127.0.0.1:54= 00/] - - This output shows that client first pulled two callbacks generat= ed - from the server. Then, after creating and registering our second callb= ack - handler and a callback server, two callbacks were received from the ta= rget - server. - - The output in the CallbackServer console window should look - like: - - Starting remoting server with locator uri of: socket:/= /localhost:5400 -Adding callback listener. -Invocation request is: Do something -Removing callback listener. -Adding callback listener. -Removing callback listener. - - This output shows two distinct callback handlers being added and - removed (with an invocation request being received after the first was - added). - - There are a few important points to mention about this example. - First, notice that in the client, the same callback handle object in t= he - push callbacks was received as was registered with the callback listen= er. - However, there was no special code required to facilitate this within = the - SampleInvocationHandler. This is handled within remoting automatically. - Also notice when the callback server was created within the client, no - special coding was required to register the callback handler with it, = both - were simply passed to the remoting Client instance when registering the - callback listener and was handled internally. -
- -
- Streaming - - The streaning sample (found in the org.jboss.remoting.samples.st= ream - package) illustrates how a java.io.InputStream can be sent from a clie= nt - and read on demand from a server. This example is composed of two clas= ses: - StreamingClient and StreamingServer. - - Unlike the previous examples that sent plain old java objects as= the - payload, this example will be sending a java.io.FileInputStream as the - payload to the server. This is a special case because streams can not = be - serialized. One approach to this might be to write out the contents of= a - stream to a byte buffer and send the whole data content to the server. - However, this approach can be dangerous because if the data content of= the - stream is large, such as an 800MB file, would run the risk of causing = an - out of memory error (since are loading all 800MB into memory). Another - approach, which is used by JBossRemoting, is to create a proxy to the - original stream. This proxy can then be called upon for reading, same = as - the original stream. When this happens, the proxy will call back the - original stream for the requested data. - - Looking at the StreamingClient, the remoting Client is created a= s in - previous samples. Next, will create a java.io.FileInputStream to the - sample.txt file on disk (which is in the same directory as the test - classes). Finally, will call the remoting Client to do its invocation, - passing the new FileInputStream and the name of the file. The second - parameter could be of any Object type and is meant to supply some - meaningful context to the server in regards to the stream being passed, - such as the file name to use when writing to disk on the server side. = The - response from the server, in this example, is the size of the file it - wrote to disk. - - The StreamingServer sets up the remoting server as was done in - previous examples. However, instead of using an implementation of the - ServerInvocationHandler class as the server handler, an implementation= of - the StreamInvocationHandler (which extends the ServerInvocationHandler= ) is - used. The StreamInvocationHandler includes an extra method called - handleStream() especially for processing requests with a stream as the - payload. In this example, the class implementing the - StreamInvocationHandler is the TestStreamInvocationHandler class, whic= h is - an inner class to the StreamingServer. The handleStream() method within - the TestStreamInvocationHandler will use the stream passed to it to wr= ite - out its contents to a file on disk, as specified by the second paramet= er - passed to the handleStream() method. Upon writing out the file to disk, - the handleStream() method will return to the client caller the size of= the - file. - - To run this example, can compile both the StreamingClient and - StreamingServer class, then run the StreamingServer and then the - StreamingClient. Or can go to the examples directory and run the ant - target 'run-stream-server' and then in another window run the ant targ= et - 'run-stream-client'. For example: - - ant run-stream-server - - and then: - - ant run-stream-client - - The output in the StreamingClient console window should look - like: - - Calling on remoting server with locator uri of: socket= ://localhost:5400 -Sending input stream for file sample.txt to server. -Size of file sample.txt is 987 -Server returned 987 as the size of the file read. - - The output in the StreamingServer console window should look - like: - - Starting remoting server with locator uri of: socket:/= /localhost:5400 -Received input stream from client to write out to file server_sample.txt -Read stream of size 987. Now writing to server_sample.txt -New file server_sample.txt has been written out to C:\tmp\JBossRemoting_1_= 4_0_final\examples\server_sample.txt - - After running this example, there should be a newly created - server_sample.txt file in the root examples directory. The contents of= the - file should look exactly like the contents of the sample.txt file loca= ted - in the examples\org\jboss\remoting\samples\stream directory. -
- -
- JBoss Serialization - - The serialization sample (found in the - org.jboss.remoting.samples.serialization package) illustrates how JBoss - Serialization can be used in place of the standard java serialization = to - allow for sending of invocation payload objects that do not implement = the - java.io.Serializable interface. This example is composed of three clas= ses: - SerializationClient, SerializationServer, and - NonSerializablePayload. - - This example is exactly like the one from the simple example with - two differences. The first difference is the use of JBoss Serializatio= n to - convert object instances to binary data format for wire transfer. This= is - accomplished by adding an extra parameter (serializationtype) to the - locator url with a value of 'jboss'. Is important to note that use of - JBoss Serialization requires JDK 1.5, so this example will need to be = run - using JDK 1.5. The second difference is instead of sending and receivi= ng a - simple String type for the remote invocation payload, will be sending = and - receiving an instance of the NonSerializablePayload class. - - There are a few important points to notice with the - NonSerializablePayload class. The first is that it does NOT implement = the - java.io.Serializable interface. The second is that it has a void param= eter - constructor. This is a requirement of JBoss Serialization for object - instances that do not implement the Serializable interface. However, t= his - void parameter constructor can be private, as in the case of - NonSerializablePayload, as to not change the external API of the - class. - - To run this example, can compile both the SerializationClient and - SerializationServer class, then run the SerializationServer and then t= he - SerializationClient. Or can go to the examples directory and run the a= nt - target 'run-serialization-server' and then in another window run the a= nt - target 'run-serialization-client'. For example: - - ant run-serialization-server - - and then: - - ant run-serialization-client - - The output in the SerializationClient console window should look - like: - - Calling remoting server with locator uri of: socket://= localhost:5400/?serializationtype=3Djboss -Invoking server with request of 'NonSerializablePayload - name: foo, id: 1' -Invocation response: NonSerializablePayload - name: bar, id: 2 - - The output in the SerializationServer console window should look - like: - - Starting remoting server with locator uri of: socket:/= /localhost:5400/?serializationtype=3Djboss -Invocation request is: NonSerializablePayload - name: foo, id: 1 -Returning response of: NonSerializablePayload - name: bar, id: 2 - - Note: will have to manually shut down the SerializationServer on= ce - started. -
- -
- Transporters - -
- Transporters - beaming POJOs - - There are many ways in which to expose a remote interface to a - java object. Some require a complex framework API based on a standard - specification and some require new technologies like annotations and - AOP. Each of these have their own benefits. JBoss Remoting transport= ers - provide the same behavior via a simple API without the need for any = of - the newer technologies. - - When boiled down, transporters take a plain old java object (P= OJO) - and expose a remote proxy to it via JBoss Remoting. Dynamic proxies = and - reflection are used to make the typed method calls on that target PO= JO. - Since JBoss Remoting is used, can select from a number of different - network transports (i.e. rmi, http, socket, multiplex, etc.), includ= ing - support for SSL. Even clustering features can be included. - - How it works - - In this section will discuss how remoting transporters can be - used, some requirments for usage, and a little detail on the - implementation. For greater breath on usage, please review the - transporter samples as most use cases are covered there. - - To start, will need to have a plain old java object that - implements one or more interfaces that want to expose for remote met= hod - invocation. Then will need to create a - org.jboss.remoting.transporter.TransporterServer to wrap - around it, so that can be exposed remotely. This can be done in one = of - two basic ways. The first is to use a static - createTransporterServer() method of the TransporterServ= er - class. There are many of these create methods, but all basically do = that - same thing in that they take a remoting locator and target pojo and = will - return a TransporterServer instance that has been started and ready = to - receive remote invocations (see javadoc for TransporterServer for all - the different static createTransporterServer() methods). The other w= ay - to create a TransporterServer for the target pojo is to construct an - instance of it. This provides a little more flexibility as are able = to - control more aspects of the TransporterServer, such as when it will = be - started. - - When a TransporterServer is created, it will create a remoting - Connector using the locator provided. It will generate a server - invocation handler that wraps the target pojo provided and use - reflection to make the calls on it based on the invocations it recei= ves - from clients. By default, the subsystem underwhich the server invoca= tion - handler is registered is the interface class name for which the targ= et - pojo is exposing. If the target implements multiple interfaces, and a - specific one to use is not specified, all the interfaces will be - registered as subsystems for the same server invocation handler. - Whenever no long want the target pojo to receive remote method - invocations, will need to call the stop() method on the - TransporterServer for the target pojo (this is very important, as - otherwise will never be released from memory and will continue to - consume network and memory resources). - - On the client side, in order to be able to call on the target = pojo - remotely, will need to use the - org.jboss.remoting.transporter.TransporterClient. Unlike - the TransporterServer, can only use the static create methods of the - TransporterClient (this is because the return to the static create - method is a typed dynamic proxy). The static method to call on the - TransportClient is createTransporterClient(), where will - pass the locator to find the target pojo (same as one used when crea= ting - the TransporterServer) and the interface for the target pojo that wa= nt - to make remote method invocations on. The return from this create ca= ll - will be a dynamic proxy which you can cast to to same interface type - supplied. At that point, can make typed method invocations on the - returned object, which will then make the remote invocations under t= he - covers. Note that can have multiple transporter clients to the same - target pojo, each using different interface types for making - calls. - - When no longer need to make invocations on the target pojo, the - resources associated with the remoting client will need to be cleaned - up. This is done by calling the destroyTransporterClient() - method of the TransporterClient. This is important to remember to do= , as - will otherwise leave network resources active even though not in - use. - - One of the features of using remoting transporters is location - transparency. By this mean that client proxies returned by the - TransporterClient can be passed over the network. For example, can h= ave - a target pojo that returns from a method call a client proxy (that it - created using the TransporterClient) in which the client can call on - directly as well. See the transporter proxy sample code to see how t= his - can be done. - - Another nice feature when using transporters is the ability to - cluster. To be more specific, can create multiple target pojos using= the - TransporterServer in clustered mode and then use the TransporterClie= nt - in clustered mode to create a client proxy that will discover the - location of the target pojos are wanting to call on. Will also provi= de - automatic, seemless failover of remote method invocations in the case - that a particular target pojo instance fails. However, note that only - provide invocation failover and does not take into account state - transfer between target pojos (would need addition of JBoss Cache or - some other state synchronization tool). -
- - The transporter sample spans several examples showing different = ways - to use the transporter. Each specific example is within its own package - under the org.jboss.remoting.samples.transporter package. Since each of - the transporter examples includes common objects, as well as client and - server classes, the common objects will be found under the main - transporter sub-package and the client and server classes in their - respective sub-packages (named client and server). - -
- Transporters sample - simple - - The simple transporter example (found in - org.jboss.remoting.samples.transporter.simple package) demonstrates a - very simple example of how to use the transporters to expose a plain= old - java object for remote method invocations. - - In this simple transporter example, will be taking a class that - formats a java.util.Date into a simple String representation and - exposing it so can call on the remotely. The target object in this c= ase, - org.jboss.remoting.samples.transporter.simple.DateProcessorImpl, - implements the - org.jboss.remoting.samples.transporter.simple.DateProcessor interfac= es - (as shown below): - - public interface DateProcessor -{ - public String formatDate(Date dateToConvert); -} - - -public class DateProcessorImpl implements DateProcessor -{ - public String formatDate(Date dateToConvert) - { - DateFormat dateFormat =3D DateFormat.getDateInstance(DateFormat.MEDI= UM); - return dateFormat.format(dateToConvert); - } -} - - This is then exposed using the TransporterServer by the - org.jboss.remoting.samples.transporter.simple.Server class. - - public class Server -{ - public static void main(String[] args) throws Exception - { - TransporterServer server =3D TransporterServer.createTransporterServ= er("socket://localhost:5400", new DateProcessorImpl(), DateProcessor.class.= getName()); - Thread.sleep(10000); - server.stop(); - } -} - - The Server class simply creates a TransporterServer by indicat= ing - the locator url would like to use for the remoting server, a newly - created instance of DataProcessorImpl, and the interface type would = like - to expose remotely. The TransporterServer returned from the - createTransporterServer call is live and ready to receive incoming - method invocation requests. Will then wait 10 seconds for a request, - then stop the server. - - Next need to have client to make the remote invocation. This c= an - be found within - org.jboss.remoting.samples.transporter.simple.Client. - - public class Client -{ - public static void main(String[] args) throws Exception - { - DateProcessor dateProcessor =3D (DateProcessor) TransporterClient.cr= eateTransporterClient("socket://localhost:5400", DateProcessor.class); - String formattedDate =3D dateProcessor.formatDate(new Date()); - System.out.println("Current date: " + formattedDate); - } -} - - In the Client class, create a TransporterClient which can be c= ast - to the desired type, which is DataProcessor in this case. In calling= the - createTransporterClient, need to specify the locator ulr (same as was - used for the TransporterServer), and the interface type will be call= ing - on for the target pojo. Once have the DateProcessor variable, will m= ake - the call to formatDate() and pass a newly created Date object. The - return will be a formated String of the date passed. - - To run this example, can run the Server and then the Client. Or - can go to the examples directory and run the ant target - 'run-transporter-simple-server' and then in another window run the a= nt - target 'run-transporter-simple-client'. For example: - - ant run-transporter-simple-server - - and then: - - ant run-transporter-simple-client - - The output from the client window should look similar to: - - Current date: Jul 31, 2006 -
- -
- Transporter sample - basic - - The basic transporter example (found in - org.jboss.remoting.samples.transporter.basic package) illustrates ho= w to - build a simple transporter for making remote invocations on plain old - java objects. - - In this basic transporter example, will be using a few domain - objects; Customer and Address, which are just data - objects. - - public class Customer implements Serializable -{ - private String firstName =3D null; - private String lastName =3D null; - private Address addr =3D null; - private int customerId =3D -1; - - public String getFirstName() - { - return firstName; - } - - public void setFirstName(String firstName) - { - this.firstName =3D firstName; - } - - public String getLastName() - { - return lastName; - } - - public void setLastName(String lastName) - { - this.lastName =3D lastName; - } - - public Address getAddr() - { - return addr; - } - - public void setAddr(Address addr) - { - this.addr =3D addr; - } - - public int getCustomerId() - { - return customerId; - } - - public void setCustomerId(int customerId) - { - this.customerId =3D customerId; - } - - public String toString() - { - StringBuffer buffer =3D new StringBuffer(); - buffer.append("\nCustomer:\n"); - buffer.append("customer id: " + customerId + "\n"); - buffer.append("first name: " + firstName + "\n"); - buffer.append("last name: " + lastName + "\n"); - buffer.append("street: " + addr.getStreet() + "\n"); - buffer.append("city: " + addr.getCity() + "\n"); - buffer.append("state: " + addr.getState() + "\n"); - buffer.append("zip: " + addr.getZip() + "\n"); - - return buffer.toString(); - } -} - - public class Address implements Serializable -{ - private String street =3D null; - private String city =3D null; - private String state =3D null; - private int zip =3D -1; - - public String getStreet() - { - return street; - } - - public void setStreet(String street) - { - this.street =3D street; - } - - public String getCity() - { - return city; - } - - public void setCity(String city) - { - this.city =3D city; - } - - public String getState() - { - return state; - } - - public void setState(String state) - { - this.state =3D state; - } - - public int getZip() - { - return zip; - } - - public void setZip(int zip) - { - this.zip =3D zip; - } -} - - Next comes the POJO that we want to expose a remote proxy for, - which is CustomerProcessorImpl class. This implementati= on - has one method to process a Customer object. It also - implements the CustomerProcessor interface. - - public class CustomerProcess= orImpl implements CustomerProcessor -{ - /** - * Takes the customer passed, and if not null and customer id - * is less than 0, will create a new random id and set it. - * The customer object returned will be the modified customer - * object passed. - * - * @param customer - * @return - */ - public Customer processCustomer(Customer customer) - { - if(customer !=3D null && customer.getCustomerId() < 0) - { - customer.setCustomerId(new Random().nextInt(1000)); - } - System.out.println("processed customer with new id of " + customer.g= etCustomerId()); - return customer; - } -} - - public interface CustomerPro= cessor -{ - /** - * Process a customer object. Implementors - * should ensure that the customer object - * passed as parameter should have its internal - * state changed somehow and returned. - * - * @param customer - * @return - */ - public Customer processCustomer(Customer customer); -} - - So far, nothing special, just plain old java objects. Next nee= d to - create the server component that will listen for remote request to - invoke on the target POJO. This is where the transporter comes - in. - - public class Server -{ - private String locatorURI =3D "socket://localhost:5400"; - private TransporterServer server =3D null; - - public void start() throws Exception - { - server =3D TransporterServer.createTransport= erServer(locatorURI, new CustomerProcessorImpl()); - } - - public void stop() - { - if(server !=3D null) - { - server.stop(); - } - } - - public static void main(String[] args) - { - Server server =3D new Server(); - try - { - server.start(); - - Thread.currentThread().sleep(60000); - - } - catch(Exception e) - { - e.printStackTrace(); - } - finally - { - server.stop(); - } - } -} - - The Server class is a pretty simple one. It calls= the - TransporterServer factory method to create the server - component for the CustomerProcessorImpl instance using = the - specified remoting locator information. - - The TransporterServer returned from the - createTransporterServer() call will be a running instan= ce - of a remoting server using the socket transport t= hat - is bound to localhost and listening for remote - requests on port 5400. The requests that come in = will - be forwarded to the remoting handler which will convert them into di= rect - method calls on the target POJO, CustomerProcessorImpl = in - this case, using reflection. - - The TransporterServer has a start() = and - stop() method exposed to control when to start and stop= the - running of the remoting server. The start() method is - called automatically within the createTransporterServer() - method, so is ready to receive requests upon the return of this meth= od. - The stop() method, however, needs to be called explicit= ly - when no longer wish to receive remote calls on the target POJO. - - Next up is the client side. This is represented by the - Client class. - - public class Client -{ - private String locatorURI =3D "socket://localhost:5400"; - - public void makeClientCall() throws Exception - { - Customer customer =3D createCustomer(); - - CustomerProcessor customerProcessor =3D (Cus= tomerProcessor) TransporterClient.createTransporterClient(locatorURI, Custo= merProcessor.class); - - System.out.println("Customer to be processed: " + customer); - Customer processedCustomer =3D customerProce= ssor.processCustomer(customer); - System.out.println("Customer is now: " + processedCustomer); - - TransporterClient.destroyTransporterClient(c= ustomerProcessor); - } - - private Customer createCustomer() - { - Customer cust =3D new Customer(); - cust.setFirstName("Bob"); - cust.setLastName("Smith"); - Address addr =3D new Address(); - addr.setStreet("101 Oak Street"); - addr.setCity("Atlanata"); - addr.setState("GA"); - addr.setZip(30249); - cust.setAddr(addr); - - return cust; - } - - public static void main(String[] args) - { - Client client =3D new Client(); - try - { - client.makeClientCall(); - } - catch(Exception e) - { - e.printStackTrace(); - } - } -} - - The Client class is also pretty simple. It create= s a - new Customer object instance, creates the remote proxy = to - the CustomerProcessor, and then calls on the - CustomerProcessor to process its new Customer - instance. - - To get the remote proxy for the CustomerProcessor, - all that is required is to call the TransporterClient's - method createTransporterClient() method and pass the - locator uri and the type of the remote proxy (and explicitly cast the - return to that type). This will create a dynamic proxy for the speci= fied - type, CustomerProcessor in this case, which is backed b= y a - remoting client which in turn makes the calls to the remote POJO's - remoting server. Once the call to createTransportClient() - has returned, the remoting client has already made its connection to= the - remoting server and is ready to make calls (will throw an exception = if - it could not connect to the specified remoting server). - - When finished making calls on the remote POJO proxy, will need= to - explicitly destroy the client by calling - destroyTransporterClient() and pass the remote proxy - instance. This allows the remoting client to disconnect from the POJ= O's - remoting server and clean up any network resources previously - used. - - To run this example, can run the Server and then the Client. Or - can go to the examples directory and run the ant target - 'run-transporter-basic-server' and then in another window run the ant - target 'run-transporter-basic-client'. For example: - - ant run-transporter-basic-server - - and then: - - ant run-transporter-basic-client - - The output from the Client console should be similar to: - - Customer to be processed: -Customer: -customer id: -1 -first name: Bob -last name: Smith -street: 101 Oak Street -city: Atlanata -state: GA -zip: 30249 - -Customer is now: -Customer: -customer id: 204 -first name: Bob -last name: Smith -street: 101 Oak Street -city: Atlanata -state: GA -zip: 30249 - - - - and the output from the Server class should be similar to: - - processed customer with new id of 204 - - The output shows that the Customer instance creat= ed - on the client was sent to the server where it was processed (by sett= ing - the customer id to 204) and returned to the client (and printed out - showing that the customer id was set to 204). -
- -
- Transporter sample - JBoss serialization - - The transporter serialization example (found in - org.jboss.remoting.samples.transporter.serialization package) is very - similar to the previous basic example, except in this one, the domain - objects being sent over the wire will NOT be Serializable. This is - accomplished via the use of JBoss Serialization. This can be useful = when - don't know which domain objects you may be using in remote calls or = if - adding ability for remote calls on legacy code. - - To start, there are a few more domain objects: Order, - OrderProcessor, and OrderProcessorImpl. Th= ese - will use some of the domain objects from the previous example as wel= l, - such as Customer. - - public class Order -{ - private int orderId =3D -1; - private boolean isProcessed =3D false; - private Customer customer =3D null; - private List items =3D null; - - - public int getOrderId() - { - return orderId; - } - - public void setOrderId(int orderId) - { - this.orderId =3D orderId; - } - - public boolean isProcessed() - { - return isProcessed; - } - - public void setProcessed(boolean processed) - { - isProcessed =3D processed; - } - - public Customer getCustomer() - { - return customer; - } - - public void setCustomer(Customer customer) - { - this.customer =3D customer; - } - - public List getItems() - { - return items; - } - - public void setItems(List items) - { - this.items =3D items; - } - - public String toString() - { - StringBuffer buffer =3D new StringBuffer(); - buffer.append("\nOrder:\n"); - buffer.append("\nIs processed: " + isProcessed); - buffer.append("\nOrder id: " + orderId); - buffer.append(customer.toString()); - - buffer.append("\nItems ordered:"); - Iterator itr =3D items.iterator(); - while(itr.hasNext()) - { - buffer.append("\n" + itr.next().toString()); - } - - return buffer.toString(); - } -} - - public class OrderProcessorI= mpl implements OrderProcessor -{ - private CustomerProcessor customerProcessor =3D null; - - public OrderProcessorImpl() - { - customerProcessor =3D new CustomerProcessorImpl(); - } - - public Order processOrder(Order order) - { - System.out.println("Incoming order to process from customer.\n" + or= der.getCustomer()); - - // has this customer been processed? - if(order.getCustomer().getCustomerId() < 0) - { - order.setCustomer(customerProcessor.processCustomer(order.getCust= omer())); - } - - List items =3D order.getItems(); - System.out.println("Items ordered:"); - Iterator itr =3D items.iterator(); - while(itr.hasNext()) - { - System.out.println(itr.next()); - } - - order.setOrderId(new Random().nextInt(1000)); - order.setProcessed(true); - - System.out.println("Order processed. Order id now: " + order.getOrd= erId()); - return order; - } -} - - public interface OrderProcessor -{ - public Order processOrder(Order order); -} - - The OrderProcessorImpl will take orders, via the - processOrder() method, check that the customer for the - order has been processed, and if not have the customer processor pro= cess - the new customer. Then will place the order, which means will just s= et - the order id and processed attribute to true. - - The most important point to this example is that the - Order class does NOT implement - java.io.Serializable. - - Now onto the Server class. This is just like the - previous Server class in the basic example with one main - difference: the locatorURI value. - - public class Server -{ - private String locatorURI =3D "socket://localhost:5400/?serializationtype=3Djboss"; - private TransporterServer server =3D null; - - public void start() throws Exception - { - server =3D TransporterServer.createTransporterServer(locatorURI, new= OrderProcessorImpl()); - } - - public void stop() - { - if(server !=3D null) - { - server.stop(); - } - } - - public static void main(String[] args) - { - Server server =3D new Server(); - try - { - server.start(); - - Thread.currentThread().sleep(60000); - - } - catch(Exception e) - { - e.printStackTrace(); - } - finally - { - server.stop(); - } - } -} - - The addition of serializationtype=3Djboss t= ells - the remoting framework to use JBoss Serialization in place of the - standard java serialization. - - On the client side, there is the Client class, ju= st - as in the previous basic example. - - public class Client -{ - private String locatorURI =3D "socket://localhost:5400/?serializationtype=3Djboss"; - - public void makeClientCall() throws Exception - { - Order order =3D createOrder(); - - OrderProcessor orderProcessor =3D (OrderProcessor) TransporterClient= .createTransporterClient(locatorURI, OrderProcessor.class); - - System.out.println("Order to be processed: " + order); - Order changedOrder =3D orderProcessor.processOrder(order); - System.out.println("Order now processed " + changedOrder); - - TransporterClient.destroyTransporterClient(orderProcessor); - - } - - private Order createOrder() - { - Order order =3D new Order(); - Customer customer =3D createCustomer(); - order.setCustomer(customer); - - List items =3D new ArrayList(); - items.add("Xbox 360"); - items.add("Wireless controller"); - items.add("Ghost Recon 3"); - - order.setItems(items); - - return order; - } - - private Customer createCustomer() - { - Customer cust =3D new Customer(); - cust.setFirstName("Bob"); - cust.setLastName("Smith"); - Address addr =3D new Address(); - addr.setStreet("101 Oak Street"); - addr.setCity("Atlanata"); - addr.setState("GA"); - addr.setZip(30249); - cust.setAddr(addr); - - return cust; - } - - public static void main(String[] args) - { - Client client =3D new Client(); - try - { - client.makeClientCall(); - } - catch(Exception e) - { - e.printStackTrace(); - } - } -} - - Again, the biggest difference to note is that have added - serializationtype=3Djboss to the locator uri. - - Note: Running this example requires JDK 1.5. - - To run this example, can run the Server and then the Client. Or - can go to the examples directory and run the ant target 'ant - run-transporter-serialization-server' and then in another window run= the - ant target 'ant run-transporter-serialization-client'. For - example: - - ant run-transporter-serialization-server - - and then: - - ant run-transporter-serialization-client - - When the server and client are run the output for the - Client class is: - - Order to be processed: -Order: - -Is processed: false -Order id: -1 -Customer: -customer id: -1 -first name: Bob -last name: Smith -street: 101 Oak Street -city: Atlanata -state: GA -zip: 30249 - -Items ordered: -Xbox 360 -Wireless controller -Ghost Recon 3 -Order now processed -Order: - -Is processed: true -Order id: 221 -Customer: -customer id: 861 -first name: Bob -last name: Smith -street: 101 Oak Street -city: Atlanata -state: GA -zip: 30249 - -Items ordered: -Xbox 360 -Wireless controller -Ghost Recon 3 - - - The client output shows the printout of the newly created order - before calling the OrderProcessor and then the processed - order afterwards. Noticed that the processed order has its customer'= s id - set, its order id set and the processed attribute is set to true. - - And the output from the Server is: - - Incoming order to process from customer. - -Customer: -customer id: -1 -first name: Bob -last name: Smith -street: 101 Oak Street -city: Atlanata -state: GA -zip: 30249 - -processed customer with new id of 861 -Items ordered: -Xbox 360 -Wireless controller -Ghost Recon 3 -Order processed. Order id now: 221 - - - The server output shows the printout of the customer before be= ing - processed and then the order while being processed. -
- -
- Transporter sample - clustered - - In the previous examples, there has been one and only one targ= et - POJO to make calls upon. If that target POJO was not available, the - client call would fail. In the transporter clustered example (found = in - org.jboss.remoting.samples.transporter.clustered package), will show= how - to use the transporter in clustered mode so that if one target POJO - becomes unavailable, the client call can be seamlessly failed over to - another available target POJO on the network, regardless of network - transport type. - - This example uses the domain objects from the first, basic - example, so only need to cover the client and server code. For this - example, there are three different server classes. The first class is - the SocketServer class, which is the exact same as the - Server class in the basic example, except for the call = to - the TransportServer's createTransportServer() - method. - - public class SocketServer -{ - public static String locatorURI =3D "socket://localhost:5400"; - private TransporterServer server =3D null; - - public void start() throws Exception - { - server =3D TransporterServer.createTransport= erServer(getLocatorURI(), new CustomerProcessorImpl(), - CustomerProcessor= .class.getName(), true); - } - - protected String getLocatorURI() - { - return locatorURI; - } - - public void stop() - { - if(server !=3D null) - { - server.stop(); - } - } - - public static void main(String[] args) - { - SocketServer server =3D new SocketServer(); - try - { - server.start(); - - Thread.currentThread().sleep(60000); - - } - catch(Exception e) - { - e.printStackTrace(); - } - finally - { - server.stop(); - } - } -} - - Notice that are now calling on the TransportServer to - create a server with the locator uri and target POJO - (CustomerProcessorImpl) as before, but have also added = the - interface type of the target POJO (CustomerProcessor) a= nd - that want clustering turned on (via the last true - parameter). - - The interface type of the target POJO is needed because this w= ill - be used as the subsystem within the remoting server for the target P= OJO. - The subsystem value will be what the client uses to determine if - discovered remoting server is for the target POJO they are looking - for. - - - The transporter uses the MulticastDetector from JBoss Remoti= ng - for automatic discovery when in clustered mode. The actual detecti= on - of remote servers that come online can take up to a few seconds on= ce - started. There is a JNDI based detector provided within JBoss - Remoting, but has not been integrated within the transporters - yet. - - - The second server class is the RMIServer class. T= he - RMIServer class extends the SocketServer c= lass - and uses a different locator uri to specify rmi a= s the - transport protocol and a different port - (5500). - - public class RMIServer extends SocketServer -{ - private String localLocatorURI =3D "rmi://local= host:5500"; - - protected String getLocatorURI() - { - return localLocatorURI; - } - - public static void main(String[] args) - { - SocketServer server =3D new RMIServer(); - try - { - server.start(); - - Thread.currentThread().sleep(60000); - - } - catch(Exception e) - { - e.printStackTrace(); - } - finally - { - server.stop(); - } - } -} - - The last server class is the HTTPServer class. The - HTTPServer class also extends the SocketServer - class and specifies http as the transport protocol - and 5600 as the port to listen for requests - on. - - public class HTTPServer extends SocketServer -{ - private String localLocatorURI =3D "http://loca= lhost:5600"; - - protected String getLocatorURI() - { - return localLocatorURI; - } - - public static void main(String[] args) - { - SocketServer server =3D new HTTPServer(); - try - { - server.start(); - - Thread.currentThread().sleep(60000); - - } - catch(Exception e) - { - e.printStackTrace(); - } - finally - { - server.stop(); - } - } -} - - On the client side, there is only the Client clas= s. - This class is very similar to the one from the basic example. The ma= in - exceptions are (1) the addition of a TransporterClient = call - to create a transporter client and (2) the fact that it continually - loops, making calls on its customerProcessor variable to - process customers. This is done so that when we run the client, we c= an - kill the different servers and see that the client continues to loop - making its calls without any exceptions or errors. - - public class Client -{ - private String locatorURI =3D SocketServer.loca= torURI; - - private CustomerProcessor customerProcessor =3D null; - - public void makeClientCall() throws Exception - { - Customer customer =3D createCustomer(); - - System.out.println("Customer to be processed: " + customer); - Customer processedCustomer =3D customerProce= ssor.processCustomer(customer); - System.out.println("Customer is now: " + processedCustomer); - - //TransporterClient.destroyTransporterClient(customerProcessor); - } - - public void getCustomerProcessor() throws Exception - { - customerProcessor =3D (CustomerProcessor) Tr= ansporterClient.createTransporterClient(locatorURI, CustomerProcessor.class= , true); - } - - private Customer createCustomer() - { - Customer cust =3D new Customer(); - cust.setFirstName("Bob"); - cust.setLastName("Smith"); - Address addr =3D new Address(); - addr.setStreet("101 Oak Street"); - addr.setCity("Atlanata"); - addr.setState("GA"); - addr.setZip(30249); - cust.setAddr(addr); - - return cust; - } - - public static void main(String[] args) - { - Client client =3D new Client(); - try - { - client.getCustomerProcessor(); - while(true) - { - try - { - client.makeClientCall(); - Thread.currentThread().sleep(5000); - } - catch(Exception e) - { - e.printStackTrace(); - } - } - } - catch(Exception e) - { - e.printStackTrace(); - } - } -} - - The first item of note is that the locator uri from the - SocketServer class is being used. Technically, this is = not - required as once the clustered TransporterClient is - started, it will start to discover the remoting servers that exist on - the network. However, this process can take several seconds to occur= , so - unless it is known that no calls will be made on the remote proxy ri= ght - away, it is best to bootstrap with a known target server. - - Can also see that in the main() method, the first - call on the Client instance is to getCustomerProcessor(). - This method will call the TransporterClient's - createTransporterClient() method and passes the locator= uri - for the target POJO server, the type of POJO's remote proxy, and that - clustering should be enabled. - - After getting the customer processor remote proxy, will - continually loop making calls using the remote proxy (via the - processCustomer() method on the - customerProcessor variable). - - To run this example, all the servers need to be started (by - running the SocketServer, RMIServer, and - HTTPServer classes). Then run the Client class. This ca= n be - done via ant targets as well. So for example, could open four console - windows and enter the ant targets as follows: - - ant run-transporter-clustered-socket-server - - ant run-transporter-clustered-http-server - - ant run-transporter-clustered-rmi-server - - ant run-transporter-clustered-client - - Once the client starts running, should start to see output log= ged - to the SocketServer, since this is the one used to - bootstrap. This output would look like: - - processed customer with new id of 378 -processed customer with new id of 487 -processed customer with new id of 980 - - Once the SocketServer instance has received a few - calls, kill this instance. The next time the client makes a call on = its - remote proxy, which happens every five seconds, it should fail over = to - another one of the servers (and will see similar output on that serv= er - instance). After that server has received a few calls, kill it and - should see it fail over once again to the last server instance that = is - still running. Then, if kill that server instance, will see a - CannotConnectException and stack trace similar to the following: - - ... -org.jboss.remoting.CannotConnectException: Can not connect http= client invoker. - at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnecti= on(HTTPClientInvoker.java:147) - at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClie= ntInvoker.java:56) - at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java= :112) - at org.jboss.remoting.Client.invoke(Client.java:226) - at org.jboss.remoting.Client.invoke(Client.java:189) - at org.jboss.remoting.Client.invoke(Client.java:174) - at org.jboss.remoting.transporter.TransporterClient.invoke(TransporterCli= ent.java:219) - at $Proxy0.processCustomer(Unknown Source) - at org.jboss.remoting.samples.transporter3.client.Client.makeClientCall(C= lient.java:29) - at org.jboss.remoting.samples.transporter3.client.Client.main(Client.java= :64) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j= ava:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess= orImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86) -Caused by: java.net.ConnectException: Connection refused: connect - at java.net.PlainSocketImpl.socketConnect(Native Method) - at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) - at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) - at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) - at java.net.Socket.connect(Socket.java:507) - at java.net.Socket.connect(Socket.java:457) - at sun.net.NetworkClient.doConnect(NetworkClient.java:157) - at sun.net.www.http.HttpClient.openServer(HttpClient.java:365) - at sun.net.www.http.HttpClient.openServer(HttpClient.java:477) - at sun.net.www.http.HttpClient.<init>(HttpClient.java:214) - at sun.net.www.http.HttpClient.New(HttpClient.java:287) - at sun.net.www.http.HttpClient.New(HttpClient.java:299) - at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLCo= nnection.java:792) - at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnec= tion.java:744) - at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.= java:669) - at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLCon= nection.java:836) - at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnecti= on(HTTPClientInvoker.java:117) - ... 14 more - - since there are no target servers left to make calls on. Notice - that earlier in the client output there were no errors while was fai= ling - over to the different servers as they were being killed. - - Because the CannotConnectException is being caught within the - while loop, the client will continue to try calling the remote proxy= and - getting this exception. Now re-run any of the previously killed serv= ers - and will see that the client will discover that server instance and - begin to successfully call on that server. The output should look - something like: - - ... - at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.= java:669) - at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLCon= nection.java:836) - at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnecti= on(HTTPClientInvoker.java:117) - ... 14 more - -Customer to be processed: -Customer: -customer id: -1 -first name: Bob -last name: Smith -street: 101 Oak Stree -city: Atlanata -state: null -zip: 30249 - -Customer is now: -Customer: -customer id: 633 -first name: Bob -last name: Smith -street: 101 Oak Stree -city: Atlanata -state: null -zip: 30249 - -... - - - As demonstrated in this example, fail over can occur across = any - of the JBoss Remoting transports. Clustered transporters is also - supported using JBoss Serialization, which was introduced in the - previous example. - - It is important to understand that in the context of - transporters, clustering means invocation fail over. The JBoss - Remoting transporters themselves do not handle any form of state - replication. If this feature were needed, could use JBoss Cache to - store the target POJO instances so that when their state changed, = that - change would be replicated to the other target POJO instances runn= ing - in other processes. - -
- -
- Transporters sample - multiple - - The multiple transporter example (found in - org.jboss.remoting.samples.transporter.multiple package) shows how c= an - have a multiple target pojos exposed via the same TransporterServer.= In - this example, will be two pojos being exposed, CustomerProcessorImpl= and - AccountProcessorImpl. Since the domain objects for this example is - similar to the others discussed in previous examples, will just focu= s on - the server and client code. On the server side, need to create the - TransporterServer so that will included both of the target pojos. - - public class Server -{ - private String locatorURI =3D "socket://localhost:5400"; - private TransporterServer server =3D null; - - public void start() throws Exception - { - server =3D TransporterServer.createTransporterServer(locatorURI, new= CustomerProcessorImpl(), CustomerProcessor.class.getName()); - server.addHandler(new AccountProcessorImpl(), AccountProcessor.class= .getName()); - } - - public void stop() - { - if(server !=3D null) - { - server.stop(); - } - } - - public static void main(String[] args) - { - Server server =3D new Server(); - try - { - server.start(); - - Thread.currentThread().sleep(60000); - - } - catch(Exception e) - { - e.printStackTrace(); - } - finally - { - server.stop(); - } - } -} - - The TransporterServer is created with the CustomerProcessorImp= l as - the inital target pojo. Now that have a live TransporterServer, can = add - other pojos as targets. This is done using the addHandler() method w= here - the target pojo instance is passed and then the interface type to be - exposed as. - - Next have the Client that makes the call to both pojos. - - public class Client -{ - private String locatorURI =3D "socket://localhost:5400"; - - public void makeClientCall() throws Exception - { - Customer customer =3D createCustomer(); - - CustomerProcessor customerProcessor =3D (CustomerProcessor) Transpor= terClient.createTransporterClient(locatorURI, CustomerProcessor.class); - - System.out.println("Customer to be processed: " + customer); - Customer processedCustomer =3D customerProcessor.processCustomer(cus= tomer); - System.out.println("Customer is now: " + processedCustomer); - - AccountProcessor accountProcessor =3D (AccountProcessor) Transporter= Client.createTransporterClient(locatorURI, AccountProcessor.class); - - System.out.println("Asking for a new account to be created for custo= mer."); - Account account =3D accountProcessor.createAccount(processedCustomer= ); - System.out.println("New account: " + account); - - TransporterClient.destroyTransporterClient(customerProcessor); - TransporterClient.destroyTransporterClient(accountProcessor); - - } - - private Customer createCustomer() - { - Customer cust =3D new Customer(); - cust.setFirstName("Bob"); - cust.setLastName("Smith"); - Address addr =3D new Address(); - addr.setStreet("101 Oak Street"); - addr.setCity("Atlanta"); - addr.setState("GA"); - addr.setZip(30249); - cust.setAddr(addr); - - return cust; - } - - public static void main(String[] args) - { - org.jboss.remoting.samples.transporter.multiple.client.Client client= =3D new org.jboss.remoting.samples.transporter.multiple.client.Client(); - try - { - client.makeClientCall(); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - -} - - Notice that TransporterClients are created for each target pojo - want to call upon, they just happen to share the same locator uri. T= hese - are independant instances so need to both be destroyed on their own = when - finished with them. - - To run this example, run the Server class and then the Client - class. This can be done via ant targets - 'run-transporter-multiple-server' and then - 'run-transporter-multiple-client'. For example: - - ant run-transporter-multiple-server - - and then: - - ant run-transporter-multiple-client - - The output for the server should look similar to: - - processed customer with new id of 980 -Created new account with account number: 1 and for customer: - -Customer: -customer id: 980 -first name: Bob -last name: Smith -street: 101 Oak Street -city: Atlanta -state: GA -zip: 30249 - - and the output from the client should look similar to: - - Customer to be processed: = -Customer: -customer id: -1 -first name: Bob -last name: Smith -street: 101 Oak Street -city: Atlanta -state: GA -zip: 30249 - -Customer is now: = -Customer: -customer id: 980 -first name: Bob -last name: Smith -street: 101 Oak Street -city: Atlanta -state: GA -zip: 30249 - -Asking for a new account to be created for customer. -New account: Account - account number: 1 -Customer: = -Customer: -customer id: 980 -first name: Bob -last name: Smith -street: 101 Oak Street -city: Atlanta -state: GA -zip: 30249 - -
- -
- Transporters sample - proxy - - The proxy transporter example (found in - org.jboss.remoting.samples.transporter.proxy package) shows how can = have - a TransporterClient sent over the network and called upon. In this - example, will have a target pojo, CustomerProcessorImpl which itself - creates a TransporterClient to another target pojo, Customer, and re= turn - it as response to a method invocation. - - To start, will look at the initial target pojo, - CustomerProcessorImpl. - - public class CustomerProcessorImpl implements Custom= erProcessor -{ - private String locatorURI =3D "socket://localhost:5401"; - - /** - * Takes the customer passed, and if not null and customer id - * is less than 0, will create a new random id and set it. - * The customer object returned will be the modified customer - * object passed. - * - * @param customer - * @return - */ - public ICustomer processCustomer(Customer customer) - { - if (customer !=3D null && customer.getCustomerId() < 0) - { - customer.setCustomerId(new Random().nextInt(1000)); - } - - ICustomer customerProxy =3D null; - try - { - TransporterServer server =3D TransporterServer.createTransporterS= erver(locatorURI, customer, ICustomer.class.getName()); - customerProxy =3D (ICustomer) TransporterClient.createTransporter= Client(locatorURI, ICustomer.class); - } - catch (Exception e) - { - e.printStackTrace(); - } - - System.out.println("processed customer with new id of " + customerPr= oxy.getCustomerId()); - return customerProxy; - } - -} - - Notice that the processCustomer() method will take a Customer - object and set customer id on it. Then it will create a - TransporterServer for that customer instance and also create a - TransporterClient for the same instance and return that - TransporterClient proxy as the return to the processCustomer() - method. - - Next will look at the Customer class. It is a basic data objec= t in - that is really just stores the customer data. - - public class Customer implements Serializable, ICust= omer -{ - private String firstName =3D null; - private String lastName =3D null; - private Address addr =3D null; - private int customerId =3D -1; - - public String getFirstName() - { - return firstName; - } - - public void setFirstName(String firstName) - { - this.firstName =3D firstName; - } - - public String getLastName() - { - return lastName; - } - - public void setLastName(String lastName) - { - this.lastName =3D lastName; - } - - public Address getAddr() - { - return addr; - } - - public void setAddr(Address addr) - { - this.addr =3D addr; - } - - public int getCustomerId() - { - return customerId; - } - - public void setCustomerId(int customerId) - { - this.customerId =3D customerId; - } - - public String toString() - { - System.out.println("Customer.toString() being called."); - StringBuffer buffer =3D new StringBuffer(); - buffer.append("\nCustomer:\n"); - buffer.append("customer id: " + customerId + "\n"); - buffer.append("first name: " + firstName + "\n"); - buffer.append("last name: " + lastName + "\n"); - buffer.append("street: " + addr.getStreet() + "\n"); - buffer.append("city: " + addr.getCity() + "\n"); - buffer.append("state: " + addr.getState() + "\n"); - buffer.append("zip: " + addr.getZip() + "\n"); - - return buffer.toString(); - } - - -} - - - Notice the toString() method and how it prints out to the stan= dard - out when being called. This will be important when the sample is run - later. - - Now if look at the Server class, will see is a standard setup = like - have seen in previous samples. - - public class Server -{ - private String locatorURI =3D "socket://localhost:5400"; - private TransporterServer server =3D null; - - public void start() throws Exception - { - server =3D TransporterServer.createTransporterServer(locatorURI, new= CustomerProcessorImpl(), CustomerProcessor.class.getName()); - } - - public void stop() - { - if (server !=3D null) - { - server.stop(); - } - } - - public static void main(String[] args) - { - Server server =3D new Server(); - try - { - server.start(); - - Thread.currentThread().sleep(60000); - - } - catch (Exception e) - { - e.printStackTrace(); - } - finally - { - server.stop(); - } - } -} - - It is creating a TransporterServer for the CustomerProcessImpl - upon being started and will wait 60 seconds for invocations. - - Next is the Client class. - - public class Client -{ - private String locatorURI =3D "socket://localhost:5400"; - - public void makeClientCall() throws Exception - { - Customer customer =3D createCustomer(); - - CustomerProcessor customerProcessor =3D (CustomerProcessor) Transpor= terClient.createTransporterClient(locatorURI, CustomerProcessor.class); - - System.out.println("Customer to be processed: " + customer); - ICustomer processedCustomer =3D customerProcessor.processCustomer(cu= stomer); - // processedCustomer returned is actually a proxy to the Customer in= stnace - // that lives on the server. So when print it out below, will actua= lly - // be calling back to the server to get the string (vi toString() ca= ll). - // Notice the output of 'Customer.toString() being called.' on the s= erver side. - System.out.println("Customer is now: " + processedCustomer); - - TransporterClient.destroyTransporterClient(customerProcessor); - - - } - - private Customer createCustomer() - { - Customer cust =3D new Customer(); - cust.setFirstName("Bob"); - cust.setLastName("Smith"); - Address addr =3D new Address(); - addr.setStreet("101 Oak Street"); - addr.setCity("Atlanta"); - addr.setState("GA"); - addr.setZip(30249); - cust.setAddr(addr); - - return cust; - } - - public static void main(String[] args) - { - Client client =3D new Client(); - try - { - client.makeClientCall(); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - -} - - The client class looks similar to the other example seen in th= at - it creates a TransporterClient for the CustomerProcessor and calls o= n it - to process the customer. Will then call on the ICustomer instance - returned from the processCustomer() method call and call toString() = on - it (in the system out call). - - To run this example, run the Server class and then the Client - class. This can be done via ant targets 'run-transporter-proxy-serve= r' - and then 'run-transporter-proxy-client'. For example: - - ant run-transporter-proxy-server - - ant then: - - ant run-transporter-proxy-client - - The output for the client should look similar to: - - Customer.toString() being called. -Customer to be processed: = -Customer: -customer id: -1 -first name: Bob -last name: Smith -street: 101 Oak Street -city: Atlanta -state: GA -zip: 30249 - -Customer is now: = -Customer: -customer id: 418 -first name: Bob -last name: Smith -street: 101 Oak Street -city: Atlanta -state: GA -zip: 30249 - - - The first line - is the print out from calling the Customer's toString() method that = was - created to be passed to the CustomerProcessor's processCustomer() - method. Then the contents of the Customer object before being proces= sed. - Then have the print out of the customer after has been processed. No= tice - that when the ICustomer object instance is printed out the second ti= me, - do not see the 'Customer.toString() being called'. This is because t= hat - code is no longer being executed in the client vm, but instead is a - remote call to the customer instance living on the server (remember,= the - processCustomer() method returned a TransporterClient proxy to the - customer living on the server side). - - Now, if look at output from the server will look similar - to: - - processed customer with new id of 418 -Customer.toString() being called. - - Notice that the 'Customer.toString() being called.' printed ou= t at - the end. This is the result of the client's call to print out the - contents of the customer object returned from the processCustomer() - method, which actually lives within the server vm. - - This example has shown how can pass around TransporterClient - proxies to target pojos. However, when doing this, is important to - understand where the code is actually being executed as there are - consequences to being remote verse local, which need to be - understood. -
- -
- Transporter sample -complex - - The complex transporter example (found in - org.jboss.remoting.samples.transporter.complex package) is based off= a - test case a user, Milt Grinberg, provided (thanks Milt). The example= is - similar to the previous examples, except in this case involves match= ing - Doctors and Patients using the ProviderInterface and provides a more - complex sample in which to demonstrate how to use transporters. - - This example requires JDK 1.5 to run, since is using JBoss - Serialization (and non-serialized data objects). To run this example, - run the Server class and then the Client class. This can be done via= ant - targets 'run-transporter-complex-server' and then - 'run-transporter-complex-client' as well. For example: - - ant run-transporter-complex-server - - and then: - - ant run-transporter-complex-client - - The output for the client should look similar to: - - *** Have a new patient that needs a doctor. The pat= ient is: - -Patient: - Name: Bill Gates - Ailment - Type: financial, Description: Money coming out the wazoo. - -*** Looking for doctor that can help our patient... - -*** Found doctor for our patient. Doctor found is: -Doctor: - Name: Andy Jones - Specialty: financial - Patients: - -Patient: - Name: Larry Ellison - Ailment - Type: null, Description: null - Doctor - Name: Andy Jones - -Patient: - Name: Steve Jobs - Ailment - Type: null, Description: null - Doctor - Name: Andy Jones - -Patient: - Name: Bill Gates - Ailment - Type: financial, Description: Money coming out the wazoo. - -*** Set doctor as patient's doctor. Patient info is now: - -Patient: - Name: Bill Gates - Ailment - Type: financial, Description: Money coming out the wazoo. - Doctor - Name: Andy Jones - -*** Have a new patient that we need to find a doctor for (remember, the pr= evious one retired and there are no others) -*** Could not find doctor for patient. This is an expected exception when= there are not doctors available. -org.jboss.remoting.samples.transporter.complex.NoDoctorAvailableException:= No doctor available for ailment 'financial' - at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java= :183) - at org.jboss.remoting.Client.invoke(Client.java:325) - at org.jboss.remoting.Client.invoke(Client.java:288) - at org.jboss.remoting.Client.invoke(Client.java:273) - at org.jboss.remoting.transporter.TransporterClient.invoke(TransporterCli= ent.java:237) - at $Proxy0.findDoctor(Unknown Source) - at org.jboss.remoting.samples.transporter.complex.client.Client.makeClien= tCall(Client.java:72) - at org.jboss.remoting.samples.transporter.complex.client.Client.main(Clie= nt.java:90) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j= ava:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess= orImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86) - - - From the output see the creation of a new patient, Bill Gates,= and - the attempt to find a doctor that specializes in his ailment. For Mr. - Gates, we were able to find a doctor, Andy Jones, and can see that he - has been added to the list of Dr. Jones' patients. Then we have Dr. - Jones retire. Then we create a new patient and try to find an availa= ble - doctor for the same ailment. Since Dr. Jones has retired, and there = are - no other doctors that specialize in that particular ailment, an - exception is thrown. This is as expected. -
-
- -
- Multiplex invokers - - This section illustrates the construction of multiplex invoker - groups described in the section . The - directory - -
- examples/org/jboss/remoting/samples/multiplex/invoker -
- - contains a server class, - MultiplexInvokerServer, which is suitable for u= se - with any of the client classes described below. It may be run in an ID= E or - from the command line using ant target run-multiplex-server - from the build.xml file found in the examples - directory. The server will stay alive, processing invocation requests = as - they are presented, until it has sent two push callbacks to however ma= ny - listeners are registered, at which time it will shut itself down. - - The sample clients are as follows. Each sample client - <client> may be run in an IDE or by using t= he - ant target run-<client> (e.g., - run-Client2Server1). - - - - Client2Server1: A - MultiplexClientInvoker starts according to - client rule 2, after which a - MultiplexServerInvoker is started according= to - server rule 1. Note that the Client and - Connector are passed matching - clientMultiplexId and - serverMultiplexId parameters, - respectively. - - - - Client2Server2: A - MultiplexClientInvoker starts according to - client rule 2, after which a - MultiplexServerInvoker is started according= to - server rule 2. Note that no clientMultiplexId= is - passed to the Client and no - serverMultiplexId parameter is passed to the - Connector in this example. - - - - Client3Server1: A - MultiplexClientInvoker is created, and, lac= king - binding information, finds itself governed by client rule 3. - Subsequently, a MultiplexServerInvoker is - started according to server rule 1, providing the binding informat= ion - which allows the MultiplexClientInvoker to - start. Note that the Client and - Connector are passed matching - clientMultiplexId and - serverMultiplexId parameters, - respectively. - - - - Server2Client1: A - MultiplexServerInvoker starts according to - server rule 2, after which a - MultiplexClientInvoker is started according= to - client rule 1. Note that the Connector and - Client are passed matching - serverMultiplexId and - clientMultiplexId parameters, - respectively. - - - - Server2Client2: A - MultiplexServerInvoker starts according to - server rule 2, after which a - MultiplexClientInvoker is started according= to - client rule 2. Note that no serverMultiplexId= is - passed to the Connector and no - clientMultiplexId parameter is passed to the - Client in this example. - - - - Server3Client1: A - MultiplexServerInvoker is created, and, lac= king - connect information, finds itself governed by server rule 3. - Subsequently, a MultiplexClientInvoker is - started according to client rule 1, providing the connect informat= ion - which allows the MultiplexServerInvoker to - start. Note that the Connector and - Client are passed matching - serverMultiplexId and - clientMultiplexId parameters, - respectively. - - - - For variety, the examples in which the client invoker starts fir= st - use the configuration Map to pass invoker group - parameters, and the examples in which the server invoker starts first = pass - parameters in the InvokerLocator. -
-
\ No newline at end of file + When boiled down, transporters take a plain old java object (POJ= O) + and expose a remote proxy to it via JBoss Remoting. Dynamic proxies and + reflection are used to make the typed method calls on that target POJO. + Since JBoss Remoting is used, can select from a number of different + network transports (i.e. rmi, http, socket, multiplex, etc.), including + support for SSL. Even clustering features can be included. See the + transporter samples in the next chapter for detailed examples of how to + set up use of a transporter. +
\ No newline at end of file Modified: remoting2/tags/2.4.0-SP1/docs/guide/en/chap12.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/tags/2.4.0-SP1/docs/guide/en/chap12.xml 2008-08-12 07:23:58 U= TC (rev 4512) +++ remoting2/tags/2.4.0-SP1/docs/guide/en/chap12.xml 2008-08-13 06:00:06 U= TC (rev 4513) @@ -1,17 +1,23 @@ - Compatibility and versioning + Client programming model = - As of JBossRemoting 2.0.0 versioning has been added to guarantee - compatibility between different versions. This is accomplished by chan= ging - serialization formats for certain classes and by using wire versioning= . By - wire versioning, mean that the version used by a client and server wil= l be - sent on the wire so that the other side will be able to adjust - accordingly. This will be automatic for JBossRemoting 2.0.0 and later - versions. However, since versioning was not introduced until the 2.0.0 - release, if need to have a 1.4.x version of remoting communicate to a - later version, will need to set a system property on the 2.0.0 version= so - that knows to use the older wire protocol version. The system property= to - set is 'jboss.remoting.pre_2_0_compatible' and should be set to true. - There are a few minor features that will not be fully compatible betwe= en - 1.4.x release and 2.0.0, which are listed in the release notes. + The approach taken for the programming model on the client side = is + one based on a session based model. This means that it is expected that + once a Client is created for a particular target server, it will be us= ed + exclusively to make calls on that server. This expectation dictates so= me + of the behavior of the remoting client. + + For example, if create a Client on the client side to make server + invocations, including adding callback listeners, will have to use that + same instance of Client to remove the callback listeners. This is beca= use + the Client creates a unique session id that it passes within the calls= to + the server. This id is used as part of the key for registering callback + listeners on the server. If create a new Client instance and attempt to + remove the callback listeners, a new session id will be passed to the + server invoker, who will not recognize the callback listener to be + removed. + + See test case + org.jboss.test.remoting.callback.push.MultipleCallbackServersTes= tCase + . \ No newline at end of file Modified: remoting2/tags/2.4.0-SP1/docs/guide/en/chap15.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/tags/2.4.0-SP1/docs/guide/en/chap15.xml 2008-08-12 07:23:58 U= TC (rev 4512) +++ remoting2/tags/2.4.0-SP1/docs/guide/en/chap15.xml 2008-08-13 06:00:06 U= TC (rev 4513) @@ -1,22 +1,16 @@ - - Future plans + + Known issues = - Full road map for JBossRemoting can be found at - http://jira.jboss.com/jira/browse/JBREM?report=3Dcom.atlassian.jira.pl= ugin.system.project:roadmap-panel - . - - If you have questions, comments, bugs, fixes, contributions, or - flames, please post them to the JBoss Remoting users forum + All of the known issues and road map can be found on our bug + tracking system, Jira, at + + http://jira.jboss.com/jira/secure/BrowseProject.jspa?id=3D10031 + (require member plus registration, which is free). If you find more, + please post them to Jira. If you have questions post them to the JBoss + Remoting users forum ( http://www.jboss.com/index.html?module=3Dbb&op=3Dviewforum&f= =3D222 - ). You can also find more information about JBoss Remoting on = our - - wiki ( - http://www.jboss.org/wiki/Wiki.jsp?page=3DRemoting ). The wik= i will - usually contain the latest updates to doc and features that did not ma= ke - into previous release. + ). \ No newline at end of file Modified: remoting2/tags/2.4.0-SP1/docs/guide/en/chap7.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/tags/2.4.0-SP1/docs/guide/en/chap7.xml 2008-08-12 07:23:58 UT= C (rev 4512) +++ remoting2/tags/2.4.0-SP1/docs/guide/en/chap7.xml 2008-08-13 06:00:06 UT= C (rev 4513) @@ -1,44 +1,121 @@ - - Serialization + + Sending streams = - Serialization - how it works within remoting: In general, remoti= ng - will rely on a factory to provide the serialization implementation, or - org.jboss.remoting.serialization.SerializationManager, to= be - used when doing object serialization. This factory is - org.jboss.remoting.serialization.SerializationStreamFactory - and is a (as defined by its javadoc): + Remoting supports the sending of InputStreams. It is important to + note that this feature DOES NOT copy the stream data directly from the + client to the server, but is a true on demand stream. Although this is + obviously slower than reading from a stream on the server that has been + copied locally, it does allow for true streaming on the server. It also + allows for better memory control by the user (versus the framework try= ing + to copy a 3 Gig file into memory and getting out of memory errors). = - factory is for defining the Object stream implemenation= s to be used along with creating those implemenations for use. -The main function will be to return instance of ObjectOutput and ObjectInp= ut. By default, the implementations will be = -java.io.ObjectOutputStream and java.io.ObjectInputStream. - + Use of this new feature is simple. From the client side, there i= s a + method in org.jboss.remoting.Client with the signature: = - Currently there are only two different types of serialization - implementations; 'java' and 'jboss'. The 'java' type uses - org.jboss.remoting.serialization.impl.java.JavaSerializationMana= ger - as the SerializationManager implementation and is backed by standard J= ava - serialization provide by the JVM, which is the default. The 'jboss' ty= pe - uses - org.jboss.remoting.serialization.impl.jboss.JBossSerializationMa= nager - as the SerializationManager implementation and is backed by JBoss - Serialization. + public Object invoke(InputStream inputStream, Object p= aram) throws Throwable + = - JBoss Serialization is a new project under development to provid= e a - more performant implementation of object serialization. It complies wi= th - java serialization standard with three exceptions: + So from the client side, would just call invoke as done in the p= ast, + and pass the InputStream and the payload as the parameters. An example= of + the code from the client side would be (this is taken directly from + org.jboss.test.remoting.stream.StreamingTestClient): = - - SerialUID not needed + + String param =3D "foobar"; + File testFile =3D new File(fileURL.getFile()); + ... + Object ret =3D remotingClient.invoke(fileInput, param); + = - - java.io.Serializable is not required + From the server side, will need to implement + org.jboss.remoting.stream.StreamInvocationHandler instead= of + org.jboss.remoting.ServerInvocationHandler . + StreamInvocationHandler extends ServerInvocationHandler, with the addi= tion + of one new method: = - - different protocol + public Object handleStream(InputStream stream, Object = param) = - JBoss Serialization requires JDK 1.5 + The stream passed to this method can be called on just as any + regular local stream. Under the covers, the InputStream passed is real= ly + proxy to the real input stream that exists in the client's VM. Subsequ= ent + calls to the passed stream will actually be converted to calls on the = real + stream on the client via this proxy. If the client makes an invocation= on + the server passing an InputStream as the parameter and the server hand= ler + does not implement StreamInvocationhandler, an exception will be throw= n to + the client caller. = - + If want to have more control over the stream server being create= d to + send the stream data back to the caller, instead of letting remoting + create it internally, can do this by creating a Connector to act as st= ream + server and pass it when making Client invocation. = - It is possible to override the default SerializationManger - implementation to be used by setting the system property 'SERIALIZATIO= N' - to the fully qualified name of the class to use (which will need to - provide a void constructor). + public Object invoke(InputStream inputStream, Object p= aram, Connector streamConnector) throws Throwable + + Note, the Connector passed must already have been started (else = an + exception will be thrown). The stream handler will then be added to the + connector with the subystem 'stream'. The Connector passed will NOT be + stopped when the stream is closed by the server's stream proxy (which + happens automatically when remoting creates the stream server + internally). + + Can also call invoke() method on client= and + pass the invoker locator + would like to use and allow remoting to create the stream server using= the + specified locator. + + public Object invoke(InputStream inputStream, Object p= aram, InvokerLocator streamServerLocator) throws Throwable + + In this case, the Connector created internally by remoting will = be + stopped when the stream is closed by the server's stream proxy. + + It is VERY IMPORTANT that the StreamInvocationHandler implementa= tion + close the InputStream when it finishes reading, as will close the real + stream that lives within the client VM. + +
+ Configuration + + By default, the stream server which runs within the client JVM + uses the following values for its locator uri: + + transport - socket + + host - tries to first get local host name and if that fails, t= he + local ip (if that fails, localhost). + + port - 5405 + + Currently, the only way to override these settings is to set t= he + following system properties (either via JVM arguments or via + System.setProperty() method): + + remoting.stream.transport - sets the transport type (rmi, http, + socket, etc.) + + remoting.stream.host - host name or ip address to use + + remoting.stream.port - the port to listen on + + These properties are important because currently the only way = for + a target server to get the stream data from the stream server (runni= ng + within the client JVM) is to have the server invoker make the invoca= tion + on a new connection back to the client (see issues below). +
+ +
+ Issues + + This is a first pass at the implementation and needs some work= in + regards to optimizations and configuration. In particular, there is a + remoting server that is started to service requests from the stream + proxy on the target server for data from the original stream. This + raises an issue with the current transports, since the client will h= ave + to accept calls for the original stream on a different socket. This = may + be difficult when control over the client's environment (including + firewalls) may not be available. A bi-directional transport, called + multiplex, is being introduced as of 1.4.0 release which will allow + calls from the server to go over the same socket connection establis= hed + by the client to the server (JBREM-91). This will make communications + back to client much simpler from this standpoint. +
\ No newline at end of file --===============5639503892283330041==-- From jboss-remoting-commits at lists.jboss.org Wed Aug 13 02:02:46 2008 Content-Type: multipart/mixed; boundary="===============0179248291760709170==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4514 - remoting2/tags/2.4.0-SP1/docs/guide/en. Date: Wed, 13 Aug 2008 02:02:45 -0400 Message-ID: --===============0179248291760709170== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-13 02:02:45 -0400 (Wed, 13 Aug 2008) New Revision: 4514 Modified: remoting2/tags/2.4.0-SP1/docs/guide/en/chap15.xml Log: JBREM-1025: Fixed guide files mixup in tag 2.4.0.SP1. Modified: remoting2/tags/2.4.0-SP1/docs/guide/en/chap15.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/tags/2.4.0-SP1/docs/guide/en/chap15.xml 2008-08-13 06:00:06 U= TC (rev 4513) +++ remoting2/tags/2.4.0-SP1/docs/guide/en/chap15.xml 2008-08-13 06:02:45 U= TC (rev 4514) @@ -1,4 +1,4 @@ - + Known issues = All of the known issues and road map can be found on our bug --===============0179248291760709170==-- From jboss-remoting-commits at lists.jboss.org Wed Aug 27 11:30:55 2008 Content-Type: multipart/mixed; boundary="===============7833848029404911845==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4515 - in remoting3/trunk: protocol/basic/src/test/java/org/jboss/cx/remoting/protocol/basic and 1 other directories. Date: Wed, 27 Aug 2008 11:30:55 -0400 Message-ID: --===============7833848029404911845== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: david.lloyd(a)jboss.com Date: 2008-08-27 11:30:54 -0400 (Wed, 27 Aug 2008) New Revision: 4515 Removed: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/proto= col/basic/Connection.java remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/proto= col/basic/ServiceRegistry.java remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/proto= col/basic/ServiceRegistryImpl.java Modified: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/proto= col/basic/AbstractConnection.java remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/proto= col/basic/BasicHandler.java remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/proto= col/basic/BasicProtocol.java remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/proto= col/basic/ConnectionListener.java remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/proto= col/basic/MessageType.java remoting3/trunk/protocol/basic/src/test/java/org/jboss/cx/remoting/proto= col/basic/ConnectionTestCase.java remoting3/trunk/standalone/src/main/java/org/jboss/cx/remoting/Remoting.= java Log: Pause here for a moment before ripping out marshalling stuff... Modified: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remotin= g/protocol/basic/AbstractConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/AbstractConnection.java 2008-08-13 06:02:45 UTC (rev 4514) +++ remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/AbstractConnection.java 2008-08-27 15:30:54 UTC (rev 4515) @@ -22,13 +22,13 @@ = package org.jboss.cx.remoting.protocol.basic; = -import org.jboss.cx.remoting.spi.AbstractHandleableCloseable; +import org.jboss.cx.remoting.spi.AbstractSimpleCloseable; import java.util.concurrent.Executor; = /** * */ -public abstract class AbstractConnection extends AbstractHandleableCloseab= le implements Connection { +public abstract class AbstractConnection extends AbstractSimpleCloseable { /** * Basic constructor. * Modified: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remotin= g/protocol/basic/BasicHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/BasicHandler.java 2008-08-13 06:02:45 UTC (rev 4514) +++ remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/BasicHandler.java 2008-08-27 15:30:54 UTC (rev 4515) @@ -52,7 +52,10 @@ import static org.jboss.cx.remoting.protocol.basic.MessageType.REQUEST_FAI= LED; import static org.jboss.cx.remoting.protocol.basic.MessageType.CANCEL_ACK; import static org.jboss.cx.remoting.protocol.basic.MessageType.VERSION; +import static org.jboss.cx.remoting.protocol.basic.MessageType.SERVICE_ADV= ERTISE; +import static org.jboss.cx.remoting.protocol.basic.MessageType.SERVICE_UNA= DVERTISE; import org.jboss.cx.remoting.CloseHandler; +import org.jboss.cx.remoting.Endpoint; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.BlockingQueue; import java.util.concurrent.Executor; @@ -71,16 +74,20 @@ public final class BasicHandler implements IoHandler { = private static final Logger log =3D Logger.getLogger(BasicHandler.clas= s); - private static final int LOCAL_VERSION =3D 1; + private static final int LOCAL_VERSION =3D 0x00000100; = + // running on remote node + private final ConcurrentMap outstandingRequests= =3D concurrentMap(); + // clients whose requests get forwarded to the remote side private final ConcurrentMap remoteClients =3D= concurrentMap(); - // running on remote node - private final ConcurrentMap outstandingRequests= =3D concurrentMap(); // forwarded to remote side (handled on this side) private final ConcurrentMap> forwarded= Clients =3D concurrentMap(); = - private final ServiceRegistry registry; + // services forwarded to us + private final ConcurrentMap remoteServi= ces =3D concurrentMap(); + // forwarded to remote side (handled on this side) + private final ConcurrentMap> for= wardedServices =3D concurrentMap(); = private final boolean server; private final BufferAllocator allocator; @@ -94,13 +101,13 @@ private final ClassLoader classLoader; private List localMarshallerList =3D Collections.singletonList= ("java-serialization"); private volatile String marshallerType; + private volatile int metric; private final AtomicBoolean initialized =3D new AtomicBoolean(false); = - public BasicHandler(final boolean server, final BufferAllocator allocator, final Executor executor, final MarshallerFactory marshallerFactory, final ServiceRegistry registry) { + public BasicHandler(final boolean server, final BufferAllocator allocator, final Executor executor, final MarshallerFactory marshallerFactory) { this.server =3D server; this.allocator =3D allocator; this.executor =3D executor; - this.registry =3D registry; final RequestHandlerImpl endpoint =3D new RequestHandlerImpl(0, al= locator); remoteClients.put(Integer.valueOf(0), endpoint); this.marshallerFactory =3D marshallerFactory; @@ -116,11 +123,11 @@ /** * Sequence number of local clients forwarded to the remote side. */ - private final AtomicInteger localClientIdSeq =3D new AtomicInteger(1); + private final AtomicInteger localClientIdSeq =3D new AtomicInteger(); /** * Sequence number of remote clients opened locally from services from= the remote side. */ - private final AtomicInteger remoteClientIdSeq =3D new AtomicInteger(1); + private final AtomicInteger remoteClientIdSeq =3D new AtomicInteger(); = public void handleOpened(final AllocatedMessageChannel channel) { if (isnew.getAndSet(false)) { @@ -335,6 +342,26 @@ registry.unbind(buffer.getInt()); break; } + case SERVICE_ADVERTISE: { + final int serviceId =3D buffer.getInt(); + final String serviceType =3D readUTFZ(buffer); + final String groupName =3D readUTFZ(buffer); + final String endpointName =3D readUTFZ(buffer); + final int baseMetric =3D buffer.getInt(); + Endpoint endpoint; + int id; + final RequestHandlerSource handlerSource =3D new Reque= stHandlerSourceImpl(allocator, id); + final int calcMetric =3D baseMetric + metric; + if (calcMetric > 0) { + endpoint.registerRemoteService(serviceType, groupN= ame, endpointName, handlerSource, calcMetric); + } + break; + } + case SERVICE_UNADVERTISE: { + final int serviceId =3D buffer.getInt(); + IoUtils.safeClose(remoteServices.get(Integer.valueOf(s= erviceId))); + break; + } default: { log.trace("Received invalid message type %d", Integer.= valueOf(msgType)); } Modified: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remotin= g/protocol/basic/BasicProtocol.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/BasicProtocol.java 2008-08-13 06:02:45 UTC (rev 4514) +++ remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/BasicProtocol.java 2008-08-27 15:30:54 UTC (rev 4515) @@ -23,6 +23,7 @@ package org.jboss.cx.remoting.protocol.basic; = import org.jboss.cx.remoting.RemotingException; +import org.jboss.cx.remoting.SimpleCloseable; import org.jboss.cx.remoting.spi.remote.RequestHandlerSource; import org.jboss.cx.remoting.spi.remote.Handle; import org.jboss.cx.remoting.core.marshal.JavaSerializationMarshallerFacto= ry; @@ -55,10 +56,10 @@ * @param allocator the buffer allocator to use * @return a handler factory for passing to an XNIO server */ - public static IoHandlerFactory createServer(f= inal Executor executor, final BufferAllocator allocator, final = ServiceRegistry serviceRegistry) { + public static IoHandlerFactory createServer(f= inal Executor executor, final BufferAllocator allocator) { return new IoHandlerFactory() { public IoHandler createHandle= r() { - return new BasicHandler(true, allocator, executor, new Jav= aSerializationMarshallerFactory(executor), serviceRegistry); + return new BasicHandler(true, allocator, executor, new Jav= aSerializationMarshallerFactory(executor)); } }; } @@ -69,15 +70,14 @@ * @param executor the executor to use for invocations * @param channelSource the XNIO channel source to use to establish th= e connection * @param allocator the buffer allocator to use - * @param serviceRegistry the service registry * @return a handle which may be used to close the connection * @throws IOException if an error occurs */ - public static IoFuture connect(final Executor executor, fi= nal ChannelSource channelSource, final BufferAlloc= ator allocator, final ServiceRegistry serviceRegistry) throws I= OException { - final BasicHandler basicHandler =3D new BasicHandler(false, alloca= tor, executor, new JavaSerializationMarshallerFactory(executor), serviceReg= istry); + public static IoFuture connect(final Executor executo= r, final ChannelSource channelSource, final Buffer= Allocator allocator) throws IOException { + final BasicHandler basicHandler =3D new BasicHandler(false, alloca= tor, executor, new JavaSerializationMarshallerFactory(executor)); final IoFuture futureChannel =3D channelS= ource.open(basicHandler); - return new AbstractConvertingIoFuture(futureChannel) { - protected Connection convert(final AllocatedMessageChannel cha= nnel) throws RemotingException { + return new AbstractConvertingIoFuture(futureChannel) { + protected SimpleCloseable convert(final AllocatedMessageChanne= l channel) throws RemotingException { return new AbstractConnection(executor) { public Handle getServiceForId(fi= nal int id) throws IOException { return basicHandler.getRemoteService(id).getHandle= (); Deleted: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting= /protocol/basic/Connection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/Connection.java 2008-08-13 06:02:45 UTC (rev 4514) +++ remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/Connection.java 2008-08-27 15:30:54 UTC (rev 4515) @@ -1,36 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2008, 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.cx.remoting.protocol.basic; - -import org.jboss.cx.remoting.spi.remote.RequestHandlerSource; -import org.jboss.cx.remoting.spi.remote.Handle; -import org.jboss.cx.remoting.HandleableCloseable; -import org.jboss.cx.remoting.RemotingException; -import java.io.IOException; - -/** - * - */ -public interface Connection extends HandleableCloseable { - Handle getServiceForId(int id) throws IOExceptio= n; -} Modified: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remotin= g/protocol/basic/ConnectionListener.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/ConnectionListener.java 2008-08-13 06:02:45 UTC (rev 4514) +++ remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/ConnectionListener.java 2008-08-27 15:30:54 UTC (rev 4515) @@ -22,9 +22,11 @@ = package org.jboss.cx.remoting.protocol.basic; = +import org.jboss.cx.remoting.SimpleCloseable; + /** * */ public interface ConnectionListener { - void handleOpened(Connection connection); + void handleOpened(SimpleCloseable connection); } Modified: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remotin= g/protocol/basic/MessageType.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/MessageType.java 2008-08-13 06:02:45 UTC (rev 4514) +++ remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/MessageType.java 2008-08-27 15:30:54 UTC (rev 4515) @@ -26,12 +26,19 @@ * */ public final class MessageType { + // Initial version & marshaller negotiation public static final int VERSION =3D 0; + // One-way request, no return value may be sent public static final int REQUEST_ONEWAY =3D 1; + // Two-way request, return value is expected public static final int REQUEST =3D 2; + // Reply public static final int REPLY =3D 3; + // Attempt to cancel a request public static final int CANCEL_REQUEST =3D 4; + // Acknowledge that a request was cancelled public static final int CANCEL_ACK =3D 5; + // Request failed due to exception public static final int REQUEST_FAILED =3D 6; // Remote side called .close() on a forwarded RequestHandler public static final int CLIENT_CLOSE =3D 7; Deleted: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting= /protocol/basic/ServiceRegistry.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/ServiceRegistry.java 2008-08-13 06:02:45 UTC (rev 4514) +++ remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/ServiceRegistry.java 2008-08-27 15:30:54 UTC (rev 4515) @@ -1,43 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2008, 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.cx.remoting.protocol.basic; - -import org.jboss.cx.remoting.spi.remote.RequestHandlerSource; -import org.jboss.cx.remoting.spi.remote.Handle; -import org.jboss.cx.remoting.RemotingException; -import java.io.IOException; - -/** - * - */ -public interface ServiceRegistry { - int bind(RequestHandlerSource requestHandlerSource) throws IOException; - - void bind(RequestHandlerSource requestHandlerSource, int id) throws IO= Exception; - - void unbind(int id) throws RemotingException; - - void clear(); - - Handle lookup(int id) throws IOException; -} Deleted: remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting= /protocol/basic/ServiceRegistryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/ServiceRegistryImpl.java 2008-08-13 06:02:45 UTC (rev 4514) +++ remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/prot= ocol/basic/ServiceRegistryImpl.java 2008-08-27 15:30:54 UTC (rev 4515) @@ -1,112 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2008, 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.cx.remoting.protocol.basic; - -import org.jboss.cx.remoting.spi.remote.RequestHandlerSource; -import org.jboss.cx.remoting.spi.remote.Handle; -import org.jboss.cx.remoting.RemotingException; -import org.jboss.cx.remoting.util.CollectionUtil; -import org.jboss.xnio.IoUtils; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.Iterator; -import java.io.IOException; - -/** - * - */ -public final class ServiceRegistryImpl implements ServiceRegistry { - - private static final int START =3D 32768; - - private final ConcurrentMap> map= =3D CollectionUtil.concurrentMap(); - private final AtomicInteger dynamicSequence =3D new AtomicInteger(STAR= T); - private final ServiceRegistry parent; - - public ServiceRegistryImpl(final ServiceRegistry parent) { - this.parent =3D parent; - } - - public ServiceRegistryImpl() { - parent =3D null; - } - - public int bind(final RequestHandlerSource requestHandlerSource) throw= s IOException { - final Handle handle =3D requestHandlerSource= .getHandle(); - boolean ok =3D false; - try { - for (;;) { - final int seqVal =3D dynamicSequence.getAndIncrement(); - if (seqVal < 0) { - dynamicSequence.compareAndSet(seqVal, START); - continue; - } - if (map.putIfAbsent(Integer.valueOf(seqVal), handle) !=3D = null) { - ok =3D true; - return seqVal; - } - } - } finally { - if (! ok) { - IoUtils.safeClose(handle); - } - } - } - - public void bind(final RequestHandlerSource requestHandlerSource, fina= l int id) throws IOException { - final Handle handle =3D requestHandlerSource= .getHandle(); - boolean ok =3D false; - try { - if (map.putIfAbsent(Integer.valueOf(id), handle) !=3D null) { - throw new RemotingException("Service already bound to that= ID"); - } - ok =3D true; - } finally { - if (! ok) { - IoUtils.safeClose(handle); - } - } - } - - public void unbind(final int id) throws RemotingException { - map.remove(Integer.valueOf(id)); - } - - public void clear() { - Iterator> it =3D map.values().iterato= r(); - while (it.hasNext()) { - IoUtils.safeClose(it.next()); - it.remove(); - } - } - - public Handle lookup(final int id) throws IOExce= ption { - final Handle handle =3D map.get(Integer.valu= eOf(id)); - return handle !=3D null || parent =3D=3D null ? handle.getResource= ().getHandle() : parent.lookup(id); - } - - protected void finalize() throws Throwable { - clear(); - super.finalize(); - } -} Modified: remoting3/trunk/protocol/basic/src/test/java/org/jboss/cx/remotin= g/protocol/basic/ConnectionTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/protocol/basic/src/test/java/org/jboss/cx/remoting/prot= ocol/basic/ConnectionTestCase.java 2008-08-13 06:02:45 UTC (rev 4514) +++ remoting3/trunk/protocol/basic/src/test/java/org/jboss/cx/remoting/prot= ocol/basic/ConnectionTestCase.java 2008-08-27 15:30:54 UTC (rev 4515) @@ -39,6 +39,7 @@ import org.jboss.cx.remoting.ClientSource; import org.jboss.cx.remoting.Client; import org.jboss.cx.remoting.AbstractRequestListener; +import org.jboss.cx.remoting.SimpleCloseable; import org.jboss.cx.remoting.spi.remote.RequestHandlerSource; import org.jboss.cx.remoting.spi.remote.Handle; import org.jboss.xnio.BufferAllocator; @@ -83,7 +84,6 @@ endpoint.setExecutor(closeableExecutor); endpoint.start(); try { - final ServiceRegistry serviceRegistry =3D new ServiceR= egistryImpl(); try { final Handle requestHandlerS= ourceHandle =3D endpoint.createRequestHandlerSource(new AbstractRequestList= ener() { public void handleRequest(final RequestContext= context, final Object request) throws RemoteExecutionException { @@ -96,7 +96,7 @@ }, null, null); try { serviceRegistry.bind(requestHandlerSourceHandl= e.getResource(), 13); - final IoHandlerFactory handlerFactory =3D BasicProtocol.createServer(closeableExecutor, allocato= r, serviceRegistry); + final IoHandlerFactory handlerFactory =3D BasicProtocol.createServer(closeableExecutor, allocato= r); final IoHandlerFactory newHandl= erFactory =3D Channels.convertStreamToAllocatedMessage(handlerFactory, 3276= 8, 32768); final Closeable tcpServerCloseable =3D xnio.cr= eateTcpServer(newHandlerFactory, new InetSocketAddress(12345)).create(); try { @@ -104,8 +104,8 @@ try { final TcpClient tcpClient =3D connecto= r.createChannelSource(new InetSocketAddress("localhost", 12345)); final ChannelSource channelSource =3D Channels.convertStreamToAllocatedMessage(tcpClient= , 32768, 32768); - final IoFuture futureClose= able =3D BasicProtocol.connect(closeableExecutor, channelSource, allocator,= serviceRegistry); - final Connection connection =3D future= Closeable.get(); + final IoFuture future= Closeable =3D BasicProtocol.connect(closeableExecutor, channelSource, alloc= ator); + final SimpleCloseable connection =3D f= utureCloseable.get(); try { final Handle= handleThirteen =3D connection.getServiceForId(13); try { Modified: remoting3/trunk/standalone/src/main/java/org/jboss/cx/remoting/Re= moting.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting3/trunk/standalone/src/main/java/org/jboss/cx/remoting/Remoting= .java 2008-08-13 06:02:45 UTC (rev 4514) +++ remoting3/trunk/standalone/src/main/java/org/jboss/cx/remoting/Remoting= .java 2008-08-27 15:30:54 UTC (rev 4515) @@ -41,8 +41,8 @@ } } = - public static ClientSource createLocalClientSource(Endpoi= nt endpoint, RequestListener requestListener) throws IOException { - final Handle handle =3D endpoint.createReque= stHandlerSource(requestListener, INIT_ME, INIT_ME); + public static ClientSource createLocalClientSource(Endpoi= nt endpoint, RequestListener requestListener, final String serviceTyp= e, final String groupName) throws IOException { + final Handle handle =3D endpoint.createReque= stHandlerSource(requestListener, serviceType, groupName); try { return endpoint.createClientSource(handle.getResource()); } finally { --===============7833848029404911845==-- From jboss-remoting-commits at lists.jboss.org Thu Aug 28 21:16:57 2008 Content-Type: multipart/mixed; boundary="===============7340895019205613492==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4516 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http. Date: Thu, 28 Aug 2008 21:16:56 -0400 Message-ID: --===============7340895019205613492== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-28 21:16:55 -0400 (Thu, 28 Aug 2008) New Revision: 4516 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPMe= tadataConstants.java Log: JBREM-1027: Added QUERY. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http= /HTTPMetadataConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPM= etadataConstants.java 2008-08-27 15:30:54 UTC (rev 4515) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPM= etadataConstants.java 2008-08-29 01:16:55 UTC (rev 4516) @@ -33,6 +33,7 @@ { public static final String METHODTYPE =3D "MethodType"; public static final String PATH =3D "Path"; + public static final String QUERY =3D "Query"; public static final String HTTPVERSION =3D "HttpVersion"; public static final String RESPONSE_CODE =3D "ResponseCode"; public static final String CONTENTTYPE =3D "Content-Type"; --===============7340895019205613492==-- From jboss-remoting-commits at lists.jboss.org Thu Aug 28 21:17:28 2008 Content-Type: multipart/mixed; boundary="===============4705534638026031437==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4517 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/coyote. Date: Thu, 28 Aug 2008 21:17:28 -0400 Message-ID: --===============4705534638026031437== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-28 21:17:28 -0400 (Thu, 28 Aug 2008) New Revision: 4517 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/coyote/Coyo= teInvoker.java Log: JBREM-1027: Puts QUERY in InvocationRequest request map. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/coyo= te/CoyoteInvoker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/coyote/Coy= oteInvoker.java 2008-08-29 01:16:55 UTC (rev 4516) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/coyote/Coy= oteInvoker.java 2008-08-29 01:17:28 UTC (rev 4517) @@ -630,6 +630,7 @@ = metadata.put(HTTPMetadataConstants.METHODTYPE, req.method().getStrin= g()); metadata.put(HTTPMetadataConstants.PATH, req.requestURI().getString(= )); + metadata.put(HTTPMetadataConstants.QUERY, req.query().toString()); metadata.put(HTTPMetadataConstants.HTTPVERSION, req.protocol().getSt= ring()); = } --===============4705534638026031437==-- From jboss-remoting-commits at lists.jboss.org Thu Aug 28 21:18:59 2008 Content-Type: multipart/mixed; boundary="===============7200384558031617223==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4518 - in remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http: query and 1 other directory. Date: Thu, 28 Aug 2008 21:18:58 -0400 Message-ID: --===============7200384558031617223== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-28 21:18:58 -0400 (Thu, 28 Aug 2008) New Revision: 4518 Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/= query/ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/= query/URLQueryTestCase.java Log: JBREM-1027: New unit test. Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/h= ttp/query/URLQueryTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http= /query/URLQueryTestCase.java (rev 0) +++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http= /query/URLQueryTestCase.java 2008-08-29 01:18:58 UTC (rev 4518) @@ -0,0 +1,167 @@ +/* +* 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.transport.http.query; + +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.ServerInvocationHandler; +import org.jboss.remoting.ServerInvoker; +import org.jboss.remoting.callback.InvokerCallbackHandler; +import org.jboss.remoting.transport.Connector; +import org.jboss.remoting.transport.PortUtil; +import org.jboss.remoting.transport.http.HTTPMetadataConstants; + + +/** + * Unit test for JBREM-1027. + * = + * @author Ron Sigal + * @version $Revision: 1.1 $ + *

+ * Copyright Aug 28, 2008 + *

+ */ +public class URLQueryTestCase extends TestCase +{ + private static Logger log =3D Logger.getLogger(URLQueryTestCase.class); + = + private static boolean firstTime =3D true; + protected static final String QUERY =3D "a=3Dy&b=3Dz"; + = + 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 =3D false; + Logger.getLogger("org.jboss.remoting").setLevel(XLevel.INFO); + Logger.getLogger("org.jboss.test.remoting").setLevel(Level.INFO); + String pattern =3D "[%d{ABSOLUTE}] [%t] %5p (%F:%L) - %m%n"; + PatternLayout layout =3D new PatternLayout(pattern); + ConsoleAppender consoleAppender =3D new ConsoleAppender(layout); + Logger.getRootLogger().addAppender(consoleAppender); = + } + } + + = + public void tearDown() + { + } + = + = + public void testQueryInRequestMap() throws Throwable + { + log.info("entering " + getName()); + = + // Start server. + setupServer(); + = + // Create client. + InvokerLocator clientLocator =3D new InvokerLocator(locatorURI); + HashMap clientConfig =3D new HashMap(); + clientConfig.put(InvokerLocator.FORCE_REMOTE, "true"); + addExtraClientConfig(clientConfig); + Client client =3D new Client(clientLocator, clientConfig); + client.connect(); + log.info("client is connected"); + = + // Test connections. + Object response =3D client.invoke("abc"); + log.info("response: " + response); + assertEquals(QUERY, response); + = + client.disconnect(); + shutdownServer(); + log.info(getName() + " PASSES"); + } + = + = + protected String getTransport() + { + return "http"; + } + = + = + protected void addExtraClientConfig(Map config) {} + protected void addExtraServerConfig(Map config) {} + = + + protected void setupServer() throws Exception + { + host =3D InetAddress.getLocalHost().getHostAddress(); + port =3D PortUtil.findFreePort(host); + locatorURI =3D getTransport() + "://" + host + ":" + port + "/?" + Q= UERY; = + serverLocator =3D new InvokerLocator(locatorURI); + log.info("Starting remoting server with locator uri of: " + locatorU= RI); + HashMap config =3D new HashMap(); + config.put(InvokerLocator.FORCE_REMOTE, "true"); + addExtraServerConfig(config); + connector =3D new Connector(serverLocator, config); + connector.create(); + invocationHandler =3D new TestInvocationHandler(); + connector.addInvocationHandler("test", invocationHandler); + connector.start(); + } + = + = + protected void shutdownServer() throws Exception + { + if (connector !=3D null) + connector.stop(); + } + = + = + static class TestInvocationHandler implements ServerInvocationHandler + { + public void addListener(InvokerCallbackHandler callbackHandler) {} + public Object invoke(final InvocationRequest invocation) throws Thro= wable + { + Map requestMap =3D invocation.getRequestPayload(); + log.info("query: " + requestMap.get(HTTPMetadataConstants.QUERY)); + return requestMap.get(HTTPMetadataConstants.QUERY); + } + public void removeListener(InvokerCallbackHandler callbackHandler) {} + public void setMBeanServer(MBeanServer server) {} + public void setInvoker(ServerInvoker invoker) {} + } +} \ No newline at end of file --===============7200384558031617223==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 30 02:20:11 2008 Content-Type: multipart/mixed; boundary="===============4681269806481443429==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4519 - remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/java. Date: Sat, 30 Aug 2008 02:20:07 -0400 Message-ID: --===============4681269806481443429== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-30 02:20:07 -0400 (Sat, 30 Aug 2008) New Revision: 4519 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/ja= va/JavaSerializationManager.java Log: JBREM-1028: Uses ClearableObjectOutputStream. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/= impl/java/JavaSerializationManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/j= ava/JavaSerializationManager.java 2008-08-29 01:18:58 UTC (rev 4518) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/j= ava/JavaSerializationManager.java 2008-08-30 06:20:07 UTC (rev 4519) @@ -60,7 +60,7 @@ { log.trace("Creating ObjectOutputStream"); } - return new ObjectOutputStream(output); + return new ClearableObjectOutputStream(output); = } = /** @@ -119,6 +119,11 @@ oos.reset(); oos.writeObject(dataObject); oos.flush(); + = + if (oos instanceof ClearableObjectOutputStream) + { + ((ClearableObjectOutputStream) oos).clear(); + } } = public Object receiveObject(InputStream inputStream, ClassLoader custom= ClassLoader, int version) throws IOException, ClassNotFoundException --===============4681269806481443429==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 30 02:21:09 2008 Content-Type: multipart/mixed; boundary="===============5004331420049207714==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4520 - remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/java. Date: Sat, 30 Aug 2008 02:21:09 -0400 Message-ID: --===============5004331420049207714== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-30 02:21:08 -0400 (Sat, 30 Aug 2008) New Revision: 4520 Added: remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/ja= va/ClearableObjectOutputStream.java Log: JBREM-1028: Extends ObjectOutputStream and exposes clear(). Added: remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/imp= l/java/ClearableObjectOutputStream.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/j= ava/ClearableObjectOutputStream.java (rev 0) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/j= ava/ClearableObjectOutputStream.java 2008-08-30 06:21:08 UTC (rev 4520) @@ -0,0 +1,78 @@ + +/* +* 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.remoting.serialization.impl.java; + +import java.io.IOException; +import java.io.ObjectOutputStream; +import java.io.OutputStream; +import java.lang.reflect.Method; + +import org.jboss.logging.Logger; +import org.jboss.remoting.util.SecurityUtility; + +/** + * @author Ron Sigal + * @version $Revision: 1.1 $ + *

+ * Copyright Aug 27, 2008 + *

+ */ +public class ClearableObjectOutputStream extends ObjectOutputStream +{ + protected static Logger log =3D Logger.getLogger(ClearableObjectOutputS= tream.class); + protected static Method clearMethod; + = + static + { + try + { + clearMethod =3D SecurityUtility.getDeclaredMethod(ObjectOutputStr= eam.class, "clear", new Class[]{}); + } + catch (SecurityException e) + { + log.error(e.getMessage(), e); + } + catch (NoSuchMethodException e) + { + log.error(e.getMessage(), e); + } + } + = + public ClearableObjectOutputStream(OutputStream out) throws IOException + { + super(out); = + } + = + public void clear() + { + try + { + clearMethod.invoke(this, new Object[]{}); + } + catch (Throwable e) + { + log.error(e.getMessage(), e); + } + } +} + --===============5004331420049207714==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 30 02:29:39 2008 Content-Type: multipart/mixed; boundary="===============4623693657927164968==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4521 - remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/java. Date: Sat, 30 Aug 2008 02:29:38 -0400 Message-ID: --===============4623693657927164968== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-30 02:29:38 -0400 (Sat, 30 Aug 2008) New Revision: 4521 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/ja= va/ClearableObjectOutputStream.java Log: JBREM-1028: Reflective call to clear() uses a preconstructed parameter arra= y. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/= impl/java/ClearableObjectOutputStream.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/j= ava/ClearableObjectOutputStream.java 2008-08-30 06:21:08 UTC (rev 4520) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/j= ava/ClearableObjectOutputStream.java 2008-08-30 06:29:38 UTC (rev 4521) @@ -41,6 +41,7 @@ { protected static Logger log =3D Logger.getLogger(ClearableObjectOutputS= tream.class); protected static Method clearMethod; + protected static Object[] PARAMS =3D new Object[]{}; = static { @@ -67,7 +68,7 @@ { try { - clearMethod.invoke(this, new Object[]{}); + clearMethod.invoke(this, PARAMS); } catch (Throwable e) { --===============4623693657927164968==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 30 03:02:57 2008 Content-Type: multipart/mixed; boundary="===============1832881769301876341==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4522 - remoting2/branches/2.2/src/main/org/jboss/remoting/transport/coyote. Date: Sat, 30 Aug 2008 03:02:57 -0400 Message-ID: --===============1832881769301876341== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-30 03:02:57 -0400 (Sat, 30 Aug 2008) New Revision: 4522 Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/transport/coyote/Coyo= teInvoker.java Log: JBREM-1027: Puts QUERY in InvocationRequest request map. Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/transport/coyo= te/CoyoteInvoker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.2/src/main/org/jboss/remoting/transport/coyote/Coy= oteInvoker.java 2008-08-30 06:29:38 UTC (rev 4521) +++ remoting2/branches/2.2/src/main/org/jboss/remoting/transport/coyote/Coy= oteInvoker.java 2008-08-30 07:02:57 UTC (rev 4522) @@ -534,6 +534,7 @@ = metadata.put(HTTPMetadataConstants.METHODTYPE, req.method().getStrin= g()); metadata.put(HTTPMetadataConstants.PATH, req.requestURI().getString(= )); + metadata.put(HTTPMetadataConstants.QUERY, req.query().toString()); metadata.put(HTTPMetadataConstants.HTTPVERSION, req.protocol().getSt= ring()); = } --===============1832881769301876341==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 30 03:03:13 2008 Content-Type: multipart/mixed; boundary="===============7981930021845615363==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4523 - remoting2/branches/2.2/src/main/org/jboss/remoting/transport/http. Date: Sat, 30 Aug 2008 03:03:13 -0400 Message-ID: --===============7981930021845615363== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-30 03:03:13 -0400 (Sat, 30 Aug 2008) New Revision: 4523 Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/transport/http/HTTPMe= tadataConstants.java Log: JBREM-1027: Added QUERY. Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/transport/http= /HTTPMetadataConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.2/src/main/org/jboss/remoting/transport/http/HTTPM= etadataConstants.java 2008-08-30 07:02:57 UTC (rev 4522) +++ remoting2/branches/2.2/src/main/org/jboss/remoting/transport/http/HTTPM= etadataConstants.java 2008-08-30 07:03:13 UTC (rev 4523) @@ -33,6 +33,7 @@ { public static final String METHODTYPE =3D "MethodType"; public static final String PATH =3D "Path"; + public static final String QUERY =3D "Query"; public static final String HTTPVERSION =3D "HttpVersion"; public static final String RESPONSE_CODE =3D "ResponseCode"; public static final String CONTENTTYPE =3D "Content-Type"; --===============7981930021845615363==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 30 03:03:55 2008 Content-Type: multipart/mixed; boundary="===============6963819128178955052==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4524 - in remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/http: query and 1 other directory. Date: Sat, 30 Aug 2008 03:03:53 -0400 Message-ID: --===============6963819128178955052== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-30 03:03:53 -0400 (Sat, 30 Aug 2008) New Revision: 4524 Added: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/http/= query/ remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/http/= query/URLQueryTestCase.java Log: JBREM-1027: New unit test. Added: remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/h= ttp/query/URLQueryTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/http= /query/URLQueryTestCase.java (rev 0) +++ remoting2/branches/2.2/src/tests/org/jboss/test/remoting/transport/http= /query/URLQueryTestCase.java 2008-08-30 07:03:53 UTC (rev 4524) @@ -0,0 +1,166 @@ +/* +* 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.transport.http.query; + +import java.net.InetAddress; +import java.util.HashMap; +import java.util.Map; + +import javax.management.MBeanServer; + +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.ServerInvocationHandler; +import org.jboss.remoting.ServerInvoker; +import org.jboss.remoting.callback.InvokerCallbackHandler; +import org.jboss.remoting.transport.Connector; +import org.jboss.remoting.transport.PortUtil; +import org.jboss.remoting.transport.http.HTTPMetadataConstants; + +import junit.framework.TestCase; + +/** + * Unit test for JBREM-1027. + * = + * @author Ron Sigal + * @version $Revision: 1.1 $ + *

+ * Copyright Aug 28, 2008 + *

+ */ +public class URLQueryTestCase extends TestCase +{ + private static Logger log =3D Logger.getLogger(URLQueryTestCase.class); + = + private static boolean firstTime =3D true; + protected static final String QUERY =3D "a=3Dy&b=3Dz"; + = + 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 =3D false; + Logger.getLogger("org.jboss.remoting").setLevel(XLevel.INFO); + Logger.getLogger("org.jboss.test.remoting").setLevel(Level.INFO); + String pattern =3D "[%d{ABSOLUTE}] [%t] %5p (%F:%L) - %m%n"; + PatternLayout layout =3D new PatternLayout(pattern); + ConsoleAppender consoleAppender =3D new ConsoleAppender(layout); + Logger.getRootLogger().addAppender(consoleAppender); = + } + } + + = + public void tearDown() + { + } + = + = + public void testQueryInRequestMap() throws Throwable + { + log.info("entering " + getName()); + = + // Start server. + setupServer(); + = + // Create client. + InvokerLocator clientLocator =3D new InvokerLocator(locatorURI); + HashMap clientConfig =3D new HashMap(); + clientConfig.put(InvokerLocator.FORCE_REMOTE, "true"); + addExtraClientConfig(clientConfig); + Client client =3D new Client(clientLocator, clientConfig); + client.connect(); + log.info("client is connected"); + = + // Test connections. + Object response =3D client.invoke("abc"); + log.info("response: " + response); + assertEquals(QUERY, response); + = + client.disconnect(); + shutdownServer(); + log.info(getName() + " PASSES"); + } + = + = + protected String getTransport() + { + return "http"; + } + = + = + protected void addExtraClientConfig(Map config) {} + protected void addExtraServerConfig(Map config) {} + = + + protected void setupServer() throws Exception + { + host =3D InetAddress.getLocalHost().getHostAddress(); + port =3D PortUtil.findFreePort(host); + locatorURI =3D getTransport() + "://" + host + ":" + port + "/?" + Q= UERY; = + serverLocator =3D new InvokerLocator(locatorURI); + log.info("Starting remoting server with locator uri of: " + locatorU= RI); + HashMap config =3D new HashMap(); + config.put(InvokerLocator.FORCE_REMOTE, "true"); + addExtraServerConfig(config); + connector =3D new Connector(serverLocator, config); + connector.create(); + invocationHandler =3D new TestInvocationHandler(); + connector.addInvocationHandler("test", invocationHandler); + connector.start(); + } + = + = + protected void shutdownServer() throws Exception + { + if (connector !=3D null) + connector.stop(); + } + = + = + static class TestInvocationHandler implements ServerInvocationHandler + { + public void addListener(InvokerCallbackHandler callbackHandler) {} + public Object invoke(final InvocationRequest invocation) throws Thro= wable + { + Map requestMap =3D invocation.getRequestPayload(); + log.info("query: " + requestMap.get(HTTPMetadataConstants.QUERY)); + return requestMap.get(HTTPMetadataConstants.QUERY); + } + public void removeListener(InvokerCallbackHandler callbackHandler) {} + public void setMBeanServer(MBeanServer server) {} + public void setInvoker(ServerInvoker invoker) {} + } +} \ No newline at end of file --===============6963819128178955052==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 30 03:22:25 2008 Content-Type: multipart/mixed; boundary="===============6517254657859900121==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4525 - remoting2/branches/2.x. Date: Sat, 30 Aug 2008 03:22:25 -0400 Message-ID: --===============6517254657859900121== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-30 03:22:24 -0400 (Sat, 30 Aug 2008) New Revision: 4525 Modified: remoting2/branches/2.x/build.xml Log: JBREM-1030: Updated version to 2.4.0.SP2. Modified: remoting2/branches/2.x/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/build.xml 2008-08-30 07:03:53 UTC (rev 4524) +++ remoting2/branches/2.x/build.xml 2008-08-30 07:22:24 UTC (rev 4525) @@ -224,9 +224,9 @@ - + - + = --===============6517254657859900121==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 30 03:22:46 2008 Content-Type: multipart/mixed; boundary="===============6594220221855799439==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4526 - remoting2/branches/2.x/src/main/org/jboss/remoting. Date: Sat, 30 Aug 2008 03:22:46 -0400 Message-ID: --===============6594220221855799439== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-30 03:22:46 -0400 (Sat, 30 Aug 2008) New Revision: 4526 Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java Log: JBREM-1030: Updated version to 2.4.0.SP2. Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java 2008-08= -30 07:22:24 UTC (rev 4525) +++ remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java 2008-08= -30 07:22:46 UTC (rev 4526) @@ -34,7 +34,7 @@ public static final byte VERSION_2 =3D 2; public static final byte VERSION_2_2 =3D 22; = - public static final String VERSION =3D "2.4.0.SP1 (Pinto)"; + public static final String VERSION =3D "2.4.0.SP2 (Pinto)"; private static final byte byteVersion =3D VERSION_2_2; private static byte defaultByteVersion =3D byteVersion; private static boolean performVersioning =3D true; --===============6594220221855799439==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 30 03:25:04 2008 Content-Type: multipart/mixed; boundary="===============2328478493480961743==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4527 - remoting2/branches/2.x/docs. Date: Sat, 30 Aug 2008 03:25:03 -0400 Message-ID: --===============2328478493480961743== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-30 03:25:03 -0400 (Sat, 30 Aug 2008) New Revision: 4527 Modified: remoting2/branches/2.x/docs/README.txt Log: JBREM-1030: Added release notes for 2.4.0.SP2. Modified: remoting2/branches/2.x/docs/README.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/docs/README.txt 2008-08-30 07:22:46 UTC (rev 452= 6) +++ remoting2/branches/2.x/docs/README.txt 2008-08-30 07:25:03 UTC (rev 452= 7) @@ -30,7 +30,24 @@ in Jira, please create one. = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D +Release Notes - JBoss Remoting - Version 2.4.0.SP2 + +Bug + + * [JBREM-1027] - CoyoteInvoker should pass URL query in InvocationRequ= est + * [JBREM-1028] - JavaSerializationManager should clear ObjectOutputStr= eam internal tables + +Release + + * [JBREM-1030] - Release 2.4.0.SP2 + +Task + + * [JBREM-1029] - Assure version compatibility with earlier versions of= Remoting + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D Release Notes - JBoss Remoting - Version 2.4.0.SP1 (Pinto) + Bug = * [JBREM-302] - remote dynamic marshall loading not working on linux --===============2328478493480961743==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 30 03:25:53 2008 Content-Type: multipart/mixed; boundary="===============3705300070637964171==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4528 - remoting2/branches/2.x/docs/guide/en. Date: Sat, 30 Aug 2008 03:25:53 -0400 Message-ID: --===============3705300070637964171== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-30 03:25:53 -0400 (Sat, 30 Aug 2008) New Revision: 4528 Modified: remoting2/branches/2.x/docs/guide/en/master.xml Log: JBREM-1030: Updated version to 2.4.0.SP2. Modified: remoting2/branches/2.x/docs/guide/en/master.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/docs/guide/en/master.xml 2008-08-30 07:25:03 UTC= (rev 4527) +++ remoting2/branches/2.x/docs/guide/en/master.xml 2008-08-30 07:25:53 UTC= (rev 4528) @@ -24,9 +24,9 @@ JBoss Remoting Guide = - JBoss Remoting version 2.4.0.SP1 + JBoss Remoting version 2.4.0.SP2 = - August 12, 2008 + August 30, 2008 = --===============3705300070637964171==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 30 03:37:41 2008 Content-Type: multipart/mixed; boundary="===============7798737361778447071==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4529 - remoting2/branches/2.x/docs/guide/en. Date: Sat, 30 Aug 2008 03:37:41 -0400 Message-ID: --===============7798737361778447071== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-30 03:37:41 -0400 (Sat, 30 Aug 2008) New Revision: 4529 Modified: remoting2/branches/2.x/docs/guide/en/chap1.xml Log: JBREM-1030: Added notes about 2.4.0.SP2. Modified: remoting2/branches/2.x/docs/guide/en/chap1.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/docs/guide/en/chap1.xml 2008-08-30 07:25:53 UTC = (rev 4528) +++ remoting2/branches/2.x/docs/guide/en/chap1.xml 2008-08-30 07:37:41 UTC = (rev 4529) @@ -176,6 +176,21 @@ =
What's new in version 2.4? + +
+ Release 2.4.0.SP2 + = + + + CoyoteInvoker adds the URL query to= the + InvocationRequest request map. + + = + + A leak in Java serialization output marshalling has been f= ixed. + + +
=
Release 2.4.0.SP1 --===============7798737361778447071==-- From jboss-remoting-commits at lists.jboss.org Sat Aug 30 03:38:13 2008 Content-Type: multipart/mixed; boundary="===============7043810989348685664==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r4530 - remoting2/branches/2.x/docs/guide/en. Date: Sat, 30 Aug 2008 03:38:12 -0400 Message-ID: --===============7043810989348685664== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2008-08-30 03:38:12 -0400 (Sat, 30 Aug 2008) New Revision: 4530 Modified: remoting2/branches/2.x/docs/guide/en/chap17.xml Log: JBREM-1030: Added release notes for 2.4.0.SP2. Modified: remoting2/branches/2.x/docs/guide/en/chap17.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.x/docs/guide/en/chap17.xml 2008-08-30 07:37:41 UTC= (rev 4529) +++ remoting2/branches/2.x/docs/guide/en/chap17.xml 2008-08-30 07:38:12 UTC= (rev 4530) @@ -52,7 +52,22 @@ =
Version 2.4 + + Release Notes - JBoss Remoting - Version 2.4.0.SP2 (Pinto)= = + Bug + = + * [JBREM-1027] - CoyoteInvoker should pass URL query in Invo= cationRequest + * [JBREM-1028] - JavaSerializationManager should clear Objec= tOutputStream internal tables + = + Release + = + * [JBREM-1030] - Release 2.4.0.SP2 = + = + Task + = + * [JBREM-1029] - Assure version compatibility with earlier v= ersions of Remoting + = Release Notes - JBoss Remoting - Version 2.4.0.SP1 (Pinto)= = Bug --===============7043810989348685664==--