public abstract class ObjectImpl extends Objectimplements Object
org.omg.CORBA.Object methods. All method implementations are forwarded to a
Delegate object stored in the
ObjectImpl instance.
ObjectImpl allows for portable stubs because the
Delegate can be implemented by a different vendor-specific ORB.
| Constructor and Description |
|---|
ObjectImpl()
|
| Modifier and Type | Method and Description |
|---|---|
Request |
_create_request(Context
Creates a
Request object that contains the given context, method, argument list, and container for the result.
|
Request |
_create_request(Context
Creates a
Request object that contains the given context, method, argument list, container for the result, exceptions, and list of property names to be used in resolving the context strings.
|
Object |
_duplicate()
Returns a duplicate of this
ObjectImpl object.
|
Delegate |
_get_delegate()
Retrieves the reference to the vendor-specific
Delegate object to which this
ObjectImpl object delegates all methods invoked on it.
|
DomainManager |
_get_domain_managers()
Retrieves a list of the domain managers for this
ObjectImpl object.
|
Object |
_get_interface_def()
Retrieves the interface definition for this
ObjectImpl object.
|
Policy |
_get_policy(int policy_type)
Retrieves the
Policy object for this
ObjectImpl object that has the given policy type.
|
int |
_hash(int maximum)
Retrieves the hash code that serves as an ORB-internal identifier for this
ObjectImpl object.
|
abstract String |
_ids()
Retrieves a string array containing the repository identifiers supported by this
ObjectImpl object.
|
InputStream |
_invoke(OutputStream
Invokes an operation and returns an
InputStream object for reading the response.
|
boolean |
_is_a(String
Checks whether the object identified by the given repository identifier is an
ObjectImpl object.
|
boolean |
_is_equivalent(Object
Checks whether the the given
ObjectImpl object is equivalent to this
ObjectImpl object.
|
boolean |
_is_local()
Checks whether this
ObjectImpl object is implemented by a local servant.
|
boolean |
_non_existent()
Checks whether the server object for this
ObjectImpl object has been destroyed.
|
ORB |
_orb()
Returns a reference to the ORB associated with this object and its delegate.
|
void |
_release()
Releases the resources associated with this
ObjectImpl object.
|
void |
_releaseReply(InputStream
Releases the given reply stream back to the ORB when unmarshalling has completed after a call to the method
_invoke.
|
Request |
_request(String
Creates a
Request object containing the given method that can be used with the Dynamic Invocation Interface.
|
OutputStream |
_request(String
Returns an
OutputStream object to use for marshalling the arguments of the given method.
|
void |
_servant_postinvoke(ServantObject
Is called by the local stub after it has invoked an operation on the local servant that was previously retrieved from a call to the method
_servant_preinvoke.
|
ServantObject |
_servant_preinvoke(String
Returns a Java reference to the local servant that should be used for sending a request for the method specified.
|
void |
_set_delegate(Delegate
Sets the Delegate for this
ObjectImpl instance to the given
Delegate object.
|
Object |
_set_policy_override(Policy
Sets this
ObjectImpl object's override type for the given policies to the given instance of
SetOverrideType.
|
boolean |
equals(Object
Compares this
ObjectImpl object with the given one for equality.
|
int |
hashCode()
Returns the hash code for this
ObjectImpl object.
|
String |
toString()
Returns a
String object that represents this
ObjectImpl object.
|
public Delegate_get_delegate()
Delegate object to which this
ObjectImpl object delegates all methods invoked on it.
BAD_OPERATION - if the delegate has not been set
_set_delegate(org.omg.CORBA.portable.Delegate)
public void _set_delegate(Delegatedelegate)
ObjectImpl instance to the given
Delegate object. All method invocations on this
ObjectImpl object will be forwarded to this delegate.
delegate - the
Delegate instance to which all method calls on this
ObjectImpl object will be delegated; may be implemented by a third-party ORB
_get_delegate()
public abstract String[] _ids()
ObjectImpl object. For example, for a stub, this method returns information about all the interfaces supported by the stub.
ObjectImpl instance
public Object_duplicate()
ObjectImpl object.
_duplicate in interface
Object
orb.omg.CORBA.Object object that is a duplicate of this object
public void _release()
ObjectImpl object.
public boolean _is_a(Stringrepository_id)
ObjectImpl object.
public boolean _is_equivalent(Objectthat)
ObjectImpl object is equivalent to this
ObjectImpl object.
_is_equivalent in interface
Object
that - an instance of
ObjectImpl to compare with this
ObjectImpl object
true if the given object is equivalent to this
ObjectImpl object;
false otherwise
public boolean _non_existent()
ObjectImpl object has been destroyed.
_non_existent in interface
Object
true if the ORB knows authoritatively that the server object does not exist;
false otherwise
public int _hash(int maximum)
ObjectImpl object.
public Request_request(String operation)
Request object containing the given method that can be used with the Dynamic Invocation Interface.
public Request_create_request(Context ctx, String operation, NVList arg_list, NamedValue result)
Request object that contains the given context, method, argument list, and container for the result.
_create_request in interface
Object
ctx - the Context for the request
operation - the method that the new
Request object will invoke
arg_list - the arguments for the method; an
NVList in which each argument is a
NamedValue object
result - a
NamedValue object to be used for returning the result of executing the request's method
Request object initialized with the given context, method, argument list, and container for the return value
Request,
NVList,
NamedValue
public Request_create_request(Context ctx, String operation, NVList arg_list, NamedValue result, ExceptionList exceptions, ContextList contexts)
Request object that contains the given context, method, argument list, container for the result, exceptions, and list of property names to be used in resolving the context strings. This
Request object is for use in the Dynamic Invocation Interface.
_create_request in interface
Object
ctx - the
Context object that contains the context strings that must be resolved before they are sent along with the request
operation - the method that the new
Request object will invoke
arg_list - the arguments for the method; an
NVList in which each argument is a
NamedValue object
result - a
NamedValue object to be used for returning the result of executing the request's method
exceptions - a list of the exceptions that the given method throws
contexts - a list of the properties that are needed to resolve the contexts in
ctx; the strings in
contexts are used as arguments to the method
Context.get_values, which returns the value associated with the given property
Request object initialized with the given context strings to resolve, method, argument list, container for the result, exceptions, and list of property names to be used in resolving the context strings
Request,
NVList,
NamedValue,
ExceptionList,
ContextList
public Object_get_interface_def()
ObjectImpl object.
_get_interface_def in interface
Object
org.omg.CORBA.Object instance that is the interface definition for this
ObjectImpl object
public ORB_orb()
ORB object that created the delegate.
ORB instance that created the
Delegate object contained in this
ObjectImpl object
public Policy_get_policy(int policy_type)
Policy object for this
ObjectImpl object that has the given policy type.
_get_policy in interface
Object
policy_type - an int indicating the policy type
Policy object that is the specified policy type and that applies to this
ObjectImpl object
PolicyOperations.policy_type()
public DomainManager[] _get_domain_managers()
ObjectImpl object.
_get_domain_managers in interface
Object
DomainManager objects for this instance of
ObjectImpl
public Object_set_policy_override(Policy [] policies, SetOverrideType set_add)
ObjectImpl object's override type for the given policies to the given instance of
SetOverrideType.
_set_policy_override in interface
Object
policies - an array of
Policy objects with the policies that will replace the current policies or be added to the current policies
set_add - either
SetOverrideType.SET_OVERRIDE, indicating that the given policies will replace any existing ones, or
SetOverrideType.ADD_OVERRIDE, indicating that the given policies should be added to any existing ones
Object with the given policies replacing or added to its previous policies
public boolean _is_local()
ObjectImpl object is implemented by a local servant. If so, local invocation API's may be used.
true if this object is implemented by a local servant;
false otherwise
public ServantObject_servant_preinvoke(String operation, Class expectedType)
ObjectImpl object is a local stub, it will invoke the
_servant_preinvoke method before sending a request in order to obtain the
ServantObject instance to use.
If a ServantObject object is returned, 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.
operation - a
String containing the name of the method to be invoked. This name should correspond to the method name as it would be encoded in a GIOP request.
expectedType - a
Class object representing the expected type of the servant that is returned. This expected type is the
Class object associated with the operations class for the stub's interface. For example, a stub for an interface
Foo would pass the
Class object for the
FooOperations interface.
ServantObject object, which may or may not be the actual servant instance, or (2)
null if (a) the servant is not local or (b) the servant has ceased to be local due to a ForwardRequest from a POA ServantManager
BAD_PARAM - if the servant is not the expected type
public void _servant_postinvoke(ServantObjectservant)
_servant_preinvoke. The
_servant_postinvoke method must be called if the
_servant_preinvoke method returned a non-null value, even if an exception was thrown by the method invoked by the servant. For this reason, the call to the method
_servant_postinvoke should be placed in a Java
finally clause.
servant - the instance of the
ServantObject returned by the
_servant_preinvoke method
public OutputStream_request(String operation, boolean responseExpected)
OutputStream object to use for marshalling the arguments of the given method. This method is called by a stub, which must indicate if a response is expected, that is, whether or not the call is oneway.
operation - a String giving the name of the method.
responseExpected - a boolean --
true if the request is not one way, that is, a response is expected
OutputStream object for dispatching the request
public InputStream_invoke(OutputStream output) throws ApplicationException , RemarshalException
InputStream object for reading the response. The stub provides the
OutputStream object that was previously returned by a call to the
_request method. The method specified as an argument to
_request when it was called previously is the method that this method invokes.
If an exception occurs, the _invoke method may throw an ApplicationException object that contains an InputStream from which the user exception state may be unmarshalled.
output - an OutputStream object for dispatching the request
InputStream object containing the marshalled response to the method invoked
ApplicationException - if the invocation meets application-defined exception
RemarshalException - if the invocation leads to a remarshalling error
_request(java.lang.String)
public void _releaseReply(InputStreaminput)
_invoke. Calling this method is optional for the stub.
input - the
InputStream object that was returned by the
_invoke method or the
ApplicationException.getInputStream method; may be
null, in which case this method does nothing
_invoke(org.omg.CORBA.portable.OutputStream)
public StringtoString()
String object that represents this
ObjectImpl object.
public int hashCode()
ObjectImpl object.
hashCode in class
Object
Object.equals(java.lang.Object) ,
System.identityHashCode(java.lang.Object)
public boolean equals(Objectobj)
ObjectImpl object with the given one for equality.
equals in class
Object
obj - the object with which to compare this object
true if the two objects are equal;
false otherwise
Object.hashCode() ,
HashMap