FileDocCategorySizeDatePackage
AbstractSender.javaAPI DocApache Tomcat 6.0.148274Fri Jul 20 04:20:30 BST 2007org.apache.catalina.tribes.transport

AbstractSender

public abstract class AbstractSender extends Object implements DataSender

Title:

Description:

Company:

author
not attributable
version
1.0

Fields Summary
private boolean
connected
private int
rxBufSize
private int
txBufSize
private boolean
directBuffer
private int
keepAliveCount
private int
requestCount
private long
connectTime
private long
keepAliveTime
private long
timeout
private org.apache.catalina.tribes.Member
destination
private InetAddress
address
private int
port
private int
maxRetryAttempts
private int
attempt
private boolean
tcpNoDelay
private boolean
soKeepAlive
private boolean
ooBInline
private boolean
soReuseAddress
private boolean
soLingerOn
private int
soLingerTime
private int
soTrafficClass
private boolean
throwOnFailedAck
Constructors Summary
public AbstractSender()

        
    
Methods Summary
public abstract voidconnect()
connect

throws
IOException
todo
Implement this org.apache.catalina.tribes.transport.DataSender method

public abstract voiddisconnect()
disconnect

todo
Implement this org.apache.catalina.tribes.transport.DataSender method

public java.net.InetAddressgetAddress()

        return address;
    
public intgetAttempt()

        return attempt;
    
public longgetConnectTime()

        return connectTime;
    
public org.apache.catalina.tribes.MembergetDestination()

        return destination;
    
public booleangetDirect()

        return getDirectBuffer();
    
public booleangetDirectBuffer()

        return this.directBuffer;
    
public intgetKeepAliveCount()

        return keepAliveCount;
    
public longgetKeepAliveTime()

        return keepAliveTime;
    
public intgetMaxRetryAttempts()

        return maxRetryAttempts;
    
public booleangetOoBInline()

        return ooBInline;
    
public intgetPort()

        return port;
    
public intgetRequestCount()

        return requestCount;
    
public intgetRxBufSize()

        return rxBufSize;
    
public booleangetSoKeepAlive()

        return soKeepAlive;
    
public booleangetSoLingerOn()

        return soLingerOn;
    
public intgetSoLingerTime()

        return soLingerTime;
    
public booleangetSoReuseAddress()

        return soReuseAddress;
    
public intgetSoTrafficClass()

        return soTrafficClass;
    
public booleangetTcpNoDelay()

        return tcpNoDelay;
    
public booleangetThrowOnFailedAck()

        return throwOnFailedAck;
    
public longgetTimeout()

        return timeout;
    
public intgetTxBufSize()

        return txBufSize;
    
public booleanisConnected()

        return connected;
    
public booleankeepalive()
keepalive

return
boolean
todo
Implement this org.apache.catalina.tribes.transport.DataSender method

        boolean disconnect = false;
        if ( keepAliveCount >= 0 && requestCount>keepAliveCount ) disconnect = true;
        else if ( keepAliveTime >= 0 && (System.currentTimeMillis()-connectTime)>keepAliveTime ) disconnect = true;
        if ( disconnect ) disconnect();
        return disconnect;
    
public voidsetAddress(java.net.InetAddress address)

        this.address = address;
    
public voidsetAttempt(int attempt)

        this.attempt = attempt;
    
public voidsetConnectTime(long connectTime)

        this.connectTime = connectTime;
    
protected voidsetConnected(boolean connected)

        this.connected = connected;
    
public voidsetDestination(org.apache.catalina.tribes.Member destination)

        this.destination = destination;
        this.address = InetAddress.getByAddress(destination.getHost());
        this.port = destination.getPort();

    
public voidsetDirect(boolean direct)

        setDirectBuffer(direct);
    
public voidsetDirectBuffer(boolean directBuffer)

        this.directBuffer = directBuffer;
    
public voidsetKeepAliveCount(int keepAliveCount)

        this.keepAliveCount = keepAliveCount;
    
public voidsetKeepAliveTime(long keepAliveTime)

        this.keepAliveTime = keepAliveTime;
    
public voidsetMaxRetryAttempts(int maxRetryAttempts)

        this.maxRetryAttempts = maxRetryAttempts;
    
public voidsetOoBInline(boolean ooBInline)

        this.ooBInline = ooBInline;
    
public voidsetPort(int port)

        this.port = port;
    
public voidsetRequestCount(int requestCount)

        this.requestCount = requestCount;
    
public voidsetRxBufSize(int rxBufSize)

        this.rxBufSize = rxBufSize;
    
public voidsetSoKeepAlive(boolean soKeepAlive)

        this.soKeepAlive = soKeepAlive;
    
public voidsetSoLingerOn(boolean soLingerOn)

        this.soLingerOn = soLingerOn;
    
public voidsetSoLingerTime(int soLingerTime)

        this.soLingerTime = soLingerTime;
    
public voidsetSoReuseAddress(boolean soReuseAddress)

        this.soReuseAddress = soReuseAddress;
    
public voidsetSoTrafficClass(int soTrafficClass)

        this.soTrafficClass = soTrafficClass;
    
public voidsetTcpNoDelay(boolean tcpNoDelay)

        this.tcpNoDelay = tcpNoDelay;
    
public voidsetThrowOnFailedAck(boolean throwOnFailedAck)

        this.throwOnFailedAck = throwOnFailedAck;
    
public voidsetTimeout(long timeout)

        this.timeout = timeout;
    
public voidsetTxBufSize(int txBufSize)

        this.txBufSize = txBufSize;
    
public static voidtransferProperties(org.apache.catalina.tribes.transport.AbstractSender from, org.apache.catalina.tribes.transport.AbstractSender to)
transfers sender properties from one sender to another

param
from AbstractSender
param
to AbstractSender

    
                       
           
        to.rxBufSize = from.rxBufSize;
        to.txBufSize = from.txBufSize;
        to.directBuffer = from.directBuffer;
        to.keepAliveCount = from.keepAliveCount;
        to.keepAliveTime = from.keepAliveTime;
        to.timeout = from.timeout;
        to.destination = from.destination;
        to.address = from.address;
        to.port = from.port;
        to.maxRetryAttempts = from.maxRetryAttempts;
        to.tcpNoDelay = from.tcpNoDelay;
        to.soKeepAlive = from.soKeepAlive;
        to.ooBInline = from.ooBInline;
        to.soReuseAddress = from.soReuseAddress;
        to.soLingerOn = from.soLingerOn;
        to.soLingerTime = from.soLingerTime;
        to.soTrafficClass = from.soTrafficClass;
        to.throwOnFailedAck = from.throwOnFailedAck;