Package com.sun.corba.ee.impl.protocol
Class ClientDelegateImpl
- java.lang.Object
-
- org.omg.CORBA.portable.Delegate
-
- org.omg.CORBA_2_3.portable.Delegate
-
- com.sun.corba.ee.spi.protocol.ClientDelegate
-
- com.sun.corba.ee.impl.protocol.ClientDelegateImpl
-
public class ClientDelegateImpl extends ClientDelegate
-
-
Field Summary
Fields Modifier and Type Field Description private ContactInfoListcontactInfoListprivate ORBorbprivate static ORBUtilSystemExceptionwrapper
-
Constructor Summary
Constructors Constructor Description ClientDelegateImpl(ORB orb, ContactInfoList contactInfoList)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcallingServer()Requestcreate_request(Object obj, Context ctx, java.lang.String operation, NVList arg_list, NamedValue result)Creates a Request instance for use in the Dynamic Invocation Interface.Requestcreate_request(Object obj, Context ctx, java.lang.String operation, NVList arg_list, NamedValue result, ExceptionList exclist, ContextList ctxlist)Creates a Request instance for use in the Dynamic Invocation Interface.Objectduplicate(Object obj)Returns a duplicate of the object reference provided.private voideffectiveTargetIOR(IOR ior)private voidenter_hasNextNext()private voidenter_totalInvocation()booleanequals(Object self, java.lang.Object other)This method overrides the org.omg.CORBA.portable.Delegate.equals method, and does the equality check based on IOR equality.private voidexit_hasNextNext()private voidexit_totalInvocation()private voidfoundIdInRepostioryId()private voidfoundMyId()java.lang.Stringget_codebase(Object self)Returns the codebase for object reference provided.Objectget_interface_def(Object obj)Return an InterfaceDef for the object reference provided.ORBgetBroker()The ORB associated * with an invocation.private ClientRequestDispatchergetClientRequestDispatcher()ContactInfoListgetContactInfoList()Get the CorbaContactInfoList which represents they encoding/protocol/transport combinations that may be used to contact the service.private IIOPAddressgetPrimaryAddress(IOR ior)inthash(Object obj, int maximum)Returns an ORB-internal identifier (hashcode) for this object reference.inthashCode()inthashCode(Object obj)Provides the implementation to override the hashCode() method of the delegating CORBA object.InputStreaminvoke(Object self, OutputStream output)invoke is called by a stub to invoke an operation.booleanis_a(Object obj, java.lang.String dest)Checks if the object reference is an instance of the given interface.booleanis_equivalent(Object obj, Object ref)Determines if the two object references are equivalent.booleanis_local(Object self)Returns true if this object is implemented by a local servant.booleannon_existent(Object obj)Determines whether the server object for the object reference has been destroyed.ORBorb(Object obj)Provides a reference to the orb associated with its parameter.voidrelease(Object obj)Releases resources associated with the object reference provided.voidreleaseReply(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.Requestrequest(Object obj, java.lang.String operation)Creates a Request instance for use in the Dynamic Invocation Interface.OutputStreamrequest(Object self, java.lang.String operation, boolean responseExpected)request is called by a stub to obtain an OutputStream for marshaling arguments.private voidrequestInfo(java.lang.String operation, ContactInfo info)private voidretryingRequest()private voidretryingRequest(java.lang.Exception exc)voidservant_postinvoke(Object self, ServantObject servant)servant_postinvoke() is invoked by the local stub after the operation has been invoked on the local servant.ServantObjectservant_preinvoke(Object self, java.lang.String operation, java.lang.Class expectedType)Returns a Java reference to the servant which should be used for this request.private voidserverReturned()private voidtargetIOR(IOR ior)java.lang.StringtoString(Object self)Provides the implementation to override the toString() method of the delegating CORBA object.-
Methods inherited from class org.omg.CORBA.portable.Delegate
get_domain_managers, get_policy, set_policy_override
-
-
-
-
Field Detail
-
orb
private ORB orb
-
wrapper
private static final ORBUtilSystemException wrapper
-
contactInfoList
private ContactInfoList contactInfoList
-
-
Constructor Detail
-
ClientDelegateImpl
public ClientDelegateImpl(ORB orb, ContactInfoList contactInfoList)
-
-
Method Detail
-
getBroker
public ORB getBroker()
Description copied from class:ClientDelegateThe ORB associated * with an invocation.- Specified by:
getBrokerin classClientDelegate- Returns:
- ORB
-
getContactInfoList
public ContactInfoList getContactInfoList()
Description copied from class:ClientDelegateGet the CorbaContactInfoList which represents they encoding/protocol/transport combinations that may be used to contact the service.- Specified by:
getContactInfoListin classClientDelegate- Returns:
- CorbaContactInfoList
-
requestInfo
@InfoMethod private void requestInfo(java.lang.String operation, ContactInfo info)
-
retryingRequest
@InfoMethod private void retryingRequest(java.lang.Exception exc)
-
enter_totalInvocation
@InfoMethod(tpName="totalInvocation", tpType=ENTER) private void enter_totalInvocation()
-
exit_totalInvocation
@InfoMethod(tpName="totalInvocation", tpType=EXIT) private void exit_totalInvocation()
-
enter_hasNextNext
@InfoMethod(tpName="hasNextNext", tpType=ENTER) private void enter_hasNextNext()
-
exit_hasNextNext
@InfoMethod(tpName="hasNextNext", tpType=EXIT) private void exit_hasNextNext()
-
getPrimaryAddress
private IIOPAddress getPrimaryAddress(IOR ior)
-
targetIOR
@InfoMethod private void targetIOR(IOR ior)
-
effectiveTargetIOR
@InfoMethod private void effectiveTargetIOR(IOR ior)
-
request
public OutputStream request(Object self, java.lang.String operation, boolean responseExpected)
Description copied from class:Delegaterequest 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).- Overrides:
requestin classDelegate- 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:
portablepackage comments for unimplemented features
-
invoke
public InputStream invoke(Object self, OutputStream output) throws ApplicationException, RemarshalException
Description copied from class:Delegateinvoke 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.- Overrides:
invokein classDelegate- 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.
- Throws:
ApplicationException- thrown when implementation throws (upon invocation) an exception defined as part of its remote method definition.RemarshalException- thrown when remarshalling fails.- See Also:
portablepackage comments for unimplemented features
-
releaseReply
public void releaseReply(Object self, InputStream input)
Description copied from class:DelegatereleaseReply 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.- Overrides:
releaseReplyin classDelegate- Parameters:
self- The object reference which delegated to this delegate.input- the InputStream returned from invoke().- See Also:
portablepackage comments for unimplemented features
-
getClientRequestDispatcher
private ClientRequestDispatcher getClientRequestDispatcher()
-
get_interface_def
public Object get_interface_def(Object obj)
Description copied from class:DelegateReturn an InterfaceDef for the object reference provided.- Specified by:
get_interface_defin classDelegate- Parameters:
obj- The object reference whose InterfaceDef needs to be returned- Returns:
- the InterfaceDef
-
foundMyId
@InfoMethod private void foundMyId()
-
foundIdInRepostioryId
@InfoMethod private void foundIdInRepostioryId()
-
callingServer
@InfoMethod private void callingServer()
-
serverReturned
@InfoMethod private void serverReturned()
-
retryingRequest
@InfoMethod private void retryingRequest()
-
is_a
public boolean is_a(Object obj, java.lang.String dest)
Description copied from class:DelegateChecks if the object reference is an instance of the given interface.
-
non_existent
public boolean non_existent(Object obj)
Description copied from class:DelegateDetermines whether the server object for the object reference has been destroyed.- Specified by:
non_existentin classDelegate- Parameters:
obj- The object reference which delegated to this delegate.- Returns:
- true if the ORB knows authoritatively that the server object does not exist, false otherwise
-
duplicate
public Object duplicate(Object obj)
Description copied from class:DelegateReturns a duplicate of the object reference provided.
-
release
public void release(Object obj)
Description copied from class:DelegateReleases resources associated with the object reference provided.
-
is_equivalent
public boolean is_equivalent(Object obj, Object ref)
Description copied from class:DelegateDetermines if the two object references are equivalent.- Specified by:
is_equivalentin classDelegate- Parameters:
obj- The object reference which delegated to this delegate.ref- The object reference to check equivalence against.- Returns:
- true if the objects are CORBA-equivalent.
-
equals
public boolean equals(Object self, java.lang.Object other)
This method overrides the org.omg.CORBA.portable.Delegate.equals method, and does the equality check based on IOR equality.
-
hashCode
public int hashCode(Object obj)
Description copied from class:DelegateProvides the implementation to override the hashCode() method of the delegating CORBA object.
-
hash
public int hash(Object obj, int maximum)
Description copied from class:DelegateReturns an ORB-internal identifier (hashcode) for this object reference.
-
request
public Request request(Object obj, java.lang.String operation)
Description copied from class:DelegateCreates a Request instance for use in the Dynamic Invocation Interface.
-
create_request
public Request create_request(Object obj, Context ctx, java.lang.String operation, NVList arg_list, NamedValue result)
Description copied from class:DelegateCreates a Request instance for use in the Dynamic Invocation Interface.- Specified by:
create_requestin classDelegate- 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 Request create_request(Object obj, Context ctx, java.lang.String operation, NVList arg_list, NamedValue result, ExceptionList exclist, ContextList ctxlist)
Description copied from class:DelegateCreates a Request instance for use in the Dynamic Invocation Interface.- Specified by:
create_requestin classDelegate- 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)
Description copied from class:DelegateProvides a reference to the orb associated with its parameter.- Overrides:
orbin classDelegate- Parameters:
obj- the object reference which delegated to this delegate.- Returns:
- the associated orb.
- See Also:
portablepackage comments for unimplemented features
-
is_local
public boolean is_local(Object self)
Returns true if this object is implemented by a local servant. REVISIT: locatedIOR should be replaced with a method call that returns the current IOR for this request (e.g. ContactInfoChooser).
-
servant_preinvoke
public ServantObject servant_preinvoke(Object self, java.lang.String operation, java.lang.Class expectedType)
Description copied from class:DelegateReturns 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.- Overrides:
servant_preinvokein classDelegate- 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.expectedType- 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)
Description copied from class:Delegateservant_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.- Overrides:
servant_postinvokein classDelegate- Parameters:
self- The object reference which delegated to this delegate.servant- the instance of the ServantObject returned from the servant_preinvoke() method.
-
get_codebase
public java.lang.String get_codebase(Object self)
Description copied from class:DelegateReturns the codebase for object reference provided.- Overrides:
get_codebasein classDelegate- Parameters:
self- the object reference whose codebase needs to be returned.- Returns:
- the codebase as a space delimited list of url strings or null if none.
-
toString
public java.lang.String toString(Object self)
Description copied from class:DelegateProvides the implementation to override the toString() method of the delegating CORBA object.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-