Java Platform 1.2

org.omg.CORBA.portable
Class Delegate

java.lang.Object
  |
  +--org.omg.CORBA.portable.Delegate

public abstract class Delegate
extends Object

The Delegate abstract class specifies a portable API for ORB-vendor-specific implementation of the org.omg.CORBA.Object methods. Each stub (proxy) contains a delegate object, to which all org.omg.CORBA.Object methods are forwarded. This allows a stub generated by one vendor's ORB to work with the delegate from another vendor's ORB.

See Also:
Object

Constructor Summary
Delegate()
           
 
Method Summary
abstract  Request create_request(Object obj, Context ctx, String operation, NVList arg_list, NamedValue result)
          Creates a Request instance for use in the Dynamic Invocation Interface.
abstract  Request create_request(Object obj, Context ctx, String operation, NVList arg_list, NamedValue result, ExceptionList exclist, ContextList ctxlist)
          Create a Request instance for use in the Dynamic Invocation Interface.
abstract  Object duplicate(Object obj)
          Returns a duplicate of the object reference provided.
 boolean equals(Object self, Object obj)
           
 DomainManager[] get_domain_managers(Object self)
          Retrieves the DomainManagers of this object.
 Object get_interface_def(Object self)
          Return an InterfaceDef for the object reference provided.
 Policy get_policy(Object self, int policy_type)
          Returns the Policy object of the specified type which applies to this object.
abstract  int hash(Object obj, int max)
          Returns an ORB-internal identifier (hashcode) for this object reference.
 int hashCode(Object self)
           
 InputStream invoke(Object self, OutputStream output)
          invoke is called by a stub to invoke an operation.
abstract  boolean is_a(Object obj, String repository_id)
          Check if the object reference is an instance of the given interface.
abstract  boolean is_equivalent(Object obj, Object other)
          Determines if the two object references are equivalent.
 boolean is_local(Object self)
          Returns true if this object is implemented by a local servant.
abstract  boolean non_existent(Object obj)
          Determines whether the server object for the object reference has been destroyed.
 ORB orb(Object obj)
          Return the ORB that created this delegate.
abstract  void release(Object obj)
          Releases resources associated with the object reference provided.
 void releaseReply(Object self, InputStream input)
          releaseReply may optionally be called by a stub to release a reply stream back to the ORB when the unmarshaling has completed.
abstract  Request request(Object obj, String operation)
          Creates a Request instance for use in the Dynamic Invocation Interface.
 OutputStream request(Object self, String operation, boolean responseExpected)
          request is called by a stub to obtain an OutputStream for marshaling arguments.
 void servant_postinvoke(Object self, ServantObject servant)
          servant_postinvoke() is invoked by the local stub after the operation has been invoked on the local servant.
 ServantObject servant_preinvoke(Object self, String operation, Class expectedType)
          Returns a Java reference to the servant which should be used for this request.
 Object set_policy_override(Object self, Policy[] policies, SetOverrideType set_add)
           
 String toString(Object self)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Delegate

public Delegate()
Method Detail

get_interface_def

public Object get_interface_def(Object self)
Return an InterfaceDef for the object reference provided.
Parameters:
obj - The object reference whose InterfaceDef needs to be returned
Returns:
the InterfaceDef

duplicate

public abstract Object duplicate(Object obj)
Returns a duplicate of the object reference provided.
Parameters:
obj - The object reference whose duplicate needs to be returned
Returns:
the duplicate object reference

release

public abstract void release(Object obj)
Releases resources associated with the object reference provided.
Parameters:
obj - The object reference whose resources need to be released

is_a

public abstract boolean is_a(Object obj,
                             String repository_id)
Check if the object reference is an instance of the given interface.
Parameters:
obj - The object reference to be checked.
repository_id - The repository identifier of the interface to check against.
Returns:
true if the object reference supports the interface

non_existent

public abstract boolean non_existent(Object obj)
Determines whether the server object for the object reference has been destroyed.
Parameters:
obj - The object reference which delegated to this delegate.

is_equivalent

public abstract boolean is_equivalent(Object obj,
                                      Object other)
Determines if the two object references are equivalent.
Parameters:
obj - The object reference which delegated to this delegate.
other - The object reference to check equivalence against.

hash

public abstract int hash(Object obj,
                         int max)
Returns an ORB-internal identifier (hashcode) for this object reference.
Parameters:
obj - The object reference which delegated to this delegate.
maximum - specifies an upper bound on the hash value returned by the ORB.
Returns:
ORB-internal hash identifier for object reference

request

public abstract Request request(Object obj,
                                String operation)
Creates a Request instance for use in the Dynamic Invocation Interface.
Parameters:
obj - The object reference which delegated to this delegate.
operation - The name of the operation to be invoked using the Request instance.
Returns:
the created Request instance

create_request

public abstract Request create_request(Object obj,
                                       Context ctx,
                                       String operation,
                                       NVList arg_list,
                                       NamedValue result)
Creates a Request instance for use in the Dynamic Invocation Interface.
Parameters:
obj - The object reference which delegated to this delegate.
ctx - The context to be used.
operation - The name of the operation to be invoked.
arg_list - The arguments to the operation in the form of an NVList.
result - A container for the result as a NamedValue.
Returns:
The created Request object.

create_request

public abstract Request create_request(Object obj,
                                       Context ctx,
                                       String operation,
                                       NVList arg_list,
                                       NamedValue result,
                                       ExceptionList exclist,
                                       ContextList ctxlist)
Create a Request instance for use in the Dynamic Invocation Interface.
Parameters:
obj - The object reference which delegated to this delegate.
ctx - The context to be used.
operation - The name of the operation to be invoked.
arg_list - The arguments to the operation in the form of an NVList.
result - A container for the result as a NamedValue.
exclist - A list of possible exceptions the operation can throw.
ctxlist - A list of context strings that need to be resolved and sent with the Request.
Returns:
The created Request object.

orb

public ORB orb(Object obj)
Return the ORB that created this delegate.
See Also:
portable package comments for unimplemented features

get_policy

public Policy get_policy(Object self,
                         int policy_type)
Returns the Policy object of the specified type which applies to this object.
Parameters:
self - The object reference which delegated to this delegate.
policy_type - The type of policy to be obtained.
Returns:
A Policy object of the type specified by the policy_type parameter.
Throws:
BAD_PARAM - raised when the value of policy type is not valid either because the specified type is not supported by this ORB or because a policy object of that type is not associated with this Object.
See Also:
portable package comments for unimplemented features

get_domain_managers

public DomainManager[] get_domain_managers(Object self)
Retrieves the DomainManagers of this object. This allows administration services (and applications) to retrieve the domain managers, and hence the security and other policies applicable to individual objects that are members of the domain.
Parameters:
self - The object reference which delegated to this delegate.
Returns:
The list of immediately enclosing domain managers of this object. At least one domain manager is always returned in the list since by default each object is associated with at least one domain manager at creation.
See Also:
portable package comments for unimplemented features

set_policy_override

public Object set_policy_override(Object self,
                                  Policy[] policies,
                                  SetOverrideType set_add)
See Also:
portable package comments for unimplemented features

is_local

public boolean is_local(Object self)
Returns true if this object is implemented by a local servant.
Parameters:
self - The object reference which delegated to this delegate.
Returns:
true only if the servant incarnating this object is located in this Java VM. Return false if the servant is not local or the ORB does not support local stubs for this particular servant. The default behavior of is_local() is to return false.

servant_preinvoke

public ServantObject servant_preinvoke(Object self,
                                       String operation,
                                       Class expectedType)
Returns a Java reference to the servant which should be used for this request. servant_preinvoke() is invoked by a local stub. If a ServantObject object is returned, then its servant field has been set to an object of the expected type (Note: the object may or may not be the actual servant instance). The local stub may cast the servant field to the expected type, and then invoke the operation directly. The ServantRequest object is valid for only one invocation, and cannot be used for more than one invocation.
Parameters:
self - The object reference which delegated to this delegate.
operation - a string containing the operation name. The operation name corresponds to the operation name as it would be encoded in a GIOP request.
a - Class object representing the expected type of the servant. The expected type is the Class object associated with the operations class of the stub's interface (e.g. A stub for an interface Foo, would pass the Class object for the FooOperations interface).
Returns:
a ServantObject object. The method may return a null value if it does not wish to support this optimization (e.g. due to security, transactions, etc). The method must return null if the servant is not of the expected type.

servant_postinvoke

public void servant_postinvoke(Object self,
                               ServantObject servant)
servant_postinvoke() is invoked by the local stub after the operation has been invoked on the local servant. This method must be called if servant_preinvoke() returned a non-null value, even if an exception was thrown by the servant's method. For this reason, the call to servant_postinvoke() should be placed in a Java finally clause.
Parameters:
self - The object reference which delegated to this delegate.
servant - the instance of the ServantObject returned from the servant_preinvoke() method.

request

public OutputStream request(Object self,
                            String operation,
                            boolean responseExpected)
request is called by a stub to obtain an OutputStream for marshaling arguments. The stub must supply the operation name, and indicate if a response is expected (i.e is this a oneway call).
Parameters:
self - The object reference which delegated to this delegate.
operation - a string containing the operation name. The operation name corresponds to the operation name as it would be encoded in a GIOP request.
responseExpected - false if the operation is a one way operation, and true otherwise.
Returns:
OutputStream the OutputStream into which request arguments can be marshaled.
See Also:
portable package comments for unimplemented features

invoke

public InputStream invoke(Object self,
                          OutputStream output)
                   throws ApplicationException,
                          RemarshalException
invoke is called by a stub to invoke an operation. The stub provides an OutputStream that was previously returned by a request() call. invoke returns an InputStream which contains the marshaled reply. If an exception occurs, invoke may throw an ApplicationException object which contains an InputStream from which the user exception state may be unmarshaled.
Parameters:
self - The object reference which delegated to this delegate.
output - the OutputStream which contains marshaled arguments
Returns:
input the InputStream from which reply parameters can be unmarshaled.
See Also:
portable package comments for unimplemented features

releaseReply

public void releaseReply(Object self,
                         InputStream input)
releaseReply may optionally be called by a stub to release a reply stream back to the ORB when the unmarshaling has completed. The stub passes the InputStream returned by invoke() or ApplicationException.getInputStream(). A null value may also be passed to releaseReply, in which case the method is a noop.
Parameters:
self - The object reference which delegated to this delegate.
input - the InputStream returned from invoke().
See Also:
portable package comments for unimplemented features

toString

public String toString(Object self)

hashCode

public int hashCode(Object self)

equals

public boolean equals(Object self,
                      Object obj)

Java Platform 1.2

Submit a bug or feature Version 1.2 of Java Platform API Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.