net.tomp2p.connection
Class ConnectionReservation
java.lang.Object
net.tomp2p.connection.ConnectionReservation
public class ConnectionReservation
- extends Object
The connection pool limits the connection used in the application. If too
many connections are open, the application has to wait until a connection is
closed.
- Author:
- Thomas Bocek
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConnectionReservation
public ConnectionReservation(org.jboss.netty.channel.ChannelFactory tcpClientChannelFactory,
org.jboss.netty.channel.ChannelFactory udpChannelFactory,
ConnectionConfiguration configuration,
MessageLogger messageLoggerFilter)
reserve
public ChannelCreator reserve(int permits)
throws org.jboss.netty.channel.ChannelException
- Throws:
org.jboss.netty.channel.ChannelException
reserve
public ChannelCreator reserve(int permits,
boolean keepAliveAndReuse)
throws org.jboss.netty.channel.ChannelException
- Throws:
org.jboss.netty.channel.ChannelException
releaseCreating
public void releaseCreating(int permits)
releaseOpen
public void releaseOpen(int permits)
release
public void release(int permits)
shutdown
public void shutdown()
- Close all open connections and prevent creating new ones.
addPeerConnection
public void addPeerConnection(PeerConnection peerConnection)
removePeerConnection
public void removePeerConnection(PeerConnection peerConnection)
Copyright © 2011. All Rights Reserved.