// this.channelClient.close();
// this.channelClient = null;
// }
// txOperationHandler = new TransactionalModelControllerOperationHandler(executor, controller);
ProtocolChannelClient client;
ProtocolChannelClient.Configuration configuration = new ProtocolChannelClient.Configuration();
//Reusing the endpoint here after a disconnect does not seem to work once something has gone down, so try our own
//configuration.setEndpoint(endpointInjector.getValue());
configuration.setEndpointName("endpoint");
configuration.setUriScheme("remote");
this.handler = new TransactionalModelControllerOperationHandler(controller, executor);
final Connection connection;
try {
configuration.setUri(new URI("remote://" + host.getHostAddress() + ":" + port));
client = ProtocolChannelClient.create(configuration);
} catch (Exception e) {
throw new RuntimeException(e);
}
try {
CallbackHandler handler = null;
CallbackHandlerFactory handlerFactory = callbackFactoryInjector.getOptionalValue();
if (handlerFactory != null) {
handler = handlerFactory.getCallbackHandler(name);
}
connection = client.connectSync(handler);
this.channelClient = client;
channel = connection.openChannel(ManagementRemotingServices.DOMAIN_CHANNEL, OptionMap.EMPTY).get();
channel.addCloseHandler(new CloseHandler<Channel>() {
public void handleClose(final Channel closed, final IOException exception) {