Buggy code:
public class RemoteDomainConnectionService implements MasterDomainControllerClient , ClosedCallback , Service < MasterDomainControllerClient > { private static final Logger log = Logger . getLogger ( "org.jboss.as.domain.controller" ) ; private final ModelController controller ; private final InetAddress host ; private final int port ; private final String name ; private final RemoteDomainConnectionService . RemoteFileRepository remoteFileRepository ; private volatile ProtocolChannelClient < ManagementChannel > channelClient ; private volatile ModelControllerClient masterProxy ; private final AtomicBoolean shutdown = new AtomicBoolean ( ) ; private volatile Channel channel ; private volatile AbstractMessageHandler handler ; private final ExecutorService executor = Executors . newCachedThreadPool ( ) ; private final AtomicBoolean connected = new AtomicBoolean ( false ) ; private final AtomicBoolean registered = new AtomicBoolean ( false ) ; private final RemoteDomainConnectionService . FutureClient futureClient = new RemoteDomainConnectionService . FutureClient ( ) ; private final InjectedValue < Endpoint > endpointInjector = new InjectedValue < Endpoint > ( ) ; private final InjectedValue < CallbackHandlerFactory > callbackFactoryInjector = new InjectedValue < CallbackHandlerFactory > ( ) ; private RemoteDomainConnectionService ( final ModelController controller , final String name , final InetAddress host , final int port , final RemoteDomainConnectionService . RemoteFileRepository remoteFileRepository ) { } public static Future < MasterDomainControllerClient > install ( final ServiceTarget serviceTarget , final ModelController controller , final String localHostName , final String remoteDcHost , final int remoteDcPort , final String securityRealm , final RemoteDomainConnectionService . RemoteFileRepository remoteFileRepository ) { } public void register ( ) { } private synchronized void connect ( ) { } public synchronized void unregister ( ) { } public synchronized FileRepository getRemoteFileRepository ( ) { } @ Override public ModelNode execute ( ModelNode operation ) throws IOException { } @ Override public ModelNode execute ( Operation operation ) throws IOException { } @ Override public ModelNode execute ( ModelNode operation , OperationMessageHandler messageHandler ) throws IOException { } @ Override public ModelNode execute ( Operation operation , OperationMessageHandler messageHandler ) throws IOException { } @ Override public AsyncFuture < ModelNode > executeAsync ( ModelNode operation , OperationMessageHandler messageHandler ) { } @ Override public AsyncFuture < ModelNode > executeAsync ( Operation operation , OperationMessageHandler messageHandler ) { } @ Override public void close ( ) throws IOException { } @ Override public synchronized void start ( StartContext context ) throws StartException { } @ Override public synchronized void stop ( StopContext context ) { } @ Override public void connectionClosed ( ) { if ( ! ( connected . get ( ) ) ) { RemoteDomainConnectionService . log . error ( "Null<seq2seq4repair_space>reconnect<seq2seq4repair_space>info,<seq2seq4repair_space>cannot<seq2seq4repair_space>try<seq2seq4repair_space>to<seq2seq4repair_space>reconnect" ) ; return ; } final AbstractMessageHandler handler = this . handler ; if ( handler != null ) { <START_BUG> handler . shutdown ( ) ; <END_BUG> } if ( ! ( shutdown . get ( ) ) ) { new Thread ( new Runnable ( ) { @ Override public void run ( ) { try { Thread . sleep ( 3000 ) ; } catch ( InterruptedException e ) { } int count = 0 ; while ( ! ( shutdown . get ( ) ) ) { RemoteDomainConnectionService . log . debug ( "Attempting<seq2seq4repair_space>reconnection<seq2seq4repair_space>to<seq2seq4repair_space>master..." ) ; try { connect ( ) ; RemoteDomainConnectionService . log . info ( "Reconnected<seq2seq4repair_space>to<seq2seq4repair_space>master" ) ; break ; } catch ( Exception e ) { } try { RECONNECT . wait ( ( ++ count ) ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; return ; } } } } ) . start ( ) ; } } @ Override public synchronized MasterDomainControllerClient getValue ( ) throws IllegalArgumentException , IllegalStateException { } private abstract class RegistryRequest < T > extends AbstractManagementRequest < T , Void > { } private class RegisterModelControllerRequest extends RemoteDomainConnectionService . RegistryRequest < SlaveRegistrationError > { @ Override public byte getOperationType ( ) { } @ Override protected void sendRequest ( ActiveOperation . ResultHandler < SlaveRegistrationError > resultHandler , ManagementRequestContext < Void > voidManagementRequestContext , FlushableDataOutput output ) throws IOException { } @ Override public void handleRequest ( DataInput input , ActiveOperation . ResultHandler < SlaveRegistrationError > resultHandler , ManagementRequestContext < Void > voidManagementRequestContext ) throws IOException { } } private class UnregisterModelControllerRequest extends RemoteDomainConnectionService . RegistryRequest < Void > { @ Override public byte getOperationType ( ) { } @ Override protected void sendRequest ( ActiveOperation . ResultHandler < Void > resultHandler , ManagementRequestContext < Void > voidManagementRequestContext , FlushableDataOutput output ) throws IOException { } @ Override public void handleRequest ( DataInput input , ActiveOperation . ResultHandler < Void > resultHandler , ManagementRequestContext < Void > voidManagementRequestContext ) throws IOException { } } private class GetFileRequest extends RemoteDomainConnectionService . RegistryRequest < File > { private final byte rootId ; private final String filePath ; private final FileRepository localFileRepository ; private GetFileRequest ( final byte rootId , final String filePath , final FileRepository localFileRepository ) { } @ Override public byte getOperationType ( ) { } @ Override protected void sendRequest ( ActiveOperation . ResultHandler < File > resultHandler , ManagementRequestContext < Void > context , FlushableDataOutput output ) throws IOException { } @ Override public void handleRequest ( DataInput input , ActiveOperation . ResultHandler < File > resultHandler , ManagementRequestContext < Void > context ) throws IOException { } } static class RemoteFileRepository implements FileRepository { private final FileRepository localFileRepository ; private volatile RemoteDomainConnectionService . RemoteFileRepositoryExecutor remoteFileRepositoryExecutor ; RemoteFileRepository ( final FileRepository localFileRepository ) { } @ Override public final File getFile ( String relativePath ) { } @ Override public final File getConfigurationFile ( String relativePath ) { } @ Override public final File [ ] getDeploymentFiles ( byte [ ] deploymentHash ) { } @ Override public File getDeploymentRoot ( byte [ ] deploymentHash ) { } private File getFile ( final String relativePath , final byte repoId ) { } private void setRemoteFileRepositoryExecutor ( RemoteDomainConnectionService . RemoteFileRepositoryExecutor remoteFileRepositoryExecutor ) { } } private static interface RemoteFileRepositoryExecutor { File getFile ( final String relativePath , final byte repoId , FileRepository localFileRepository ) { }

Fix:
handler . shutdownNow ( ) ;