}
@Override
public void channelOpened(Channel channel) {
final ManagementOperationHandler handler = operationHandlerFactoryValue.getValue().createOperationHandler();
final ManagementChannel managementChannel = new ManagementChannelFactory(handler).create(channelName, channel);
channels.add(managementChannel);
log.tracef("Opened %s: %s with handler %s", channelName, managementChannel, handler);
managementChannel.startReceiving();
channel.addCloseHandler(new CloseHandler<Channel>() {
public void handleClose(final Channel closed, final IOException exception) {
channels.remove(managementChannel);
try {
managementChannel.sendByeBye();
} catch (IOException ignore) {
}
log.tracef("Handling close for %s", managementChannel);
}
});