BioSender (Tomcat API Documentation)
Keywords: org.apache.catalina.tribes.transport.bio.BioSender class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.catalina.tribes.transport.bio
Class BioSender

    java.lang.Object
      org.apache.catalina.tribes.transport.AbstractSender
          org.apache.catalina.tribes.transport.bio.BioSender

All Implemented Interfaces:
  DataSender

    public class BioSender

extends AbstractSender
implements DataSender

Send cluster messages with only one socket. Ack and keep Alive Handling is supported

Since:
  5.5.16
Version:
  $Revision: 532608 $ $Date: 2007-04-26 06:58:20 +0200 (Thu, 26 Apr 2007) $
Author:
  Peter Rossbach, Filip Hanik

Field Summary
`protected XByteBuffer` | `ackbuf`
`protected static StringManager` | `sm` The string manager for this package.

Constructor Summary
`BioSender()`

Method Summary
`protected void` | `closeSocket()` close socket
`void` | `connect()` Connect other cluster member receiver
`void` | `disconnect()` disconnect and close socket
`java.lang.String` | `getInfo()` Return descriptive information about this implementation and the corresponding version number, in the format `<description>/<version>`.
`protected void` | `openSocket()` open real socket and set time out when waitForAck is enabled is socket open return directly
`protected void` | `pushMessage(byte[] data, boolean reconnect, boolean waitForAck)` Push messages with only one socket at a time Wait for ack is needed and make auto retry when write message is failed.
`void` | `sendMessage(byte[] data, boolean waitForAck)` Send message
`java.lang.String` | `toString()` Name of this SockerSender
`protected void` | `waitForAck()` Wait for Acknowledgement from other server FIXME Please, not wait only for three charcters, better control that the wait ack message is correct.

Methods inherited from class org.apache.catalina.tribes.transport.AbstractSender
`getAddress, getAttempt, getConnectTime, getDestination, getDirect, getDirectBuffer, getKeepAliveCount, getKeepAliveTime, getMaxRetryAttempts, getOoBInline, getPort, getRequestCount, getRxBufSize, getSoKeepAlive, getSoLingerOn, getSoLingerTime, getSoReuseAddress, getSoTrafficClass, getTcpNoDelay, getThrowOnFailedAck, getTimeout, getTxBufSize, isConnected, keepalive, setAddress, setAttempt, setConnected, setConnectTime, setDestination, setDirect, setDirectBuffer, setKeepAliveCount, setKeepAliveTime, setMaxRetryAttempts, setOoBInline, setPort, setRequestCount, setRxBufSize, setSoKeepAlive, setSoLingerOn, setSoLingerTime, setSoReuseAddress, setSoTrafficClass, setTcpNoDelay, setThrowOnFailedAck, setTimeout, setTxBufSize, transferProperties`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.apache.catalina.tribes.transport.DataSender
`getConnectTime, getRequestCount, isConnected, keepalive, setKeepAliveCount, setKeepAliveTime, setRxBufSize, setTimeout, setTxBufSize`

Field Detail

### sm

    protected static StringManager sm

  The string manager for this package.

### ackbuf

    protected XByteBuffer ackbuf

Constructor Detail

### BioSender

    public BioSender()

Method Detail

### getInfo

    public java.lang.String getInfo()

  Return descriptive information about this implementation and the corresponding version number, in the format `<description>/<version>`.

### connect

    public void connect()
                 throws java.io.IOException

  Connect other cluster member receiver

  Specified by:
    `connect` in interface `DataSender`
  Specified by:
    `connect` in class `AbstractSender`
  Throws:
    `java.io.IOException`
  See Also:
    `org.apache.catalina.tribes.transport.IDataSender#connect()`

### disconnect

    public void disconnect()

  disconnect and close socket

  Specified by:
    `disconnect` in interface `DataSender`
  Specified by:
    `disconnect` in class `AbstractSender`
  See Also:
    `IDataSender#disconnect()`

### sendMessage

    public void sendMessage(byte[] data,
                            boolean waitForAck)
                     throws java.io.IOException

  Send message

  Throws:
    `java.io.IOException`
  See Also:
    `org.apache.catalina.tribes.transport.IDataSender#sendMessage(, ChannelMessage)`

### toString

    public java.lang.String toString()

  Name of this SockerSender

  Overrides:
    `toString` in class `java.lang.Object`

### openSocket

    protected void openSocket()
                       throws java.io.IOException

  open real socket and set time out when waitForAck is enabled is socket open return directly

  Throws:
    `java.io.IOException`

### closeSocket

    protected void closeSocket()

  close socket

  See Also:
    `DataSender.disconnect()`, `DataSender#closeSocket()`

### pushMessage

    protected void pushMessage(byte[] data,
                               boolean reconnect,
                               boolean waitForAck)
                        throws java.io.IOException

  Push messages with only one socket at a time Wait for ack is needed and make auto retry when write message is failed. After sending error close and reopen socket again. After successfull sending update stats WARNING: Subclasses must be very carefull that only one thread call this pushMessage at once!!!

  Parameters:
    `data` - data to send
  Throws:
    `java.io.IOException`
  Since:
    5.5.10
  See Also:
    `closeSocket()`, `openSocket()`, `#writeData(ChannelMessage)`

### waitForAck

    protected void waitForAck()
                       throws java.io.IOException

  Wait for Acknowledgement from other server FIXME Please, not wait only for three charcters, better control that the wait ack message is correct.

  Parameters:
    `timeout` -
  Throws:
    `java.io.IOException`
    `java.net.SocketTimeoutException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.