* @return A class that needs to be passed to those methods that should use the already open connection. If the
* connection could not be reserved, maybe due to a shutdown, null is returned.
*/
public FuturePeerConnection createPeerConnection(final PeerAddress destination, final int heartBeatMillis) {
final FuturePeerConnection futureDone = new FuturePeerConnection(destination);
final FutureChannelCreator fcc = connectionBean().reservation().createPermanent(1);
fcc.addListener(new BaseFutureAdapter<FutureChannelCreator>() {
@Override
public void operationComplete(final FutureChannelCreator future) throws Exception {
if (future.isSuccess()) {
final ChannelCreator cc = fcc.channelCreator();
final PeerConnection peerConnection = new PeerConnection(destination, cc, heartBeatMillis);
futureDone.done(peerConnection);
} else {
futureDone.failed(future);
}