Configure Remoting using POJO descriptors
POJO descriptors When an MBean descriptor like the one in the previous section is given, the Connector explicitly parses the element. In Application Server 5 and EAP 5, the microcontainer automatically parses POJO descriptors written in its descriptor language, creates the described POJOs, and can inject them into other POJOs. Remoting uses a POJO descriptor of a org.jboss.remoting.ServerConfiguration object to inject configuration information into a Connector. For example, the following POJO descriptors are abbreviated and modified versions of those used by the EJB2 subsystem: socket serverBindAddress localhost serverBindPort 4446 enableTcpNoDelay true maxPoolSize500 JSR88 org.jboss.deployment.remoting.DeployHandler Here, the ServerConfiguration is created and injected into the Connector object, which creates the InvokerLocator socket://localhost:4446?enableTcpNoDelay=true Notes. The element specifies that this Connector will create a SocketServerInvoker. The entries in the "invokerLocatorParameters" property appear in the InvokerLocator and are available on both the client and server sides. The entries in the "serverParameters" property do not appear in the InvokerLocator and are available only on the server side. The "invocationHandlers" property tells the Connector to create an instance of org.jboss.deployment.remoting.DeployHandler to handle all invocations associated with the "JSR88" subsystem. The actual ServerInvocationHandler used by EJB2, by the way, is an instance of a different class and is injected into the SocketServerInvoker programmatically. It is described by the following POJO descriptor: @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=invoker,type=unified",exposedInterface=org.jboss.invocation.unified.server.UnifiedInvokerMBean.class,registerDirectly=true) TransactionManager An org.jboss.invocation.unified.server.UnifiedInvoker is a ServerInvocationHandler, and it uses the "UnifiedInvokerConnector" to inject itself into the SocketServerInvoker created by the "UnifiedInvokerConnector". The property, by the way, is used to assign an MBean name to a POJO. There is an alternative way to configure a Connector with a ServerConfiguration. In the following modified version of two POJOs used by the EJB3 subsystem, the InvokerLocator is given explicitly to the Connector and the injected ServerConfiguration is used only to specify a ServerInvocationHandler: socket://localhost:3873?timeout=300000 AOP org.jboss.aspects.remoting.AOPRemotingInvocationHandler