本文整理匯總了Java中java.rmi.server.RMIClientSocketFactory.equals方法的典型用法代碼示例。如果您正苦於以下問題:Java RMIClientSocketFactory.equals方法的具體用法?Java RMIClientSocketFactory.equals怎麽用?Java RMIClientSocketFactory.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.rmi.server.RMIClientSocketFactory
的用法示例。
在下文中一共展示了RMIClientSocketFactory.equals方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: remoteEquals
import java.rmi.server.RMIClientSocketFactory; //導入方法依賴的package包/類
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;
}
}