Package org.omg.CORBA.portable
Class ObjectImpl
java.lang.Object
org.omg.CORBA.portable.ObjectImpl
- All Implemented Interfaces:
Object
- Direct Known Subclasses:
_AbstractInterfaceDefStub,_ActivatorStub,_AliasDefStub,_ArrayDefStub,_AttributeDefStub,_BindingIteratorStub,_CodeBaseImplBase,_CodeBaseStub,_ComponentDefStub,_ConstantDefStub,_ConsumesDefStub,_ContainedStub,_ContainerStub,_ContainerStub,_DynAnyFactoryStub,_DynAnyStub,_DynArrayStub,_DynEnumStub,_DynFixedStub,_DynSequenceStub,_DynStructStub,_DynUnionStub,_DynValueBoxStub,_DynValueCommonStub,_DynValueStub,_EmitsDefStub,_EnumDefStub,_EventDefStub,_EventPortDefStub,_ExceptionDefStub,_ExtAbstractInterfaceDefStub,_ExtAttributeDefStub,_ExtInterfaceDefStub,_ExtLocalInterfaceDefStub,_ExtValueDefStub,_FactoryDefStub,_FinderDefStub,_FixedDefStub,_HomeDefStub,_IDLTypeStub,_IDLTypeStub,_InitialNameServiceStub,_InterfaceAttrExtensionStub,_InterfaceDefStub,_IRObjectStub,_LocalInterfaceDefStub,_LocatorStub,_ModuleDefStub,_ModuleDefStub,_NamingContextExtStub,_NamingContextStub,_NativeDefStub,_OperationDefStub,_PolicyStub,_PrimitiveDefStub,_ProvidesDefStub,_PublishesDefStub,_RepositoryImplBase,_RepositoryStub,_RepositoryStub,_RepositoryStub,_SequenceDefStub,_ServantActivatorStub,_ServantLocatorStub,_ServerImplBase,_ServerManagerImplBase,_ServerManagerStub,_ServerStub,_StringDefStub,_StructDefStub,_TypedefDefStub,_UnionDefStub,_UsesDefStub,_ValueBoxDefStub,_ValueDefStub,_ValueMemberDefStub,_WstringDefStub,DynamicImplementation,ObjectImpl,POACurrent
The common base class for all stub classes; provides default implementations
of the
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_create_request(Context ctx, String operation, NVList arg_list, NamedValue result) Creates aRequestobject that contains the given context, method, argument list, and container for the result._create_request(Context ctx, String operation, NVList arg_list, NamedValue result, ExceptionList exceptions, ContextList contexts) Creates aRequestobject 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.Returns a duplicate of thisObjectImplobject.Retrieves the reference to the vendor-specificDelegateobject to which thisObjectImplobject delegates all methods invoked on it.Retrieves a list of the domain managers for thisObjectImplobject.Retrieves the interface definition for thisObjectImplobject._get_policy(int policy_type) Retrieves thePolicyobject for thisObjectImplobject that has the given policy type.int_hash(int maximum) Retrieves the hash code that serves as an ORB-internal identifier for thisObjectImplobject.abstract String[]_ids()Retrieves a string array containing the repository identifiers supported by thisObjectImplobject._invoke(OutputStream output) Invokes an operation and returns anInputStreamobject for reading the response.booleanChecks whether the object identified by the given repository identifier is anObjectImplobject.boolean_is_equivalent(Object that) Checks whether the the givenObjectImplobject is equivalent to thisObjectImplobject.booleanChecks whether thisObjectImplobject is implemented by a local servant.booleanChecks whether the server object for thisObjectImplobject has been destroyed._orb()Returns a reference to the ORB associated with this object and its delegate.void_release()Releases the resources associated with thisObjectImplobject.void_releaseReply(InputStream input) Releases the given reply stream back to the ORB when unmarshalling has completed after a call to the method_invoke.Creates aRequestobject containing the given method that can be used with the Dynamic Invocation Interface.Returns anOutputStreamobject to use for marshalling the arguments of the given method.void_servant_postinvoke(ServantObject servant) 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._servant_preinvoke(String operation, Class expectedType) Returns a Java reference to the local servant that should be used for sending a request for the method specified.void_set_delegate(Delegate delegate) Sets the Delegate for thisObjectImplinstance to the givenDelegateobject._set_policy_override(Policy[] policies, SetOverrideType set_add) Sets thisObjectImplobject's override type for the given policies to the given instance ofSetOverrideType.booleanCompares thisObjectImplobject with the given one for equality.inthashCode()Returns the hash code for thisObjectImplobject.toString()Returns aStringobject that represents thisObjectImplobject.
-
Constructor Details
-
ObjectImpl
public ObjectImpl()
-
-
Method Details
-
_get_delegate
Retrieves the reference to the vendor-specificDelegateobject to which thisObjectImplobject delegates all methods invoked on it.- Returns:
- the Delegate contained in this ObjectImpl instance
- Throws:
BAD_OPERATION- if the delegate has not been set- See Also:
-
_set_delegate
Sets the Delegate for thisObjectImplinstance to the givenDelegateobject. All method invocations on thisObjectImplobject will be forwarded to this delegate.- Parameters:
delegate- theDelegateinstance to which all method calls on thisObjectImplobject will be delegated; may be implemented by a third-party ORB- See Also:
-
_ids
Retrieves a string array containing the repository identifiers supported by thisObjectImplobject. For example, for a stub, this method returns information about all the interfaces supported by the stub.- Returns:
- the array of all repository identifiers supported by this
ObjectImplinstance
-
_duplicate
Returns a duplicate of thisObjectImplobject.- Specified by:
_duplicatein interfaceObject- Returns:
- an
orb.omg.CORBA.Objectobject that is a duplicate of this object
-
_release
public void _release()Releases the resources associated with thisObjectImplobject. -
_is_a
Checks whether the object identified by the given repository identifier is anObjectImplobject. -
_is_equivalent
Checks whether the the givenObjectImplobject is equivalent to thisObjectImplobject.- Specified by:
_is_equivalentin interfaceObject- Parameters:
that- an instance ofObjectImplto compare with thisObjectImplobject- Returns:
trueif the given object is equivalent to thisObjectImplobject;falseotherwise
-
_non_existent
public boolean _non_existent()Checks whether the server object for thisObjectImplobject has been destroyed.- Specified by:
_non_existentin interfaceObject- Returns:
trueif the ORB knows authoritatively that the server object does not exist;falseotherwise
-
_hash
public int _hash(int maximum) Retrieves the hash code that serves as an ORB-internal identifier for thisObjectImplobject. -
_request
Creates aRequestobject containing the given method that can be used with the Dynamic Invocation Interface. -
_create_request
Creates aRequestobject that contains the given context, method, argument list, and container for the result.- Specified by:
_create_requestin interfaceObject- Parameters:
ctx- the Context for the requestoperation- the method that the newRequestobject will invokearg_list- the arguments for the method; anNVListin which each argument is aNamedValueobjectresult- aNamedValueobject to be used for returning the result of executing the request's method- Returns:
- a new
Requestobject initialized with the given context, method, argument list, and container for the return value - See Also:
-
_create_request
public Request _create_request(Context ctx, String operation, NVList arg_list, NamedValue result, ExceptionList exceptions, ContextList contexts) Creates aRequestobject 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. ThisRequestobject is for use in the Dynamic Invocation Interface.- Specified by:
_create_requestin interfaceObject- Parameters:
ctx- theContextobject that contains the context strings that must be resolved before they are sent along with the requestoperation- the method that the newRequestobject will invokearg_list- the arguments for the method; anNVListin which each argument is aNamedValueobjectresult- aNamedValueobject to be used for returning the result of executing the request's methodexceptions- a list of the exceptions that the given method throwscontexts- a list of the properties that are needed to resolve the contexts in ctx; the strings in contexts are used as arguments to the methodContext.get_values, which returns the value associated with the given property- Returns:
- a new
Requestobject 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 - See Also:
-
_get_interface_def
Retrieves the interface definition for thisObjectImplobject.- Specified by:
_get_interface_defin interfaceObject- Returns:
- the
org.omg.CORBA.Objectinstance that is the interface definition for thisObjectImplobject
-
_orb
Returns a reference to the ORB associated with this object and its delegate. This is theORBobject that created the delegate.- Returns:
- the
ORBinstance that created theDelegateobject contained in thisObjectImplobject
-
_get_policy
Retrieves thePolicyobject for thisObjectImplobject that has the given policy type.- Specified by:
_get_policyin interfaceObject- Parameters:
policy_type- an int indicating the policy type- Returns:
- the
Policyobject that is the specified policy type and that applies to thisObjectImplobject - See Also:
-
_get_domain_managers
Retrieves a list of the domain managers for thisObjectImplobject.- Specified by:
_get_domain_managersin interfaceObject- Returns:
- an array containing the
DomainManagerobjects for this instance ofObjectImpl
-
_set_policy_override
Sets thisObjectImplobject's override type for the given policies to the given instance ofSetOverrideType.- Specified by:
_set_policy_overridein interfaceObject- Parameters:
policies- an array ofPolicyobjects with the policies that will replace the current policies or be added to the current policiesset_add- eitherSetOverrideType.SET_OVERRIDE, indicating that the given policies will replace any existing ones, orSetOverrideType.ADD_OVERRIDE, indicating that the given policies should be added to any existing ones- Returns:
- an
Objectwith the given policies replacing or added to its previous policies
-
_is_local
public boolean _is_local()Checks whether thisObjectImplobject is implemented by a local servant. If so, local invocation API's may be used.- Returns:
trueif this object is implemented by a local servant;falseotherwise
-
_servant_preinvoke
Returns a Java reference to the local servant that should be used for sending a request for the method specified. If thisObjectImplobject is a local stub, it will invoke the_servant_preinvokemethod before sending a request in order to obtain theServantObjectinstance to use.If a
ServantObjectobject is returned, itsservantfield 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. TheServantRequestobject is valid for only one invocation and cannot be used for more than one invocation.- Parameters:
operation- aStringcontaining 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- aClassobject representing the expected type of the servant that is returned. This expected type is theClassobject associated with the operations class for the stub's interface. For example, a stub for an interfaceFoowould pass theClassobject for theFooOperationsinterface.- Returns:
- (1) a
ServantObjectobject, which may or may not be the actual servant instance, or (2)nullif (a) the servant is not local or (b) the servant has ceased to be local due to a ForwardRequest from a POA ServantManager - Throws:
BAD_PARAM- if the servant is not the expected type
-
_servant_postinvoke
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. The_servant_postinvokemethod must be called if the_servant_preinvokemethod 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_postinvokeshould be placed in a Javafinallyclause.- Parameters:
servant- the instance of theServantObjectreturned by the_servant_preinvokemethod
-
_request
Returns anOutputStreamobject 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.- Parameters:
operation- a String giving the name of the method.responseExpected- a boolean --trueif the request is not one way, that is, a response is expected- Returns:
- an
OutputStreamobject for dispatching the request
-
_invoke
Invokes an operation and returns anInputStreamobject for reading the response. The stub provides theOutputStreamobject that was previously returned by a call to the_requestmethod. The method specified as an argument to_requestwhen it was called previously is the method that this method invokes.If an exception occurs, the
_invokemethod may throw anApplicationExceptionobject that contains an InputStream from which the user exception state may be unmarshalled.- Parameters:
output- an OutputStream object for dispatching the request- Returns:
- an
InputStreamobject containing the marshalled response to the method invoked - Throws:
ApplicationException- if the invocation meets application-defined exceptionRemarshalException- if the invocation leads to a remarshalling error- See Also:
-
_releaseReply
Releases the given reply stream back to the ORB when unmarshalling has completed after a call to the method_invoke. Calling this method is optional for the stub.- Parameters:
input- theInputStreamobject that was returned by the_invokemethod or theApplicationException.getInputStreammethod; may benull, in which case this method does nothing- See Also:
-
toString
Returns aStringobject that represents thisObjectImplobject. -
hashCode
public int hashCode()Returns the hash code for thisObjectImplobject. -
equals
Compares thisObjectImplobject with the given one for equality.
-