org.openorb.orb.net
Class ClientBinding

java.lang.Object
  |
  +--org.openorb.orb.net.ClientBinding

public class ClientBinding
extends java.lang.Object

A client binding represents a potential request path between client and server.

Version:
$Revision: 1.8 $ $Date: 2004/02/07 13:09:07 $
Author:
Chris Wood

Field Summary
static int DEAD_PRIORITY
           
static int FORCE_FALSE
           
static int FORCE_TRUE
           
static int FORCE_UNSET
           
static int MASK_ADDRESS_PRIORITY
          Significant bits in selecting between alternate addresses from the same profile.
static int MASK_IOR_PRIORITY
          Significant bits in selecting between alternate IORs
static int MASK_PROFILE_PRIORITY
          Significant bits in selecting between alternate addresses from different profiles.
static java.util.Comparator PRIORITY_COMP
           
 
Constructor Summary
protected ClientBinding(Address address)
          Constructor.
  ClientBinding(Address address, ClientChannel channel)
          Bind address to remote invocation channel.
  ClientBinding(Address address, ClientChannel channel, ServerManager serverManager)
          Bind address to local adapter.
  ClientBinding(Address address, org.omg.CORBA.SystemException ex)
          Bind address to a system exception.
 
Method Summary
 ClientRequest create_locate_request(org.omg.CORBA.Object target)
          Create a locate request.
 LocalClientRequest create_request_local(org.omg.CORBA.ORB orb, org.omg.CORBA.Object target, java.lang.String operation, boolean response_expected, Address[] adresses)
          This is a factory method for creation a new Local Client Request.
 ClientRequest create_request(org.omg.CORBA.Object target, java.lang.String operation, boolean response_expected)
          Create a request.
 boolean equals(java.lang.Object obj)
           
 org.omg.CORBA.Object get_component()
          Calls get_component on the adapter.
 org.omg.CORBA.DomainManager[] get_domain_managers()
          Calls get_domain_managers on the adapter.
 org.omg.CORBA.Object get_interface_def()
          Calls get_interface_def on the adapter.
 Address getAddress()
          Return the client address.
 ClientChannel getClientChannel()
          Return the client channel.
 ObjectAdapter getObjectAdapter()
          Return the object adapter.
 int getPriority()
          Get binding priority.
 int hashCode()
           
 boolean is_a(java.lang.String repository_id)
          Calls is_a on the adapter.
 boolean local_invoke()
          True if the target can accept local invocations.
 boolean locate()
          Calls locate on the adapter.
 void servant_postinvoke(org.omg.CORBA.portable.ServantObject srvObject)
          Calls servant_postinvoke on the adapter.
 org.omg.CORBA.portable.ServantObject servant_preinvoke(java.lang.String operation, java.lang.Class expectedType)
          Calls servant_preinvoke on the adapter.
 void setPriority(int priority)
          Set the binding priority.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEAD_PRIORITY

public static final int DEAD_PRIORITY

FORCE_UNSET

public static final int FORCE_UNSET

FORCE_FALSE

public static final int FORCE_FALSE

FORCE_TRUE

public static final int FORCE_TRUE

MASK_ADDRESS_PRIORITY

public static final int MASK_ADDRESS_PRIORITY
Significant bits in selecting between alternate addresses from the same profile. These bits are not settable by the setPriority operation.

MASK_PROFILE_PRIORITY

public static final int MASK_PROFILE_PRIORITY
Significant bits in selecting between alternate addresses from different profiles.

MASK_IOR_PRIORITY

public static final int MASK_IOR_PRIORITY
Significant bits in selecting between alternate IORs

PRIORITY_COMP

public static final java.util.Comparator PRIORITY_COMP
Constructor Detail

ClientBinding

protected ClientBinding(Address address)
Constructor.

ClientBinding

public ClientBinding(Address address,
                     ClientChannel channel)
Bind address to remote invocation channel.

ClientBinding

public ClientBinding(Address address,
                     ClientChannel channel,
                     ServerManager serverManager)
Bind address to local adapter.

ClientBinding

public ClientBinding(Address address,
                     org.omg.CORBA.SystemException ex)
Bind address to a system exception. Placeholder for failed bindings
Method Detail

getAddress

public Address getAddress()
Return the client address.

getClientChannel

public ClientChannel getClientChannel()
Return the client channel. This is always available for both local and nonlocal bindings.

getObjectAdapter

public ObjectAdapter getObjectAdapter()
Return the object adapter. This will return null if the binding is non-local.

getPriority

public int getPriority()
Get binding priority. Low priorities are used first. The lowest order byte of the priority is inter-component priority, The second order byte is inter-profile priority, The third order byte is inter-refrerence prioriy The highest order byte is the channel state / adapter priority.

setPriority

public void setPriority(int priority)
Set the binding priority. Lower values are used first. This should be set with respect to the current priority, changing only the appropriate bits.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

local_invoke

public boolean local_invoke()
True if the target can accept local invocations. The object reference operations such as is_a are available for local invocation whenever getObjectAdapter returns non null.

create_request

public ClientRequest create_request(org.omg.CORBA.Object target,
                                    java.lang.String operation,
                                    boolean response_expected)
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 return null if the channel is unable to create a request. This just calls create_request on the channel with the binding's address and the specified target.
Parameters:
target - The target of the request.
operation - The operation to create the request for.
response_expected - A flag that indicates whether a response is expected or not (oneway).

create_request_local

public LocalClientRequest create_request_local(org.omg.CORBA.ORB orb,
                                               org.omg.CORBA.Object target,
                                               java.lang.String operation,
                                               boolean response_expected,
                                               Address[] adresses)
This is a factory method for creation a new Local Client Request. This is necessary for having a clean handling of the request_id.
Parameters:
orb - ORB
target - target object for the request
operation - operation
response_expected - oneway call or not
adresses - all the adresses of the target
Returns:
A new instance of this class.

create_locate_request

public ClientRequest create_locate_request(org.omg.CORBA.Object target)
Create a locate request. This may return null if the channel is unable to create a request. This just calls create_locate_request on the channel with the binding's address and the specified target.
Parameters:
target - The target of the request.

servant_preinvoke

public org.omg.CORBA.portable.ServantObject servant_preinvoke(java.lang.String operation,
                                                              java.lang.Class expectedType)
                                                       throws org.omg.PortableInterceptor.ForwardRequest
Calls servant_preinvoke on the adapter. This may return null if a retry is indicated.

servant_postinvoke

public void servant_postinvoke(org.omg.CORBA.portable.ServantObject srvObject)
Calls servant_postinvoke on the adapter.

locate

public boolean locate()
               throws org.omg.PortableInterceptor.ForwardRequest
Calls locate on the adapter.

is_a

public boolean is_a(java.lang.String repository_id)
             throws org.omg.PortableInterceptor.ForwardRequest
Calls is_a on the adapter.

get_interface_def

public org.omg.CORBA.Object get_interface_def()
                                       throws org.omg.PortableInterceptor.ForwardRequest
Calls get_interface_def on the adapter.

get_domain_managers

public org.omg.CORBA.DomainManager[] get_domain_managers()
                                                  throws org.omg.PortableInterceptor.ForwardRequest
Calls get_domain_managers on the adapter.

get_component

public org.omg.CORBA.Object get_component()
                                   throws org.omg.PortableInterceptor.ForwardRequest
Calls get_component on the adapter.