Class StubDelegateImpl

  • All Implemented Interfaces:
    StubDelegate

    public class StubDelegateImpl
    extends java.lang.Object
    implements StubDelegate
    Base class from which all static RMI-IIOP stubs must inherit.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void connect​(Stub self, ORB orb)
      Connects this stub to an ORB.
      boolean equals​(java.lang.Object obj)  
      boolean equals​(Stub self, java.lang.Object obj)
      Compares two stubs for equality.
      StubIORImpl getIOR()  
      int hashCode()  
      int hashCode​(Stub self)
      Returns a hash code value for the object which is the same for all stubs that represent the same remote object.
      private void init​(Stub self)
      Sets the IOR components if not already set.
      void readObject​(Stub self, java.io.ObjectInputStream stream)
      Serialization method to restore the IOR state.
      void setIOR​(StubIORImpl ior)  
      java.lang.String toString​(Stub self)
      Returns a string representation of this stub.
      void writeObject​(Stub self, java.io.ObjectOutputStream stream)
      Serialization method to save the IOR state.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StubDelegateImpl

        public StubDelegateImpl()
    • Method Detail

      • init

        private void init​(Stub self)
        Sets the IOR components if not already set.
      • hashCode

        public int hashCode​(Stub self)
        Returns a hash code value for the object which is the same for all stubs that represent the same remote object.
        Specified by:
        hashCode in interface StubDelegate
        Parameters:
        self - stub to call on
        Returns:
        the hash code value.
      • equals

        public boolean equals​(Stub self,
                              java.lang.Object obj)
        Compares two stubs for equality. Returns true when used to compare stubs that represent the same remote object, and false otherwise.
        Specified by:
        equals in interface StubDelegate
        Parameters:
        obj - the reference object with which to compare.
        self - stub to call on
        Returns:
        true if this object is the same as the obj argument; false otherwise.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString​(Stub self)
        Returns a string representation of this stub. Returns the same string for all stubs that represent the same remote object.
        Specified by:
        toString in interface StubDelegate
        Parameters:
        self - to call toString on
        Returns:
        a string representation of this stub.
      • connect

        public void connect​(Stub self,
                            ORB orb)
                     throws java.rmi.RemoteException
        Connects this stub to an ORB. Required after the stub is deserialized but not after it is demarshalled by an ORB stream. If an unconnected stub is passed to an ORB stream for marshalling, it is implicitly connected to that ORB. Application code should not call this method directly, but should call the portable wrapper method PortableRemoteObject.connect(java.rmi.Remote, java.rmi.Remote).
        Specified by:
        connect in interface StubDelegate
        Parameters:
        orb - the ORB to connect to.
        self - stub to call on
        Throws:
        java.rmi.RemoteException - if the stub is already connected to a different ORB, or if the stub does not represent an exported remote or local object.
      • readObject

        public void readObject​(Stub self,
                               java.io.ObjectInputStream stream)
                        throws java.io.IOException,
                               java.lang.ClassNotFoundException
        Serialization method to restore the IOR state.
        Specified by:
        readObject in interface StubDelegate
        Parameters:
        self - stub to read
        stream - stream to read from
        Throws:
        java.io.IOException - if there was an error reading from the stream
        java.lang.ClassNotFoundException - if the class that was represented by the steam cannot be found
      • writeObject

        public void writeObject​(Stub self,
                                java.io.ObjectOutputStream stream)
                         throws java.io.IOException
        Serialization method to save the IOR state.
        Specified by:
        writeObject in interface StubDelegate
        Parameters:
        self - stub to write
        stream - stream to write to
        Throws:
        java.io.IOException - if there was an error writing to stream