org.openorb.net
Interface Channel

All Known Subinterfaces:
ClientChannel, ServerChannel

public interface Channel

General interface for a communications channel. A communications channel can either send or recieve requests and typicaly has two associated worker threads, one for reading messages and one for writing messages.

Version:
$Revision: 1.5 $ $Date: 2002/06/28 08:59:05 $
Author:
Chris Wood

Method Summary
 int active_requests()
          Active request count.
 int channel_age()
          Indication of channel age.
 boolean recv(int timeout)
          Wait the specified amount of time for an incoming message.
 void run_recv()
          Donate a thread for recieving messages.
 

Method Detail

active_requests

public int active_requests()
Active request count. This is the number of requests which have not yet been sent or are still expecting a reply. This will return -1 if the channel has been perminently closed.

channel_age

public int channel_age()
Indication of channel age. This will result in a call to peek_request_id if active_requests would be non-zero, otherwise it returns whatever peek_request_id returned the last time active_requests dropped to zero.

run_recv

public void run_recv()
Donate a thread for recieving messages. This function returns when interrupt is called on the thread or the channel is closed.

recv

public boolean recv(int timeout)
Wait the specified amount of time for an incoming message.
Returns:
false if the channel is closed.