Configure Remoting in JBossAS (server-side)
This topic has not yet been written. The content below is from the topic description.
Everything in the previous two sections applies to configuring socket and server socket factories in any environment, including inside the JBoss Application Server (JBossAS), but JBossAS adds some new options. In particular, the SARDeployer (see The JBoss 4 Application Server Guide on the labs.jboss.org web site) can read information from a *-service.xml file, as discussed above in the section "General Connector and Invoker configuration," and use it to configure MBeans such as Connectors. An example of a service xml that covers all the different transport and service configurations can be found within the example-service.xml file under the etc directory of the JBoss Remoting distribution. The server socket factory to be used by a server invoker can be set via configuration within the service xml. To do this, the serverSocketFactory attribute will need to be set as a sub-element of the invoker element (this cannot be done if just specifying the invoker configuration using the InvokerLocator attribute). The attribute value must be either the JMX ObjectName of an MBean that implements the org.jboss.remoting.security.ServerSocketFactoryMBean interface, or the class name of a ServerSocketFactory with a default constructor. An example of the first case would be: jboss.remoting:service=ServerSocketFactory,type=SSL 1 ... The serverSocketFactory attribute is processed as follows: Take its String value, create an ObjectName from it, and look up an MBean with that name from the MBeanServer that the invoker has been registered with (by way of the Connector). If an MBean with that name is found, create a proxy to it of type org.jboss.remoting.security.ServerSocketFactoryMBean. (Technically, a user could set the serverSocketFactory property with the locator url, but the preferred method is to use the explicit configuration via the invoker element's attribute, as discussed above.) If no MBean is found with a matching ObjectName, treat the serverSocketFactory attribute as a class name and try to create an instance using the default constructor. The JBossRemoting project provides an implementation of the ServerSocketFactoryMBean that can be used and should provide most of the customization features that would be needed. More on this implementation later. Note that these two options correspond exactly to options 4 and 5 in section Server socket factories (on the server side), which is how these two new options are implemented. Timing considerations. If a Connector is accessed by way of the MBeanServer, then most of the options for configuring the server socket factory discussed in Server socket factories are irrelevant since ConnectorMBean does not expose methods for using them. However, when a Connector that is registered with an MBeanServer creates a server invoker during a call to Connector.create(), it also registers the server invoker with the same MBeanServer, which means that the server invoker is accessible by way of its ObjectName, which has the form jboss.remoting:service=invoker,transport=socket,host=www.jboss.com,port=8765 for example, followed by additional parameter=value pairs. (See the jmx-console for a running instance of JBossAS at http://localhost:8080/jmx-console/ to see examples of server invoker ObjectNames.) Now, if another MBean is configured in a *-service.xml file to be dependent on the server invoker MBean, e.g. jboss.remoting:service=invoker,transport=socket,host=www.jboss.com,port=8765 then org.jboss.BlueMonkey.create() will have access to the designated server invoker after the invoker has been created but before it has been started, which means that ServerInvoker.setServerSocketFactory() will be effective. (See the The JBoss 4 Application Server Guide, Chapter 2, for more information about the life cycle of JBoss MBeans.)