public class ConnectionReservation extends Object
Constructor and Description |
---|
ConnectionReservation(org.jboss.netty.channel.ChannelFactory tcpClientChannelFactory,
org.jboss.netty.channel.ChannelFactory udpChannelFactory,
ConnectionConfiguration configuration,
MessageLogger messageLoggerFilter,
Statistics statistics,
Scheduler scheduler) |
Modifier and Type | Method and Description |
---|---|
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.
|
public ConnectionReservation(org.jboss.netty.channel.ChannelFactory tcpClientChannelFactory, org.jboss.netty.channel.ChannelFactory udpChannelFactory, ConnectionConfiguration configuration, MessageLogger messageLoggerFilter, Statistics statistics, Scheduler scheduler)
public FutureChannelCreator reserve(int permits)
permits
- The number of connections to be reservedpublic FutureChannelCreator reserve(int permits, String name)
permits
- The number of connections to be reservedname
- The name of the ChannelCreator, used for easier debuggingpublic 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 debuggingpublic 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)
Copyright © 2013. All Rights Reserved.