JavaTM 2 Platform
Std. Ed. v1.3

org.omg.CORBA.portable
Class ObjectImpl

java.lang.Object
  |
  +--org.omg.CORBA.portable.ObjectImpl
All Implemented Interfaces:
Object
Direct Known Subclasses:
_BindingIteratorStub, _IDLTypeStub, _NamingContextStub, _PolicyStub, DynamicImplementation, ObjectImpl

public abstract class ObjectImpl
extends Object
implements Object

The ObjectImpl class 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 is the common base class for all stub classes. ObjectImpl allows for portable stubs because the Delegate can be implemented by a different vendor-specific ORB.


Constructor Summary
ObjectImpl()
           
 
Method Summary
 Request _create_request(Context ctx, String operation, NVList arg_list, NamedValue result)
          default implementation of the org.omg.CORBA.Object method.
 Request _create_request(Context ctx, String operation, NVList arg_list, NamedValue result, ExceptionList exceptions, ContextList contexts)
          default implementation of the org.omg.CORBA.Object method.
 Object _duplicate()
          default implementation of the org.omg.CORBA.Object method.
 Delegate _get_delegate()
          Provides a reference to the vendor-specific Delegate for this ObjectImpl.
 DomainManager[] _get_domain_managers()
          Retrieves the DomainManagers of this object.
 Object _get_interface_def()
          default implementation of the org.omg.CORBA.Object method.
 Policy _get_policy(int policy_type)
          Returns the Policy object of the specified type which applies to this object.
 int _hash(int maximum)
          default implementation of the org.omg.CORBA.Object method.
abstract  String[] _ids()
          Provides a string array containing the repository ids for this object.
 InputStream _invoke(OutputStream output)
          _invoke is called to invoke an operation.
 boolean _is_a(String repository_id)
          default implementation of the org.omg.CORBA.Object method.
 boolean _is_equivalent(Object that)
          default implementation of the org.omg.CORBA.Object method.
 boolean _is_local()
          Checks whether this object is process-local.
 boolean _non_existent()
          default implementation of the org.omg.CORBA.Object method.
 ORB _orb()
          Provides reference to the ORB associated with this object and its delegate.
 void _release()
          default implementation of the org.omg.CORBA.Object method.
 void _releaseReply(InputStream input)
          _releaseReply may optionally be called by a stub to release a reply stream back to the ORB when the unmarshaling has completed.
 Request _request(String operation)
          default implementation of the org.omg.CORBA.Object method.
 OutputStream _request(String operation, boolean responseExpected)
          _request is called by a stub to obtain an OutputStream for marshaling arguments.
 void _servant_postinvoke(ServantObject servant)
          Is invoked by the local stub after the operation has been invoked on the local servant.
 ServantObject _servant_preinvoke(String operation, Class expectedType)
          Returns a Java reference to the servant which should be used for this request.
 void _set_delegate(Delegate delegate)
          Sets the Delegate contained in this ObjectImpl instance.
 Object _set_policy_override(Policy[] policies, SetOverrideType set_add)
          Returns a new Object with the given policies either replacing any existing policies in this Object or with the given policies added to the existing ones, depending on the value of the given SetOverrideType object.
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 int hashCode()
          Returns a hash code value for the object.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectImpl

public ObjectImpl()
Method Detail

_get_delegate

public Delegate _get_delegate()
Provides a reference to the vendor-specific Delegate for this ObjectImpl.
Returns:
the Delegate contained in this ObjectImpl instance.

_set_delegate

public void _set_delegate(Delegate delegate)
Sets the Delegate contained in this ObjectImpl instance.

_ids

public abstract String[] _ids()
Provides a string array containing the repository ids for this object.
Returns:
the array of all repository identifiers supported by this ObjectImpl instance (e.g. For a stub, _ids() will return information about all interfaces supported by the stub).

_duplicate

public Object _duplicate()
default implementation of the org.omg.CORBA.Object method.
Specified by:
_duplicate in interface Object
Following copied from interface: org.omg.CORBA.Object
Returns:
a duplicate of this object reference or this object reference itself

_release

public void _release()
default implementation of the org.omg.CORBA.Object method.
Specified by:
_release in interface Object

_is_a

public boolean _is_a(String repository_id)
default implementation of the org.omg.CORBA.Object method.
Specified by:
_is_a in interface Object
Following copied from interface: org.omg.CORBA.Object
Parameters:
repositoryIdentifier - the interface to check against
Returns:
true if this object reference is an instance of a class that implements the interface; false otherwise

_is_equivalent

public boolean _is_equivalent(Object that)
default implementation of the org.omg.CORBA.Object method.
Specified by:
_is_equivalent in interface Object
Following copied from interface: org.omg.CORBA.Object
Parameters:
other - the other object reference with which to check for equivalence
Returns:
true if this object reference is known to be equivalent to the given object reference. Note that false indicates only that the two object references are distinct, not necessarily that they reference distinct objects.

_non_existent

public boolean _non_existent()
default implementation of the org.omg.CORBA.Object method.
Specified by:
_non_existent in interface Object
Following copied from interface: org.omg.CORBA.Object
Returns:
true if the ORB knows authoritatively that the server object does not exist; false otherwise

_hash

public int _hash(int maximum)
default implementation of the org.omg.CORBA.Object method.
Specified by:
_hash in interface Object
Following copied from interface: org.omg.CORBA.Object
Parameters:
maximum - the upper bound on the hash value returned by the ORB
Returns:
the ORB-internal hash identifier for this object reference

_request

public Request _request(String operation)
default implementation of the org.omg.CORBA.Object method.
Specified by:
_request in interface Object
Following copied from interface: org.omg.CORBA.Object
Parameters:
operation - the name of the method to be invoked using the Request instance
Returns:
the newly-created Request instance

_create_request

public Request _create_request(Context ctx,
                               String operation,
                               NVList arg_list,
                               NamedValue result)
default implementation of the org.omg.CORBA.Object method.
Specified by:
_create_request in interface Object
Following copied from interface: org.omg.CORBA.Object
Parameters:
ctx - a Context object containing a list of properties
operation - the name of the method to be invoked
arg_list - an NVList containing the actual arguments to the method being invoked
result - a NamedValue object to serve as a container for the method's return value
Returns:
the newly-created Request object
See Also:
Request, NVList, NamedValue

_create_request

public Request _create_request(Context ctx,
                               String operation,
                               NVList arg_list,
                               NamedValue result,
                               ExceptionList exceptions,
                               ContextList contexts)
default implementation of the org.omg.CORBA.Object method.
Specified by:
_create_request in interface Object
Following copied from interface: org.omg.CORBA.Object
Parameters:
ctx - a Context object containing a list of properties
operation - the name of the method to be invoked
arg_list - an NVList containing the actual arguments to the method being invoked
result - a NamedValue object to serve as a container for the method's return value
exclist - an ExceptionList object containing a list of possible exceptions the method can throw
ctxlist - a ContextList object containing a list of context strings that need to be resolved and sent with the Request instance
Returns:
the newly-created Request object
See Also:
Request, NVList, NamedValue, ExceptionList, ContextList

_get_interface_def

public Object _get_interface_def()
default implementation of the org.omg.CORBA.Object method.
Specified by:
_get_interface_def in interface Object
Following copied from interface: org.omg.CORBA.Object
Returns:
the InterfaceDef object in the Interface Repository which provides type information about the object referred to by this object reference

_orb

public ORB _orb()
Provides reference to the ORB associated with this object and its delegate.
Returns:
the ORB instance which created the Delegate contained in this ObjectImpl.

_get_policy

public Policy _get_policy(int policy_type)
Description copied from interface: Object
Returns the Policy object of the specified type which applies to this object.
Specified by:
_get_policy in interface Object
Following copied from interface: org.omg.CORBA.Object
Parameters:
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 - 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

_get_domain_managers

public DomainManager[] _get_domain_managers()
Description copied from interface: Object
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.
Specified by:
_get_domain_managers in interface Object
Following copied from interface: org.omg.CORBA.Object
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.

_set_policy_override

public Object _set_policy_override(Policy[] policies,
                                   SetOverrideType set_add)
Description copied from interface: Object
Returns a new Object with the given policies either replacing any existing policies in this Object or with the given policies added to the existing ones, depending on the value of the given SetOverrideType object.
Specified by:
_set_policy_override in interface Object
Following copied from interface: org.omg.CORBA.Object
Parameters:
policies - an array of Policy objects containing the policies to be added or to be used as replacements
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
Returns:
a new Object with the given policies replacing or added to those in this Object

_is_local

public boolean _is_local()
Checks whether this object is process-local.
Returns:
true if this object is process-local.

_servant_preinvoke

public ServantObject _servant_preinvoke(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:
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(ServantObject servant)
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:
servant - the instance of the ServantObject returned from the servant_preinvoke() method.

_request

public OutputStream _request(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:
operation - a String giving the name of the object.
responseExpected - a boolean -- true if request is not one way.
Returns:
an OutputStream object for dispatching the request.

_invoke

public InputStream _invoke(OutputStream output)
                    throws ApplicationException,
                           RemarshalException
_invoke is called 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:
output - an OutputStream object for dispatching the request.
Returns:
an InputStream object for reading the response.
Throws:
ApplicationException - an exception -- thrown if the invocation meets application-defined exception.
RemarshalException - an exception -- thrown if the invocation leads to a remarshalling error.

_releaseReply

public void _releaseReply(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:
input - an InputStream object that represents handle to the reply.

toString

public String toString()
Description copied from class: Object
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 
Overrides:
toString in class Object
Following copied from class: java.lang.Object
Returns:
a string representation of the object.

hashCode

public int hashCode()
Description copied from class: Object
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

The general contract of hashCode is:

As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

Overrides:
hashCode in class Object
Following copied from class: java.lang.Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object), Hashtable

equals

public boolean equals(Object obj)
Description copied from class: Object
Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation:

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any reference values x and y, this method returns true if and only if x and y refer to the same object (x==y has the value true).

Overrides:
equals in class Object
Following copied from class: java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Boolean.hashCode(), Hashtable

JavaTM 2 Platform
Std. Ed. v1.3

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.