org.jboss.remoting.transport.async
Class ChannelPool

java.lang.Object
  extended byorg.jboss.remoting.transport.async.ChannelPool

public class ChannelPool
extends Object

a ChannelPool represents a logical connection to a remote uri. - It handles decomposing synchronous requests into async requests. - It pools AsychChannel connections to be able concurrently do multiple asyc sends.

Author:
Hiram Chirino

Constructor Summary
ChannelPool(InvokerLocator uri)
           
 
Method Summary
 void associate(Channel c)
          Associate a channel to the pool.
 void connect()
          Used to validate that a connection can be established.
 void disconnect()
          Closes all the pooled channels.
 org.jboss.remoting.transport.async.ChannelPool.PooledAsynchChannel getNextAvailable()
          Return the next available AsynchChannel object for a given invocation session.
 void sendDatagram(byte[] data)
           
 byte[] sendRequest(byte[] data)
           
 void sendResponse(byte[] data, int requestId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelPool

public ChannelPool(InvokerLocator uri)
Parameters:
uri -
Method Detail

connect

public void connect()
             throws IOException
Used to validate that a connection can be established.

Throws:
IOException

disconnect

public void disconnect()
Closes all the pooled channels.


associate

public void associate(Channel c)
               throws IOException
Associate a channel to the pool. When a AsynchChannelServer accepts a new channel it will associate the existing AsynchChannel with the pool. TODO: Add some logic to age out old idle connections.

Throws:
IOException

getNextAvailable

public org.jboss.remoting.transport.async.ChannelPool.PooledAsynchChannel getNextAvailable()
                                                                                    throws IOException
Return the next available AsynchChannel object for a given invocation session. It will automatically allocate a new AsynchChannel if none are available.

Returns:
Throws:
IOException

sendDatagram

public void sendDatagram(byte[] data)
                  throws IOException
Throws:
IOException

sendRequest

public byte[] sendRequest(byte[] data)
                   throws IOException
Throws:
IOException

sendResponse

public void sendResponse(byte[] data,
                         int requestId)
                  throws IOException
Throws:
IOException


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.