| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.tomp2p.connection.ConnectionReservation
public class ConnectionReservation
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.
| Constructor Summary | |
|---|---|
ConnectionReservation(org.jboss.netty.channel.ChannelFactory tcpClientChannelFactory,
                      org.jboss.netty.channel.ChannelFactory udpChannelFactory,
                      ConnectionConfiguration configuration,
                      MessageLogger messageLoggerFilter,
                      Statistics statistics,
                      Scheduler scheduler)
 | 
|
| Method Summary | |
|---|---|
 Reservation | 
getReservation()
 | 
 void | 
release(ChannelCreator channelCreator)
Release a channelcreator.  | 
 void | 
release(ChannelCreator channelCreator,
        int permits)
Release a channelcreator.  | 
 FutureChannelCreator | 
reserve(int permits)
Reserves connections.  | 
 FutureChannelCreator | 
reserve(int permits,
        boolean keepAliveAndReuse)
Reserves connections.  | 
 FutureChannelCreator | 
reserve(int permits,
        boolean keepAliveAndReuse,
        String name)
Reserves connections.  | 
 FutureChannelCreator | 
reserve(int permits,
        String name)
Reserves connections.  | 
 void | 
setReservation(Reservation reservation)
 | 
 void | 
shutdown()
Close all open connections and prevent creating new ones.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public ConnectionReservation(org.jboss.netty.channel.ChannelFactory tcpClientChannelFactory,
                             org.jboss.netty.channel.ChannelFactory udpChannelFactory,
                             ConnectionConfiguration configuration,
                             MessageLogger messageLoggerFilter,
                             Statistics statistics,
                             Scheduler scheduler)
| Method Detail | 
|---|
public FutureChannelCreator reserve(int permits)
permits - The number of connections to be reserved
public FutureChannelCreator reserve(int permits,
                                    String name)
permits - The number of connections to be reservedname - The name of the ChannelCreator, used for easier debugging
public FutureChannelCreator reserve(int permits,
                                    boolean keepAliveAndReuse)
permits - The number of connections to be reservedkeepAliveAndReuse - If the connection should stay open (TCP) for later reuse.
public FutureChannelCreator reserve(int permits,
                                    boolean keepAliveAndReuse,
                                    String name)
permits - The number of connections to be reservedkeepAliveAndReuse - If the connection should stay open (TCP) for later reuse.name - The name of the ChannelCreator, used for easier debugging
public void release(ChannelCreator channelCreator,
                    int permits)
channelCreator - The channelcreator that is not used anymore (or at least partially)permits - The number of permits to releasepublic void release(ChannelCreator channelCreator)
channelCreator. - The channelcreator that is not used anymorepublic void shutdown()
public Reservation getReservation()
public void setReservation(Reservation reservation)
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||