|
||||||||||
| 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,
ConnectionConfigurationBean configuration,
MessageLogger messageLoggerFilter,
Statistics statistics)
|
|
| Method Summary | |
|---|---|
void |
release(ChannelCreator channelCreator)
Release a channelcreator. |
void |
release(ChannelCreator channelCreator,
int permits)
Release a channelcreator. |
ChannelCreator |
reserve(int permits)
Reserves connections. |
ChannelCreator |
reserve(int permits,
boolean keepAliveAndReuse)
Reserves connections. |
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,
ConnectionConfigurationBean configuration,
MessageLogger messageLoggerFilter,
Statistics statistics)
| Method Detail |
|---|
public ChannelCreator reserve(int permits)
permits - The number of connections to be reserved
public ChannelCreator reserve(int permits,
boolean keepAliveAndReuse)
permits - The number of connections to be reservedkeepAliveAndReuse - If the connection should stay open (TCP) for
later reuse.
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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||