JBoss Remoting SVN: r4450 - remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util.
by jboss-remoting-commits@lists.jboss.org
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/ServiceURI.java
===================================================================
--- remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/ServiceURI.java 2008-08-01 00:48:00 UTC (rev 4449)
+++ remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/ServiceURI.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 = "jrs";
- private static final String FIRST_CHAR = "[$_a-zA-Z]";
- private static final String SUBSEQUENT_CHAR = "[-+$_a-zA-Z0-9]*";
- private static final String ID = FIRST_CHAR + SUBSEQUENT_CHAR;
- private static final String SEPARATOR = "[./]";
+ private ServiceURI() {
+ }
- private static final Pattern VALID_PATTERN = 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 = uri;
- if (! uri.getScheme().equals(SCHEME)) {
- throw new IllegalArgumentException("Invalid URI scheme for service");
+ /**
+ * 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 remoting service
+ */
+ public static String getServiceType(final URI uri) throws IllegalArgumentException {
+ if (! isRemotingServiceUri(uri)) {
+ throw new IllegalArgumentException("Not a remoting service URI");
}
final String ssp = uri.getSchemeSpecificPart();
- final int stcp = ssp.indexOf(':');
- if (stcp == -1) {
+ final int firstColon = ssp.indexOf(':');
+ final String serviceType;
+ if (firstColon == -1) {
serviceType = ssp;
- groupName = "";
- endpointName = "";
} else {
- serviceType = ssp.substring(0, stcp).trim();
- final int gncp = ssp.indexOf(':', stcp + 1);
- if (gncp == -1) {
- groupName = ssp.substring(stcp + 1).trim();
- endpointName = "";
- } else {
- groupName = ssp.substring(stcp + 1, gncp).trim();
- // ignore everything after the last :
- final int encp = ssp.indexOf(':', gncp + 1);
- if (encp == -1) {
- endpointName = ssp.substring(gncp + 1).trim();
- } else {
- endpointName = ssp.substring(gncp + 1, encp).trim();
- }
- }
+ serviceType = ssp.substring(0, firstColon);
}
- final Matcher matcher = VALID_PATTERN.matcher(serviceType);
- if (! matcher.matches()) {
- throw new IllegalArgumentException("Syntax error in service type 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 remoting service
+ */
+ public static String getGroupName(final URI uri) throws IllegalArgumentException {
+ 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 = uri.getSchemeSpecificPart();
+ final int firstColon = ssp.indexOf(':');
+ final String groupName;
+ if (firstColon == -1) {
+ return "";
}
- matcher.reset(endpointName);
- if (! matcher.matches()) {
- throw new IllegalArgumentException("Syntax error in endpoint name URI part");
+ final int secondColon = ssp.indexOf(':', firstColon + 1);
+ if (secondColon == -1) {
+ groupName = ssp.substring(firstColon + 1);
+ } else {
+ groupName = 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 remoting service
+ */
+ public static String getEndpointName(final URI uri) throws IllegalArgumentException {
+ if (! isRemotingServiceUri(uri)) {
+ throw new IllegalArgumentException("Not a remoting service URI");
+ }
+ final String ssp = uri.getSchemeSpecificPart();
+ final int firstColon = ssp.indexOf(':');
+ final String endpointName;
+ if (firstColon == -1) {
+ return "";
+ }
+ final int secondColon = ssp.indexOf(':', firstColon + 1);
+ if (secondColon == -1) {
+ return "";
+ }
+ // ::: is not officially supported, but this leaves room for extensions
+ final int thirdColon = ssp.indexOf(':', secondColon + 1);
+ if (thirdColon == -1) {
+ endpointName = ssp.substring(secondColon + 1);
+ } else {
+ endpointName = 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 = new StringBuilder(serviceType.length() + groupName.length() + endpointName.length() + 2);
+ if (serviceType != null && serviceType.length() > 0) {
+ builder.append(serviceType);
+ }
+ if (groupName != null && groupName.length() > 0) {
+ builder.append(':').append(groupName);
+ if (endpointName != null && endpointName.length() > 0) {
+ builder.append(':').append(groupName);
+ }
+ } else if (endpointName != 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 not be possible here", e);
+ }
}
-
- public String getGroupName() {
- return groupName;
- }
-
- public String getEndpointName() {
- return endpointName;
- }
}
16 years, 5 months
JBoss Remoting SVN: r4449 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
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
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java 2008-08-01 00:46:58 UTC (rev 4448)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java 2008-08-01 00:48:00 UTC (rev 4449)
@@ -218,6 +218,8 @@
public static final String ECHO = "$ECHO$";
public static final String INVOKER_SESSION_ID = "invokerSessionId";
+
+ public static final String CONNECTION_LISTENER = "connectionListener";
// Static ---------------------------------------------------------------------------------------
@@ -349,7 +351,64 @@
throw new IllegalArgumentException("Can not add null ConnectionListener.");
}
}
+
+ public void setConnectionListener(Object listener)
+ {
+ if (listener == 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 String nor ConnectionListener");
+ return;
+ }
+
+ ConnectionListener connectionListener = null;
+ try
+ {
+ MBeanServer server = getMBeanServer();
+ ObjectName objName = new ObjectName((String) listener);
+ Class c = ConnectionListener.class;
+ Object o = MBeanServerInvocationHandler.newProxyInstance(server, objName, c, false);
+ connectionListener = (ConnectionListener) o;
+ }
+ catch (MalformedObjectNameException e)
+ {
+ log.debug("Object supplied as ConnectionListener is not an object name.");
+ }
+
+ if (connectionListener == null)
+ {
+ try
+ {
+ Class listenerClass = ClassLoaderUtility.loadClass((String) listener, ServerInvoker.class);
+ connectionListener = (ConnectionListener) listenerClass.newInstance();
+ }
+ catch (Exception e)
+ {
+ log.error("Unable to instantiate " + listener + ": " + e.getMessage());
+ return;
+ }
+ }
+
+ if (connectionListener == null)
+ {
+ log.error("Unable to create ConnectionListener from " + listener);
+ return;
+ }
+
+ addConnectionListener(connectionListener);
+ }
+
public void removeConnectionListener(ConnectionListener listener)
{
if(connectionNotifier != null)
@@ -1086,6 +1145,13 @@
}
}
+ // Inject ConnectionListener
+ String connectionListener = (String)config.get(CONNECTION_LISTENER);
+ if (connectionListener != null)
+ {
+ setConnectionListener(connectionListener);
+ }
+
String registerCallbackListenersString = (String)config.get(REGISTER_CALLBACK_LISTENER);
if(registerCallbackListenersString != null)
{
16 years, 5 months
JBoss Remoting SVN: r4448 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/lease.
by jboss-remoting-commits@lists.jboss.org
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/InjectedConnectionListenerTestCase.java
Log:
JBREM-1012: New unit test.
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/lease/InjectedConnectionListenerTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/lease/InjectedConnectionListenerTestCase.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/lease/InjectedConnectionListenerTestCase.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 <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright Jul 18, 2008
+ * </p>
+ */
+public class InjectedConnectionListenerTestCase extends TestCase
+{
+ private static Logger log = Logger.getLogger(InjectedConnectionListenerTestCase.class);
+
+ private static boolean firstTime = true;
+
+ protected String host;
+ protected int port;
+ protected String locatorURI;
+ protected Connector connector;
+ protected TestInvocationHandler invocationHandler;
+
+
+ public void setUp() throws Exception
+ {
+ if (firstTime)
+ {
+ firstTime = false;
+ Logger.getLogger("org.jboss.remoting").setLevel(XLevel.INFO);
+ Logger.getLogger("org.jboss.test.remoting").setLevel(Level.INFO);
+ String pattern = "[%d{ABSOLUTE}] [%t] %5p (%F:%L) - %m%n";
+ PatternLayout layout = new PatternLayout(pattern);
+ ConsoleAppender consoleAppender = new ConsoleAppender(layout);
+ Logger.getRootLogger().addAppender(consoleAppender);
+ }
+
+ TestConnectionListener.gotException = false;
+ }
+
+
+ public void tearDown()
+ {
+ }
+
+
+ public void testInjectionWithClassName() throws Throwable
+ {
+ log.info("entering " + getName());
+
+ // Start server.
+ MBeanServer mbeanServer = MBeanServerFactory.createMBeanServer();
+ setupServer(TestConnectionListener.class.getName(), mbeanServer);
+
+ // Create client.
+ InvokerLocator clientLocator = new InvokerLocator(locatorURI);
+ HashMap clientConfig = new HashMap();
+ clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
+ clientConfig.put(Client.ENABLE_LEASE, "true");
+ addExtraClientConfig(clientConfig);
+ Client client = 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 = "jboss:type=connectionlistener";
+ ObjectName objName = new ObjectName(connectionListenerName);
+ MBeanServer mbeanServer = MBeanServerFactory.createMBeanServer();
+ TestConnectionListener listener = new TestConnectionListener();
+ mbeanServer.registerMBean(listener, objName);
+ setupServer(connectionListenerName, mbeanServer);
+
+ // Create client.
+ InvokerLocator clientLocator = new InvokerLocator(locatorURI);
+ HashMap clientConfig = new HashMap();
+ clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
+ clientConfig.put(Client.ENABLE_LEASE, "true");
+ addExtraClientConfig(clientConfig);
+ Client client = 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) throws Exception
+ {
+ HashMap config = new HashMap();
+ config.put(InvokerLocator.FORCE_REMOTE, "true");
+ addExtraServerConfig(config);
+ Connector connector = new Connector(config);
+ mbeanServer.registerMBean(connector, new ObjectName("test:type=connector"));
+
+ host = InetAddress.getLocalHost().getHostAddress();
+ port = PortUtil.findFreePort(host);
+ StringBuffer buf = new StringBuffer();
+ buf.append("<?xml version=\"1.0\"?>\n");
+ buf.append("<config>");
+ buf.append(" <invoker transport=\"" + getTransport() + "\">");
+ buf.append(" <attribute name=\"serverBindAddress\">" + host + "</attribute>");
+ buf.append(" <attribute name=\"serverBindPort\">" + port + "</attribute>");
+ buf.append(" <attribute name=\"" + ServerInvoker.CONNECTION_LISTENER + "\">" + listener + "</attribute>");
+ buf.append(" <attribute name=\"" + ServerInvoker.CLIENT_LEASE_PERIOD + "\">5000</attribute>");
+ buf.append(" </invoker>");
+ buf.append("</config>");
+ ByteArrayInputStream bais = new ByteArrayInputStream(buf.toString().getBytes());
+ Document xml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(bais);
+ connector.setConfiguration(xml.getDocumentElement());
+ connector.create();
+ connector.addInvocationHandler("test", new TestInvocationHandler());
+ connector.start();
+ locatorURI = connector.getInvokerLocator();
+ log.info("Started remoting server with locator uri of: " + locatorURI);
+ }
+
+
+ protected void shutdownServer() throws Exception
+ {
+ if (connector != null)
+ connector.stop();
+ }
+
+
+ static class TestInvocationHandler implements ServerInvocationHandler
+ {
+ public void addListener(InvokerCallbackHandler callbackHandler) {}
+ public Object invoke(final InvocationRequest invocation) throws Throwable
+ {
+ return invocation.getParameter();
+ }
+ public void removeListener(InvokerCallbackHandler callbackHandler) {}
+ public void setMBeanServer(MBeanServer server) {}
+ public void setInvoker(ServerInvoker invoker) {}
+ }
+
+
+ public interface TestConnectionListenerMBean extends ConnectionListener
+ {
+ }
+
+ public static class TestConnectionListener implements TestConnectionListenerMBean
+ {
+ public static boolean gotException;
+
+ public void handleConnectionException(Throwable throwable, Client client)
+ {
+ gotException = true;
+ log.info("TestConnectionListener got exception");
+ }
+ }
+}
\ No newline at end of file
16 years, 5 months
JBoss Remoting SVN: r4447 - remoting2/branches/2.x/docs/guide/en.
by jboss-remoting-commits@lists.jboss.org
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
===================================================================
--- 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 @@
<para>The second
criterion is that an implementation of the
<code>org.jboss.remoting.ConnectionListener</code> interface is added as a
- connection listener to the Connector, via the method</para>
+ connection listener to the Connector, either via the method</para>
<programlisting>public void addConnectionListener(ConnectionListener listener)</programlisting>
- <para> Once both criteria are met, the remoting server will turn on client
- leasing.</para>
-
- <para>Note that there is no way to register a
- <classname>ConnectionListener</classname> via xml based configuration for
- the <classname>Connector</classname>.</para>
+ <para>or though the use of the
+ <code>ServerInvoker.CONNECTION_LISTENER</code> parameter (actual value
+ "connectionListener") in the <classname>Connector</classname>'s
+ configuration map or XML configuration file. Once both criteria are met, the
+ remoting server will turn on client leasing.</para>
<para>The ConnectionListener will be notified of both client failures and
client disconnects via the handleConnectionException() method. If the client
16 years, 5 months
JBoss Remoting SVN: r4446 - remoting2/branches/2.x/docs/guide/en.
by jboss-remoting-commits@lists.jboss.org
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
===================================================================
--- 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 ping
call on the server to keep its lease current.</para>
- <para>The client can also provide extra metadata the will be communicated to
+ <para>The client can also provide extra metadata that will be communicated 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 instance
passed to the connection listener (via the handleConnectionException()
16 years, 5 months
JBoss Remoting SVN: r4445 - remoting2/branches/2.x/docs/guide/en.
by jboss-remoting-commits@lists.jboss.org
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; also, some other uncommitted changes.
Modified: remoting2/branches/2.x/docs/guide/en/chap5.xml
===================================================================
--- 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 @@
<para>A number of transport independent features are introduced in Remoting
version 2.4.</para>
- <section>
- <title>Multihome servers</title>
+ <section>
+ <title>Binding to 0.0.0.0</title>
- <para>Before version 2.4, a Remoting server could bind either to a specific IP address, e.g.,
- </para>
+ <para>Before version 2.4, a Remoting server could bind to only one
+ specific IP address. In particular, the address 0.0.0.0 was translated
+ to the host returned by <code>java.net.InetAddress.getLocalHost()</code>
+ (or its equivalent IP address). As of version 2.4 [and later releases in
+ the 2.2 series], a server started with the address 0.0.0.0 binds to
+ all available interfaces.</para>
- <programlisting>socket://192.168.0.2:6500</programlisting>
+ <para><emphasis role="bold">Note.</emphasis> If 0.0.0.0 appears in the
+ <classname>InvokerLocator</classname>, it needs to be translated to an
+ address that is usable on the client side. If the system property
+ <code>InvokerLocator.BIND_BY_HOST</code> (actual value
+ "remoting.bind_by_host") is set to "true", the
+ <classname>InvokerLocator</classname> host will be transformed to the
+ value returned by
+ <code>InetAddress.getLocalHost().getHostName()</code>.
+ Otherwise, it will be transformed to the value returned by
+ <code>InetAddress.getLocalHost().getHostAddress()</code>. </para>
- <para>or to <emphasis>all</emphasis> IP addresses on a given host, e.g.,</para>
+ </section>
+
+ <section>
+ <title>Multihome servers</title>
- <programlisting>socket://0.0.0.0:6500</programlisting>
+ <para>As of release 2.4, besides binding to <emphasis>all</emphasis>
+ available interfaces, it is also possible to configure a server to
+ bind to a subset of the interfaces available on a given host. Suppose,
+ 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 possible to
+ create a single server that binds to 10.32.4.2 and 192.168.4.2.</para>
- <para>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 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 possible to create a single
- server that binds to 10.32.4.2 and 192.168.4.2.</para>
-
<para>It would be convenient to be able to create an <classname>InvokerLocator</classname>
that looks something like:</para>
@@ -1103,9 +1118,8 @@
}</programlisting>
</section>
-
<section>
- <title>Support for IPv6 IP addresses</title>
+ <title>Support for IPv6 addresses</title>
<para><classname>org.jboss.remoting.InvokerLocator</classname> will now
accept IPv6 IP addresses. For example,</para>
@@ -1225,12 +1239,11 @@
</section>
<section>
- <title>How the server bind address and port is ultimately
- determined</title>
+ <title>How the server bind address and port is determined</title>
<para>If the serverBindAddress property is set, the server invoker will
- bind to that address. Otherwise, it will, with two exceptions, use the
- address in the InvokerLocator (if there is one). The first exception is the
+ bind to that address. Otherwise, it will, with one exception, use the
+ address in the InvokerLocator (if there is one). The exception is the
case in which the clientConnectAddress property is set, which indicates
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 address
@@ -1246,8 +1259,8 @@
use host from InvokerLocator
else
use local host address</programlisting>
-
- <para>There is one other exception. If the InvokerLocator address is
+
+ <!--para>There is one other exception. If the InvokerLocator address is
0.0.0.0 and the system property called 'remoting.bind_by_host' is set to
true, then the local host name will be used, as determined by the call</para>
@@ -1257,7 +1270,9 @@
be used. To facilitate setting this property, the following static variable is
defined in <classname>InvokerLocator</classname>:</para>
- <programlisting>public static final String BIND_BY_HOST = "remoting.bind_by_host";</programlisting>
+ <programlisting>
+ public static final String BIND_BY_HOST = "remoting.bind_by_host";
+ </programlisting-->
<para>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 @@
<para><emphasis role="bold">continueAfterTimeout</emphasis> - indicates
what a server thread should do after experiencing a
<classname>java.net.SocketTimeoutException</classname>. If set to
- "true", the server thread will continue to wait for an invocation;
- otherwise, it will return itself to the thread pool.</para>
+ "true", or if JBossSerialization is being used, the server thread will
+ continue to wait for an invocation; otherwise, it will return itself to
+ the thread pool.</para>
<bridgehead>Configurations affecting the Socket invoker
client</bridgehead>
@@ -2295,6 +2311,13 @@
sockets. The default value is 10. </para>
<para>
+ <emphasis role="bold">MAX_CONTROL_CONNECTION_RESTARTS</emphasis>
+ (actual value is "maxControlConnectionRestarts"): The client side uses
+ this value to limit the number of times it will request a new control
+ connection after a ping timeout. The default value is 10.
+ </para>
+
+ <para>
<emphasis role="bold">SECONDARY_BIND_PORT</emphasis> (actual value is
"secondaryBindPort"): The server side uses this parameter to determine
the bind port for the secondary
@@ -3971,7 +3994,7 @@
<listitem>
<para>Put the class name of a <classname>SocketFactory</classname>
in a configuration map, using key
- <constant>Remoting.SOCKET_FACTORY_NAME</constant>, and pass the
+ <constant>Remoting.SOCKET_FACTORY_CLASS_NAME</constant>, and pass the
map to one of the <classname>Connector</classname> constructors.
The <classname>SocketFactory</classname> class must have a default
constructor.</para>
@@ -4170,7 +4193,7 @@
<listitem>
<para>Put the class name of a <classname>SocketFactory</classname>
in a configuration map, using key
- <constant>Remoting.SOCKET_FACTORY_NAME</constant>, and pass the
+ <constant>Remoting.SOCKET_FACTORY_CLASS_NAME</constant>, and pass the
map to one of the <classname>Client</classname> constructors. The
<classname>SocketFactory</classname> class must have a default
constructor, which will be used to create a
@@ -5211,8 +5234,8 @@
</para>
<para>
- 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 differently.
+ More details are given below.
</para>
</section>
@@ -5854,8 +5877,8 @@
Client to indicate the socket factory to be used. Value must be instance
of javax.net.SocketFactory.</para>
- <para><emphasis role="bold">SOCKET_FACTORY_NAME</emphasis> (actual value
- is 'socketFactory') - key for the configuration map passed to a Client to
+ <para><emphasis role="bold">SOCKET_FACTORY_CLASS_NAME</emphasis> (actual 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 @@
<section>
<title>org.jboss.remoting.transport.socket.ServerThread</title>
- <para><emphasis role="bold">evictabilityTimeout</emphasis> - indicates the
- number of milliseconds during which a server thread waiting for the next
- invocation will not be preemptible.</para>
-
- <para><emphasis role="bold">continueAfterTimeout</emphasis> - indicates
- what a server thread should do after experiencing a
- <classname>java.net.SocketTimeoutException</classname>. If set to "true",
- the server thread will continue to wait for an invocation; otherwise, it
- will return itself to the thread pool.</para>
+ <para><emphasis role="bold">EVICTABILITY_TIMEOUT</emphasis> (actual value
+ "evictabilityTimeout") - indicates the number of milliseconds during which
+ a server thread waiting for the next invocation will not be
+ preemptible.</para>
+ <para><emphasis role="bold">CONTINUE_AFTER_TIMEOUT</emphasis> (actual
+ value "continueAfterTimeout") - indicates what a server thread should do
+ after experiencing a
+ <classname>java.net.SocketTimeoutException</classname>. If set to "true",
+ or if JBossSerialization is being used, the server thread will continue to
+ wait for an invocation; otherwise, it will return itself to the thread
+ pool.</para>
+
</section>
<section>
16 years, 5 months