SharedChannel (BEEP Core API)

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

## org.beepcore.beep.lib
Class SharedChannel

    java.lang.Object
      |
      +--org.beepcore.beep.core.Channel
            |
            +--org.beepcore.beep.lib.SharedChannel

public class SharedChannel
extends Channel

`SharedChannel` references a `Channel`. A `ChannelPool` holds a collection of `SharedChannel`s. Call `ChannelPoll`'s `getSharedChannel` to create a `SharedChannel`.

See Also:
  `ChannelPool`

Field Summary

Fields inherited from class org.beepcore.beep.core.Channel
`STATE_ABORTED, STATE_ACTIVE, STATE_CLOSE_PENDING, STATE_CLOSED, STATE_CLOSING, STATE_INITIALIZED, STATE_STARTING, STATE_TUNING, STATE_TUNING_PENDING`

Method Summary
`void` | `close()` Closes this `SharedChannel`.
`int` | `getBufferSize()` Returns the receive buffer size for this channel.
`int` | `getBufferUsed()` Returns the size of the used portion of the receive buffer for this channel.
`MessageListener` | `getMessageListener()` Returns the message listener for this channel.
`int` | `getNumber()` Return the number of this `Channel`.
`java.lang.String` | `getProfile()` Returns the profile used to create this `SharedChannel`.
`Session` | `getSession()` Returns the session for this channel.
`void` | `release()` Marks this `SharedChannel` as available for reuse.
`MessageStatus` | `sendMSG(OutputDataStream stream, ReplyListener replyListener)` Send a message of type MSG.
`Reply` | `sendRequest(OutputDataStream ds)` Sends a 'synchronous' request on this `SharedChannel`.
`MessageListener` | `setMessageListener(MessageListener dl)` Sets the `DataListener` for this `SharedChannel`.
`void` | `setReceiveBufferSize(int size)` Sets the receive buffer size for this channel.

Methods inherited from class org.beepcore.beep.core.Channel
`getAppData, getStartData, setAppData, setStartData`

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

Method Detail

### release

    public void release()

  Marks this `SharedChannel` as available for reuse.

### sendMSG

    public MessageStatus sendMSG(OutputDataStream stream,
                                 ReplyListener replyListener)
                          throws BEEPException

  Send a message of type MSG. Sends `stream` as message's payload.

  Overrides:
    `sendMSG` in class `Channel`
  Parameters:
    `stream` - `DataStream` that is read to send data.
    `replyListener` -
  Returns:
    MessageStatus Can be queried to get status information about the message.
  Throws:
    `BEEPException`
  See Also:
    `OutputDataStream`, `MessageStatus`

### setMessageListener

    public MessageListener setMessageListener(MessageListener dl)

  Sets the `DataListener` for this `SharedChannel`.

  Overrides:
    `setMessageListener` in class `Channel`
  Parameters:
    `dl` -
  Returns:
    The previous MessageListener or null if none was set.

### setReceiveBufferSize

    public void setReceiveBufferSize(int size)
                              throws BEEPException

  Description copied from class: `Channel`
  Sets the receive buffer size for this channel. Default size is 4K.

  Overrides:
    `setReceiveBufferSize` in class `Channel`
  Parameters:
    `size` -
  Throws:
    `BEEPException`

### getBufferSize

    public int getBufferSize()

  Description copied from class: `Channel`
  Returns the receive buffer size for this channel.

  Overrides:
    `getBufferSize` in class `Channel`

### getBufferUsed

    public int getBufferUsed()

  Description copied from class: `Channel`
  Returns the size of the used portion of the receive buffer for this channel.

  Overrides:
    `getBufferUsed` in class `Channel`

### getMessageListener

    public MessageListener getMessageListener()

  Description copied from class: `Channel`
  Returns the message listener for this channel.

  Overrides:
    `getMessageListener` in class `Channel`

### getNumber

    public int getNumber()

  Description copied from class: `Channel`
  Return the number of this `Channel`.

  Overrides:
    `getNumber` in class `Channel`

### getSession

    public Session getSession()

  Description copied from class: `Channel`
  Returns the session for this channel.

  Overrides:
    `getSession` in class `Channel`

### getProfile

    public java.lang.String getProfile()

  Returns the profile used to create this `SharedChannel`.

  Overrides:
    `getProfile` in class `Channel`

### close

    public void close()
               throws BEEPException

  Closes this `SharedChannel`.

  Overrides:
    `close` in class `Channel`
  Throws:
    `BEEPException`

### sendRequest

    public Reply sendRequest(OutputDataStream ds)
                      throws BEEPException

  Sends a 'synchronous' request on this `SharedChannel`.

  Parameters:
    `ds` - `DataStream` to send as this request's payload.
  Returns:
    Reply Caller may block using this object to retrieve the reply to this request.
  Throws:
    `BEEPException`

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

Copyright ? 2001 Invisible Worlds, Inc. All Rights Reserved.