public synchronized ProxyController popChannelAndCreateProxy(final String hostName) {
ManagementChannel channel = unregisteredHostChannels.remove(hostName);
if (channel == null) {
throw new IllegalArgumentException("No channel for host " + hostName);
}
channel.addCloseHandler(new CloseHandler<Channel>() {
public void handleClose(final Channel closed, final IOException exception) {
unregisterRemoteHost(hostName);
}
});
final PathAddress addr = PathAddress.pathAddress(PathElement.pathElement(ModelDescriptionConstants.HOST, hostName));