Buggy code:
public class ServerToHostOperationHandlerFactoryService implements ManagementChannelInitialization , Service < ManagementChannelInitialization > { public static final ServiceName SERVICE_NAME = JBOSS . append ( "management" , "server" , "to" , "host" , "controller" ) ; private final ExecutorService executorService ; private final InjectedValue < ServerInventory > callback = new InjectedValue < ServerInventory > ( ) ; private ServerToHostOperationHandlerFactoryService ( final ExecutorService executorService ) { } public static void install ( final ServiceTarget serviceTarget , final ServiceName serverInventoryName , final ExecutorService executorService ) { } @ Override public void start ( StartContext context ) throws StartException { } @ Override public void stop ( StopContext context ) { } @ Override public ManagementChannelInitialization getValue ( ) throws IllegalArgumentException , IllegalStateException { } @ Override public Key startReceiving ( final Channel channel ) { } private class InitialMessageHandler extends ManagementChannelReceiver { private final ExecutorService executorService ; private InitialMessageHandler ( ExecutorService executorService ) { } @ Override public void handleMessage ( final Channel channel , final DataInput input , final ManagementProtocolHeader header ) throws IOException { } public void handleMessage ( final Channel channel , final DataInput input , final ManagementRequestHeader header ) throws IOException { final byte type = header . getOperationId ( ) ; if ( type == ( DomainServerProtocol . REGISTER_REQUEST ) ) { expectHeader ( input , PARAM_SERVER_NAME ) ; final String serverName = input . readUTF ( ) ; HostControllerLogger . CONTROLLER_MANAGEMENT_LOGGER . serverRegistered ( serverName , channel ) ; executorService . execute ( new Runnable ( ) { @ Override public void run ( ) { final Channel mgmtChannel = channel ; <START_BUG> ServerToHostOperationHandlerFactoryService . this . callback . getValue ( ) . serverRegistered ( serverName , mgmtChannel , new ServerInventory . ProxyCreatedCallback ( ) { <END_BUG> @ Override public void proxyOperationHandlerCreated ( final ManagementMessageHandler handler ) { channel . addCloseHandler ( new org . jboss . remoting3 . CloseHandler < Channel > ( ) { @ Override public void handleClose ( Channel closed , IOException exception ) { handler . shutdownNow ( ) ; } } ) ; final Channel . Receiver receiver = ManagementChannelReceiver . createDelegating ( handler ) ; mgmtChannel . receiveMessage ( receiver ) ; ServerToHostOperationHandlerFactoryService . safeWriteResponse ( channel , header , null ) ; } } ) ; } } ) ; } else { ServerToHostOperationHandlerFactoryService . safeWriteResponse ( channel , header , HostControllerMessages . MESSAGES . unrecognizedType ( type ) ) ; channel . close ( ) ; } } @ Override protected Receiver next ( ) { } } protected static void safeWriteResponse ( final Channel channel , final ManagementProtocolHeader header , final Exception error ) { } protected static void writeResponse ( final Channel channel , final ManagementRequestHeader header , final Exception error ) throws IOException { } protected static void writeHeader ( final ManagementProtocolHeader header , final OutputStream os ) throws IOException { } }

Fix:
ServerToHostOperationHandlerFactoryService . this . callback . getValue ( ) . serverCommunicationRegistered ( serverName , mgmtChannel , new ServerInventory . ProxyCreatedCallback ( ) {