org.omg.CORBA.portable

Class ObjectImpl

public abstract class ObjectImpl extends Object implements Object

The basic implementation of the CORBA Object. The most of the methods delegate the functionality to the {@link Delegate} that can be replaced by {@link #_set_delegate(Delegate)}.
Method Summary
booleanequals(Object other)
Check if this object is equal to another object.
StringtoString()
Return the string representation of the passed object.
Request_create_request(Context context, String operation, NVList parameters, NamedValue returns, ExceptionList exceptions, ContextList ctx_list)
Create a request to invoke the method of this object, specifying context list and the list of the expected exception.
Request_create_request(Context context, String operation, NVList parameters, NamedValue returns)
Create a request to invoke the method of this object.
Object_duplicate()
Duplicate the object reference.
Delegate_get_delegate()
Get vendor specific delegate, responsible for the implemented functionality.
DomainManager[]_get_domain_managers()
Retrieve the domain managers for this object.
Object_get_interface_def()
Get the InterfaceDef for this Object.
Policy_get_policy(int a_policy_type)
Returns the {@link Policy}, applying to this object.
int_hash(int max)
Get the hashcode this object reference.
abstract String[]_ids()
Get the array of interface repository ids, defining this object.
InputStream_invoke(OutputStream output)
Invoke the operation.
boolean_is_a(String idl_id)
Check if this object can be referenced by the given repository id.
boolean_is_equivalent(Object other)
Return true if the other object references are equivalent, so far as it is possible to determine this easily.
boolean_is_local()
Returns true if the object is local.
boolean_non_existent()
Determines if the server object for this reference has already been destroyed.
ORB_orb()
Provides the reference to ORB.
void_release()
Free resoureces, occupied by this reference.
void_releaseReply(InputStream stream)
Release the reply stream back to ORB after finishing reading the data from it.
Request_request(String method)
Create a request to invoke the method of this CORBA object.
OutputStream_request(String method, boolean response_expected)
Create a request to invoke the method of this CORBA object.
void_servant_postinvoke(ServantObject servant)
This method is always called after invoking the operation on the local servant.
ServantObject_servant_preinvoke(String method, Class expected_type)
Returns a servant that should be used for this request.
void_set_delegate(Delegate a_delegate)
Set the delegate, responsible for the implemented functionality.
Object_set_policy_override(Policy[] policies, SetOverrideType how)
Returns a new object with the new policies either replacing or extending the current policies, depending on the second parameter.

Method Detail

equals

public boolean equals(Object other)
Check if this object is equal to another object.

Parameters: other the other object to compare.

Returns: true if the objects are equal.

toString

public String toString()
Return the string representation of the passed object.

Returns: the string representation.

_create_request

public Request _create_request(Context context, String operation, NVList parameters, NamedValue returns, ExceptionList exceptions, ContextList ctx_list)
Create a request to invoke the method of this object, specifying context list and the list of the expected exception.

Parameters: context a list of additional properties. operation the name of method to be invoked. parameters the method parameters. returns the container for tge method returned value. exceptions the list of the possible exceptions that the method can throw. ctx_list the list of the context strings that need to be resolved and send as a context instance.

Returns: the created reaquest.

_create_request

public Request _create_request(Context context, String operation, NVList parameters, NamedValue returns)
Create a request to invoke the method of this object.

Parameters: context a list of additional properties. operation the name of method to be invoked. parameters the method parameters. returns the container for tge method returned value.

Returns: the created reaquest.

_duplicate

public Object _duplicate()
Duplicate the object reference. This does not make much sense for java platform and is just included for the sake of compliance with CORBA APIs. The method may return the object reference itself.

Returns: as a rule, this.

_get_delegate

public Delegate _get_delegate()
Get vendor specific delegate, responsible for the implemented functionality.

_get_domain_managers

public DomainManager[] _get_domain_managers()
Retrieve the domain managers for this object.

Returns: the domain managers.

_get_interface_def

public Object _get_interface_def()
Get the InterfaceDef for this Object.

_get_policy

public Policy _get_policy(int a_policy_type)
Returns the {@link Policy}, applying to this object.

Parameters: a_policy_type a type of policy to be obtained.

Returns: a corresponding Policy object.

Throws: BAD_PARAM if the policy of the given type is not associated with this object, or if it is not supported by this ORB.

_hash

public int _hash(int max)
Get the hashcode this object reference. The same hashcode still does not means that the references are the same. From the other side, two different references may still refer to the same CORBA object. The returned value must not change during the object lifetime.

Parameters: max the maximal value to return.

Returns: the hashcode.

_ids

public abstract String[] _ids()
Get the array of interface repository ids, defining this object.

_invoke

public InputStream _invoke(OutputStream output)
Invoke the operation.

Parameters: output the stream, containing the written arguments.

Returns: the stream, from where the input parameters could be read.

Throws: ApplicationException if the application throws an exception, defined as a part of its remote method definition. RemarshalException if reading(remarshalling) fails.

_is_a

public boolean _is_a(String idl_id)
Check if this object can be referenced by the given repository id.

Parameters: idl_id the repository id.

Returns: true if the passed parameter is a repository id of this CORBA object.

_is_equivalent

public boolean _is_equivalent(Object other)
Return true if the other object references are equivalent, so far as it is possible to determine this easily.

Parameters: other the other object reference.

Returns: true if both references refer the same object, false if they probably can refer different objects. Uses direct comparison if the delegate has not been set.

_is_local

public boolean _is_local()
Returns true if the object is local.

Returns: false, always (following 1.4 specs). Override to get functionality.

_non_existent

public boolean _non_existent()
Determines if the server object for this reference has already been destroyed.

Returns: true if the object has been destroyed, false otherwise.

_orb

public ORB _orb()
Provides the reference to ORB.

Returns: the associated ORB.

_release

public void _release()
Free resoureces, occupied by this reference. The object implementation is not notified, and the other references to the same object are not affected.

_releaseReply

public void _releaseReply(InputStream stream)
Release the reply stream back to ORB after finishing reading the data from it.

Parameters: stream the stream, normally returned by {@link #_invoke} or {@link ApplicationException#getInputStream()}, can be null.

_request

public Request _request(String method)
Create a request to invoke the method of this CORBA object.

Parameters: method the name of the method to invoke.

Returns: the request.

_request

public OutputStream _request(String method, boolean response_expected)
Create a request to invoke the method of this CORBA object.

Parameters: method the name of the method to invoke. response_expected specifies if this is one way message or the response to the message is expected.

Returns: the stream where the method arguments should be written.

_servant_postinvoke

public void _servant_postinvoke(ServantObject servant)
This method is always called after invoking the operation on the local servant. The default method returns without action.

Parameters: servant the servant.

_servant_preinvoke

public ServantObject _servant_preinvoke(String method, Class expected_type)
Returns a servant that should be used for this request. The servant can also be casted to the expected type, calling the required method directly.

Parameters: method the operation expected_type the expected type of the servant. This implementation always returns null; override for different behavior.

Returns: the servant or null if the servant is not an expected type of the method is not supported, for example, due security reasons.

_set_delegate

public void _set_delegate(Delegate a_delegate)
Set the delegate, responsible for the implemented functionality.

Parameters: a_delegate a delegate, responsible for the implemented functionality.

_set_policy_override

public Object _set_policy_override(Policy[] policies, SetOverrideType how)
Returns a new object with the new policies either replacing or extending the current policies, depending on the second parameter.

Parameters: policies the policy additions or replacements. how either {@link SetOverrideType#SET_OVERRIDE} to override the current policies of {@link SetOverrideType#ADD_OVERRIDE} to replace them.