public void reconnect(String hostName, int port, boolean managementSubsystemEndpoint, byte[] asAuthKey) { assert holdsLock(lock); // Call under lock try { StreamUtils.writeUTFZBytes(stdin, hostName); StreamUtils.writeInt(stdin, port); StreamUtils.writeBoolean(stdin, managementSubsystemEndpoint); stdin.write(asAuthKey); stdin.flush(); } catch (IOException e) { if(state == State.STARTED) { // Only log in case the process is still running log.failedToSendReconnect(e, processName); } } }