org.openorb.net
Interface ClientChannel

All Superinterfaces:
Channel
All Known Implementing Classes:
IIOPClientChannel

public interface ClientChannel
extends Channel

Client channel interface. A client channel creates and sends requests and recieves replies.

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

Field Summary
static int STATE_CLOSED
          Channel closed.
static int STATE_CONNECTED
          Connection open.
static int STATE_PAUSED
          Channel paused.
 
Method Summary
 void close(boolean kill_requests, SystemException ex)
          Change to the CLOSED state and reject new requests by throwing a system exception with status COMPLETED_NO.
 ClientRequest create_locate_request(Object target, Address address, java.lang.Object transportAssociation)
          Create a locate request.
 ClientRequest create_request(Object target, Address address, java.lang.Object transportAssociation, java.lang.String operation, boolean response_expected)
          Create a request.
 ORB orb()
          An orb reference.
 void pause()
          Pause the channel.
 int state()
          Connection state.
 
Methods inherited from interface org.openorb.net.Channel
active_requests, channel_age, recv, run_recv
 

Field Detail

STATE_CONNECTED

public static final int STATE_CONNECTED
Connection open. In this state requests can be created without checking the rebind policy.

STATE_PAUSED

public static final int STATE_PAUSED
Channel paused. The channel has been shut down temporaraly to conserve resources or has recently been created. Creating new requests with with rebind policy set to NO_RECONNECT will result in a REBIND exception. Channels are created in this state.

STATE_CLOSED

public static final int STATE_CLOSED
Channel closed. This state is typicaly reached if transmission difficulties are experienced. Attempting to create requests on closed channels will cause a system exception. The channel can be reopened only using the open operation.
Method Detail

orb

public ORB orb()
An orb reference.

state

public int state()
Connection state. Note that state values are 0x1000000 apart, Allowing this value to be ORed with the binding priority on the client side.

pause

public void pause()
Pause the channel. If no requests are currently active enter the paused state.

close

public void close(boolean kill_requests,
                  SystemException ex)
Change to the CLOSED state and reject new requests by throwing a system exception with status COMPLETED_NO. If kill_requests is true, call cancel on any active ClientRequests, otherwise wait until active requests complete before closing the commmunication channel.

create_request

public ClientRequest create_request(Object target,
                                    Address address,
                                    java.lang.Object transportAssociation,
                                    java.lang.String operation,
                                    boolean response_expected)
                             throws RebindChannelException
Create a request. If this is the first request on this channel then client_connect will be called on all ChannelInterceptor before returning the request. This may throw a system exception if the channel cannot establish a connection for some reason, for example INV_POLICY if client side policies prevent a successfull invocation, COMM_FAILURE if a communication problem occours, or REBIND if channel is temporaraly closed and a NO_REBIND policy is in effect.
Parameters:
target - The target of the request.
address - The target address. If the target has been redirected this may not correspond to the target's ior.

create_locate_request

public ClientRequest create_locate_request(Object target,
                                           Address address,
                                           java.lang.Object transportAssociation)
                                    throws RebindChannelException
Create a locate request. This may throw a system exception if the channel cannot establish a connection for some reason, for example INV_POLICY if client side policies prevent a successfull invocation, COMM_FAILURE if a communication problem occours, or REBIND if channel is temporaraly closed and a NO_REBIND policy is in effect.
Parameters:
target - The target of the request.
address - The target address. If the target has been redirected this may not correspond to the target's ior.