Buggy code:
class ManagedServer { private static final MarshallerFactory MARSHALLER_FACTORY ; private static final MarshallingConfiguration CONFIG ; public static String SERVER_PROCESS_NAME_PREFIX = "Server:" ; public static String getServerProcessName ( String serverName ) { } public static boolean isServerProcess ( String serverProcessName ) { } public static String getServerName ( String serverProcessName ) { } private final String serverName ; private final String serverProcessName ; private final Object lock = new Object ( ) ; private final ProcessControllerClient processControllerClient ; private final AtomicInteger respawnCount = new AtomicInteger ( ) ; private final InetSocketAddress managementSocket ; private final ManagedServer . ManagedServerBootConfiguration bootConfiguration ; private final byte [ ] authKey ; private volatile ServerState state ; private volatile ManagementChannel serverManagementChannel ; public ManagedServer ( final String serverName , final ProcessControllerClient processControllerClient , final InetSocketAddress managementSocket , final ManagedServer . ManagedServerBootConfiguration bootConfiguration ) { } public String getServerName ( ) { } public String getServerProcessName ( ) { } ManagementChannel getServerManagementChannel ( ) { } public ServerState getState ( ) { } public void setState ( ServerState state ) { } void setServerManagementChannel ( ManagementChannel serverManagementChannel ) { } int incrementAndGetRespawnCount ( ) { } void resetRespawnCount ( ) { } byte [ ] getAuthKey ( ) { } void createServerProcess ( ) throws IOException { } void startServerProcess ( ) throws IOException { synchronized ( lock ) { setState ( BOOTING ) ; final List < ModelNode > bootUpdates = bootConfiguration . getBootUpdates ( ) ; processControllerClient . startProcess ( serverProcessName ) ; <START_BUG> ServiceActivator hostControllerCommActivator = HostCommunicationServices . createServerCommuncationActivator ( managementSocket , serverName , authKey ) ; <END_BUG> ServerStartTask startTask = new ServerStartTask ( serverName , 0 , Collections . < ServiceActivator > singletonList ( hostControllerCommActivator ) , bootUpdates ) ; final Marshaller marshaller = ManagedServer . MARSHALLER_FACTORY . createMarshaller ( ManagedServer . CONFIG ) ; final OutputStream os = processControllerClient . sendStdin ( serverProcessName ) ; marshaller . start ( Marshalling . createByteOutput ( os ) ) ; marshaller . writeObject ( startTask ) ; marshaller . finish ( ) ; marshaller . close ( ) ; os . close ( ) ; setState ( STARTING ) ; } } void reconnectServerProcess ( int port ) throws IOException { } void stopServerProcess ( ) throws IOException { } void removeServerProcess ( ) throws IOException { } public static interface ManagedServerBootConfiguration { List < ModelNode > getBootUpdates ( ) { } Map < String , String > getServerLaunchEnvironment ( ) { } List < String > getServerLaunchCommand ( ) { } HostControllerEnvironment getHostControllerEnvironment ( ) { } } }

Fix:
ServiceActivator hostControllerCommActivator = HostCommunicationServices . createServerCommuncationActivator ( managementSocket , serverName , serverProcessName , authKey ) ;