Search in sources :

Example 6 with TCPEndpoint

use of sun.rmi.transport.tcp.TCPEndpoint in project jdk8u_jdk by JetBrains.

the class LiveRef method remoteEquals.

public boolean remoteEquals(Object obj) {
    if (obj != null && obj instanceof LiveRef) {
        LiveRef ref = (LiveRef) obj;
        TCPEndpoint thisEp = ((TCPEndpoint) ep);
        TCPEndpoint refEp = ((TCPEndpoint) ref.ep);
        RMIClientSocketFactory thisClientFactory = thisEp.getClientSocketFactory();
        RMIClientSocketFactory refClientFactory = refEp.getClientSocketFactory();
        /**
             * Fix for 4254103: LiveRef.remoteEquals should not fail
             * if one of the objects in the comparison has a null
             * server socket.  Comparison should only consider the
             * following criteria:
             *
             * hosts, ports, client socket factories and object IDs.
             */
        if (thisEp.getPort() != refEp.getPort() || !thisEp.getHost().equals(refEp.getHost())) {
            return false;
        }
        if ((thisClientFactory == null) ^ (refClientFactory == null)) {
            return false;
        }
        if ((thisClientFactory != null) && !((thisClientFactory.getClass() == refClientFactory.getClass()) && (thisClientFactory.equals(refClientFactory)))) {
            return false;
        }
        return (id.equals(ref.id));
    } else {
        return false;
    }
}
Also used : TCPEndpoint(sun.rmi.transport.tcp.TCPEndpoint) RMIClientSocketFactory(java.rmi.server.RMIClientSocketFactory)

Aggregations

TCPEndpoint (sun.rmi.transport.tcp.TCPEndpoint)6 RemoteRef (java.rmi.server.RemoteRef)3 LiveRef (sun.rmi.transport.LiveRef)3 Remote (java.rmi.Remote)2 RemoteException (java.rmi.RemoteException)2 ObjID (java.rmi.server.ObjID)2 RegistryImpl (sun.rmi.registry.RegistryImpl)2 UnicastRef (sun.rmi.server.UnicastRef)2 IOException (java.io.IOException)1 Constructor (java.lang.reflect.Constructor)1 Method (java.lang.reflect.Method)1 MalformedURLException (java.net.MalformedURLException)1 NoSuchObjectException (java.rmi.NoSuchObjectException)1 LocateRegistry (java.rmi.registry.LocateRegistry)1 Registry (java.rmi.registry.Registry)1 RMIClientSocketFactory (java.rmi.server.RMIClientSocketFactory)1 RemoteCall (java.rmi.server.RemoteCall)1 RemoteObject (java.rmi.server.RemoteObject)1 UnicastRef2 (sun.rmi.server.UnicastRef2)1 UnicastServerRef (sun.rmi.server.UnicastServerRef)1