FileDocCategorySizeDatePackage
PooledSender.javaAPI DocApache Tomcat 6.0.146528Fri Jul 20 04:20:32 BST 2007org.apache.catalina.tribes.transport

PooledSender

public abstract class PooledSender extends AbstractSender implements MultiPointSender

Title:

Description:

Company:

author
not attributable
version
1.0

Fields Summary
private SenderQueue
queue
private int
poolSize
Constructors Summary
public PooledSender()

      
        queue = new SenderQueue(this,poolSize);
    
Methods Summary
public voidadd(org.apache.catalina.tribes.Member member)

        // no op, senders created upon demans
    
public synchronized voidconnect()

        //do nothing, happens in the socket sender itself
        queue.open();
        setConnected(true);
    
public synchronized voiddisconnect()

        queue.close();
        setConnected(false);
    
public intgetInPoolSize()

        return queue.getInPoolSize();
    
public intgetInUsePoolSize()

        return queue.getInUsePoolSize();
    
public abstract DataSendergetNewDataSender()

public intgetPoolSize()

        return poolSize;
    
public DataSendergetSender()

        return queue.getSender(getTimeout());
    
public booleankeepalive()

        //do nothing, the pool checks on every return
        return (queue==null)?false:queue.checkIdleKeepAlive();
    
public voidremove(org.apache.catalina.tribes.Member member)

        //no op for now, should not cancel out any keys
        //can create serious sync issues
        //all TCP connections are cleared out through keepalive
        //and if remote node disappears
    
public voidreturnSender(DataSender sender)

        sender.keepalive();
        queue.returnSender(sender);
    
public voidsetPoolSize(int poolSize)

        this.poolSize = poolSize;
        queue.setLimit(poolSize);