public Future<T> execute(final ManagementRequestConnectionStrategy connectionStrategy) throws IOException {
this.connectionStrategy = connectionStrategy;
OutputStream dataOutput = null;
ByteDataOutput output = null;
try {
final Connection connection = connectionStrategy.getConnection();
connection.backupMessageHandler();
connection.setMessageHandler(initiatingMessageHandler);
dataOutput = connection.writeMessage();
output = new SimpleByteDataOutput(dataOutput);
// Start by writing the header
final ManagementRequestHeader managementRequestHeader = new ManagementRequestHeader(ManagementProtocol.VERSION, requestId, getHandlerId());
managementRequestHeader.write(output);
connection.setMessageHandler(initiatingMessageHandler);
output.close();
dataOutput.close();
} finally {
safeClose(output);
safeClose(dataOutput);