net.tomp2p.connection
Class ConnectionCollector

java.lang.Object
  extended by net.tomp2p.connection.ConnectionCollector

public class ConnectionCollector
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

Constructor Summary
ConnectionCollector(org.jboss.netty.channel.ChannelFactory tcpClientChannelFactory, org.jboss.netty.channel.ChannelFactory udpChannelFactory, ConnectionConfiguration configuration, org.jboss.netty.handler.execution.ExecutionHandler executionHandlerSender, GlobalTrafficShapingHandler globalTrafficShapingHandler)
           
 
Method Summary
 org.jboss.netty.channel.ChannelFuture channelTCP(org.jboss.netty.channel.ChannelHandler timeoutHandler, org.jboss.netty.channel.ChannelHandler dispatcherReply, SocketAddress remoteAddress, int connectTimeoutMillis, TCPChannelCache channelChache)
          Returns a channel that is managed by this pool.
 org.jboss.netty.channel.Channel channelUDP(org.jboss.netty.channel.ChannelHandler timeoutHandler, org.jboss.netty.channel.ChannelHandler replyHandler, boolean allowBroadcast)
           
 void shutdown()
          Close all open connections and prevent creating new ones.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConnectionCollector

public ConnectionCollector(org.jboss.netty.channel.ChannelFactory tcpClientChannelFactory,
                           org.jboss.netty.channel.ChannelFactory udpChannelFactory,
                           ConnectionConfiguration configuration,
                           org.jboss.netty.handler.execution.ExecutionHandler executionHandlerSender,
                           GlobalTrafficShapingHandler globalTrafficShapingHandler)
Method Detail

channelTCP

public org.jboss.netty.channel.ChannelFuture channelTCP(org.jboss.netty.channel.ChannelHandler timeoutHandler,
                                                        org.jboss.netty.channel.ChannelHandler dispatcherReply,
                                                        SocketAddress remoteAddress,
                                                        int connectTimeoutMillis,
                                                        TCPChannelCache channelChache)
                                                 throws org.jboss.netty.channel.ChannelException,
                                                        InterruptedException
Returns a channel that is managed by this pool. Once the channel is closed, the channel will be added to the pool.

Parameters:
channelChache -
connectTimeout -
ioHandler - The handler that is
Returns:
A channel with the handler or null if disposed or interrupted
Throws:
InterruptedException
org.jboss.netty.channel.ChannelException

channelUDP

public org.jboss.netty.channel.Channel channelUDP(org.jboss.netty.channel.ChannelHandler timeoutHandler,
                                                  org.jboss.netty.channel.ChannelHandler replyHandler,
                                                  boolean allowBroadcast)
                                           throws org.jboss.netty.channel.ChannelException
Throws:
org.jboss.netty.channel.ChannelException

shutdown

public void shutdown()
Close all open connections and prevent creating new ones.


toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.