Class StubWrapper
- java.lang.Object
-
- com.sun.corba.ee.spi.presentation.rmi.StubWrapper
-
- All Implemented Interfaces:
DynamicStub
,Object
public class StubWrapper extends java.lang.Object implements DynamicStub
Wrapper that can take any stub (object x such that StubAdapter.isStub(x)) and treat it as a DynamicStub.
-
-
Constructor Summary
Constructors Constructor Description StubWrapper(Object object)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Request
_create_request(Context ctx, java.lang.String operation, NVList arg_list, NamedValue result)
Creates aRequest
instance initialized with the given context, method name, list of arguments, and container for the method's return value.Request
_create_request(Context ctx, java.lang.String operation, NVList arg_list, NamedValue result, ExceptionList exclist, ContextList ctxlist)
Creates aRequest
instance initialized with the given context, method name, list of arguments, container for the method's return value, list of possible exceptions, and list of context strings needing to be resolved.Object
_duplicate()
Returns a duplicate of this CORBA object reference.DomainManager[]
_get_domain_managers()
Retrieves theDomainManagers
of this object.Object
_get_interface_def()
Obtains anInterfaceDef
for the object implementation referenced by this object reference.Policy
_get_policy(int policy_type)
Returns thePolicy
object of the specified type which applies to this object.int
_hash(int maximum)
Returns an ORB-internal identifier for this object reference.boolean
_is_a(java.lang.String repositoryIdentifier)
Checks whether this object is an instance of a class that implements the given interface.boolean
_is_equivalent(Object other)
Determines whether the two object references are equivalent, so far as the ORB can easily determine.boolean
_non_existent()
Determines whether the server object for this object reference has been destroyed.void
_release()
Signals that the caller is done using this object reference, so internal ORB resources associated with this object reference can be released.Request
_request(java.lang.String operation)
Creates aRequest
instance for use in the Dynamic Invocation Interface.Object
_set_policy_override(Policy[] policies, SetOverrideType set_add)
Returns a newObject
with the given policies either replacing any existing policies in thisObject
or with the given policies added to the existing ones, depending on the value of the givenSetOverrideType
object.void
connect(ORB orb)
Connect this dynamic stub to an ORB.Delegate
getDelegate()
Similar to ObjectImpl._get_delegateORB
getORB()
Similar to ObjectImpl._orb()java.lang.String[]
getTypeIds()
Similar to ObjectImpl._idsboolean
isLocal()
OutputStream
request(java.lang.String operation, boolean responseExpected)
void
setDelegate(Delegate delegate)
Similar to ObjectImpl._set_delegate
-
-
-
Field Detail
-
object
private Object object
-
-
Constructor Detail
-
StubWrapper
public StubWrapper(Object object)
-
-
Method Detail
-
setDelegate
public void setDelegate(Delegate delegate)
Description copied from interface:DynamicStub
Similar to ObjectImpl._set_delegate- Specified by:
setDelegate
in interfaceDynamicStub
- Parameters:
delegate
- delegate to set- See Also:
ObjectImpl._set_delegate(org.omg.CORBA.portable.Delegate)
-
getDelegate
public Delegate getDelegate()
Description copied from interface:DynamicStub
Similar to ObjectImpl._get_delegate- Specified by:
getDelegate
in interfaceDynamicStub
- Returns:
- Delegate contained
- See Also:
ObjectImpl._get_delegate()
-
getORB
public ORB getORB()
Description copied from interface:DynamicStub
Similar to ObjectImpl._orb()- Specified by:
getORB
in interfaceDynamicStub
- Returns:
- the ORB instance that created the Delegat
- See Also:
ObjectImpl._orb()
-
getTypeIds
public java.lang.String[] getTypeIds()
Description copied from interface:DynamicStub
Similar to ObjectImpl._ids- Specified by:
getTypeIds
in interfaceDynamicStub
- Returns:
- the array of all repository identifiers
- See Also:
ObjectImpl._ids()
-
connect
public void connect(ORB orb) throws java.rmi.RemoteException
Description copied from interface:DynamicStub
Connect this dynamic stub to an ORB. Just as in standard RMI-IIOP, this is required after a dynamic stub is deserialized from an ObjectInputStream. It is not needed when unmarshalling from a org.omg.CORBA.portable.InputStream.- Specified by:
connect
in interfaceDynamicStub
- Parameters:
orb
- ORB to connect to- Throws:
java.rmi.RemoteException
- if unable to connect
-
isLocal
public boolean isLocal()
- Specified by:
isLocal
in interfaceDynamicStub
-
request
public OutputStream request(java.lang.String operation, boolean responseExpected)
- Specified by:
request
in interfaceDynamicStub
-
_is_a
public boolean _is_a(java.lang.String repositoryIdentifier)
Description copied from interface:Object
Checks whether this object is an instance of a class that implements the given interface.
-
_is_equivalent
public boolean _is_equivalent(Object other)
Description copied from interface:Object
Determines whether the two object references are equivalent, so far as the ORB can easily determine. Two object references are equivalent if they are identical. Two distinct object references which in fact refer to the same object are also equivalent. However, ORBs are not required to attempt determination of whether two distinct object references refer to the same object, since such determination could be impractically expensive.- Specified by:
_is_equivalent
in interfaceObject
- 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 thatfalse
indicates only that the two object references are distinct, not necessarily that they reference distinct objects.
-
_non_existent
public boolean _non_existent()
Description copied from interface:Object
Determines whether the server object for this object reference has been destroyed.- Specified by:
_non_existent
in interfaceObject
- Returns:
true
if the ORB knows authoritatively that the server object does not exist;false
otherwise
-
_hash
public int _hash(int maximum)
Description copied from interface:Object
Returns an ORB-internal identifier for this object reference. This is a hash identifier, which does not change during the lifetime of the object reference, and so neither will any hash function of that identifier change. The value returned is not guaranteed to be unique; in other words, another object reference may have the same hash value. If two object references hash differently, then they are distinct object references; however, both may still refer to the same CORBA object.
-
_duplicate
public Object _duplicate()
Description copied from interface:Object
Returns a duplicate of this CORBA object reference. The server object implementation is not involved in creating the duplicate, and the implementation cannot distinguish whether the original object reference or a duplicate was used to make a request.Note that this method is not very useful in the Java platform, since memory management is handled by the VM. It is included for compliance with the CORBA APIs.
The method
_duplicate
may return this object reference itself.- Specified by:
_duplicate
in interfaceObject
- Returns:
- a duplicate of this object reference or this object reference itself
-
_release
public void _release()
Description copied from interface:Object
Signals that the caller is done using this object reference, so internal ORB resources associated with this object reference can be released. Note that the object implementation is not involved in this operation, and other references to the same object are not affected.
-
_get_interface_def
public Object _get_interface_def()
Description copied from interface:Object
Obtains anInterfaceDef
for the object implementation referenced by this object reference. TheInterfaceDef
object may be used to introspect on the methods, attributes, and other type information for the object referred to by this object reference.- Specified by:
_get_interface_def
in interfaceObject
- Returns:
- the
InterfaceDef
object in the Interface Repository which provides type information about the object referred to by this object reference
-
_request
public Request _request(java.lang.String operation)
Description copied from interface:Object
Creates aRequest
instance for use in the Dynamic Invocation Interface.
-
_create_request
public Request _create_request(Context ctx, java.lang.String operation, NVList arg_list, NamedValue result)
Description copied from interface:Object
Creates aRequest
instance initialized with the given context, method name, list of arguments, and container for the method's return value.- Specified by:
_create_request
in interfaceObject
- Parameters:
ctx
- aContext
object containing a list of propertiesoperation
- the name of the method to be invokedarg_list
- anNVList
containing the actual arguments to the method being invokedresult
- aNamedValue
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, java.lang.String operation, NVList arg_list, NamedValue result, ExceptionList exclist, ContextList ctxlist)
Description copied from interface:Object
Creates aRequest
instance initialized with the given context, method name, list of arguments, container for the method's return value, list of possible exceptions, and list of context strings needing to be resolved.- Specified by:
_create_request
in interfaceObject
- Parameters:
ctx
- aContext
object containing a list of propertiesoperation
- the name of the method to be invokedarg_list
- anNVList
containing the actual arguments to the method being invokedresult
- aNamedValue
object to serve as a container for the method's return valueexclist
- anExceptionList
object containing a list of possible exceptions the method can throwctxlist
- aContextList
object containing a list of context strings that need to be resolved and sent with theRequest
instance- Returns:
- the newly-created
Request
object - See Also:
Request
,NVList
,NamedValue
,ExceptionList
,ContextList
-
_get_policy
public Policy _get_policy(int policy_type)
Description copied from interface:Object
Returns thePolicy
object of the specified type which applies to this object.- Specified by:
_get_policy
in interfaceObject
- Parameters:
policy_type
- the type of policy to be obtained- Returns:
- A
Policy
object of the type specified by the policy_type parameter
-
_get_domain_managers
public DomainManager[] _get_domain_managers()
Description copied from interface:Object
Retrieves theDomainManagers
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 interfaceObject
- 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 newObject
with the given policies either replacing any existing policies in thisObject
or with the given policies added to the existing ones, depending on the value of the givenSetOverrideType
object.- Specified by:
_set_policy_override
in interfaceObject
- Parameters:
policies
- an array ofPolicy
objects containing the policies to be added or to be used as replacementsset_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:
- a new
Object
with the given policies replacing or added to those in thisObject
-
-