This topic has not yet been written. The content below is from the topic description.
There are a two ways in which to register a handler with a Connector. The first is to do it programmatically. The second is via service configuration. For registering programmatically, can either pass the ServerInvocationHandler reference itself or an ObjectName for the ServerInvocationHandler (in the case that it is an MBean). To pass the handler reference directly, call Connector::addInvocationHandler(String subsystem, ServerInvocationHandler handler). For example (from org.jboss.remoting.samples.simple.SimpleServer): InvokerLocator locator = new InvokerLocator(locatorURI); Connector connector = new Connector(); connector.setInvokerLocator(locator.getLocatorURI()); connector.create(); SampleInvocationHandler invocationHandler = new SampleInvocationHandler(); // first parameter is sub-system name. can be any String value. connector.addInvocationHandler("sample", invocationHandler); connector.start(); To pass the handler by ObjectName, call Connector::addInvocationHandler(String subsystem, ObjectName handlerObjectName) . For example (from org.jboss.test.remoting.handler.mbean.ServerTest): MBeanServer server = MBeanServerFactory.createMBeanServer(); InvokerLocator locator = new InvokerLocator(locatorURI); Connector connector = new Connector(); connector.setInvokerLocator(locator.getLocatorURI()); connector.start(); server.registerMBean(connector, new ObjectName("test:type=connector,transport=socket")); // now create Mbean handler and register with mbean server MBeanHandler handler = new MBeanHandler(); ObjectName objName = new ObjectName("test:type=handler"); server.registerMBean(handler, objName); connector.addInvocationHandler("test", objName); Is important to note that if not starting the Connector via the service configuration, will need to explicitly register it with the MBeanServer (will throw exception otherwise). If using a service configuration for starting the Connector and registering handlers, can either specify the fully qualified class name for the handler, which will instantiate the handler instance upon startup (which requires there be a void parameter constructor), such as: org.jboss.remoting.transport.mock.MockServerInvocationHandler where MockServerInvocationHandler will be constructed upon startup and registered with the Connector as a handler. Can also use an ObjectName to specify the handler. The configuration is the same, but instead of specifying a fully qualified class name, you specify the ObjectName for the handler, such as (can see mbeanhandler-service.xml under remoting tests for full example): test:type=handler The only requirement for this configuration is that the handler MBean must already be created and registered with the MBeanServer at the point the Connector is started.