Class 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.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Object object  
    • 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 a Request 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 a Request 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 the DomainManagers of this object.
      Object _get_interface_def()
      Obtains an InterfaceDef for the object implementation referenced by this object reference.
      Policy _get_policy​(int policy_type)
      Returns the Policy 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 a Request instance for use in the Dynamic Invocation Interface.
      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.
      void connect​(ORB orb)
      Connect this dynamic stub to an ORB.
      Delegate getDelegate()
      Similar to ObjectImpl._get_delegate
      ORB getORB()
      Similar to ObjectImpl._orb()
      java.lang.String[] getTypeIds()
      Similar to ObjectImpl._ids
      boolean isLocal()  
      OutputStream request​(java.lang.String operation, boolean responseExpected)  
      void setDelegate​(Delegate delegate)
      Similar to ObjectImpl._set_delegate
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • object

        private Object object
    • Constructor Detail

      • StubWrapper

        public StubWrapper​(Object object)
    • Method Detail

      • getTypeIds

        public java.lang.String[] getTypeIds()
        Description copied from interface: DynamicStub
        Similar to ObjectImpl._ids
        Specified by:
        getTypeIds in interface DynamicStub
        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 interface DynamicStub
        Parameters:
        orb - ORB to connect to
        Throws:
        java.rmi.RemoteException - if unable to connect
      • _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.
        Specified by:
        _is_a in interface 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 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 interface 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()
        Description copied from interface: Object
        Determines whether the server object for this object reference has been destroyed.
        Specified by:
        _non_existent in interface Object
        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.
        Specified by:
        _hash in interface Object
        Parameters:
        maximum - the upper bound on the hash value returned by the ORB
        Returns:
        the ORB-internal hash identifier for this object reference
      • _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 interface Object
        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.
        Specified by:
        _release in interface Object
      • _get_interface_def

        public Object _get_interface_def()
        Description copied from interface: Object
        Obtains an InterfaceDef for the object implementation referenced by this object reference. The InterfaceDef 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 interface Object
        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 a Request instance for use in the Dynamic Invocation Interface.
        Specified by:
        _request in interface 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,
                                       java.lang.String operation,
                                       NVList arg_list,
                                       NamedValue result)
        Description copied from interface: Object
        Creates a Request instance initialized with the given context, method name, list of arguments, and container for the method's return value.
        Specified by:
        _create_request in interface 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,
                                       java.lang.String operation,
                                       NVList arg_list,
                                       NamedValue result,
                                       ExceptionList exclist,
                                       ContextList ctxlist)
        Description copied from interface: Object
        Creates a Request 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 interface 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_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
        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 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
        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
        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