You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@river.apache.org by pe...@apache.org on 2010/11/12 05:54:11 UTC

svn commit: r1034268 - in /incubator/river/jtsk/trunk/src: com/sun/jini/discovery/DiscoveryConstraints.java com/sun/jini/phoenix/RegistrySunExporter.java net/jini/discovery/LookupLocatorDiscovery.java

Author: peter_firmstone
Date: Fri Nov 12 04:54:10 2010
New Revision: 1034268

URL: http://svn.apache.org/viewvc?rev=1034268&view=rev
Log:
Minor improvements to documentation and implement equals and hashcode in DiscoveryConstraints.

Modified:
    incubator/river/jtsk/trunk/src/com/sun/jini/discovery/DiscoveryConstraints.java
    incubator/river/jtsk/trunk/src/com/sun/jini/phoenix/RegistrySunExporter.java
    incubator/river/jtsk/trunk/src/net/jini/discovery/LookupLocatorDiscovery.java

Modified: incubator/river/jtsk/trunk/src/com/sun/jini/discovery/DiscoveryConstraints.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/discovery/DiscoveryConstraints.java?rev=1034268&r1=1034267&r2=1034268&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/discovery/DiscoveryConstraints.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/discovery/DiscoveryConstraints.java Fri Nov 12 04:54:10 2010
@@ -75,6 +75,42 @@ public class DiscoveryConstraints {
     private final MulticastMaxPacketSize maxPacketSize;
     private final MulticastTimeToLive timeToLive;
     private final UnicastSocketTimeout socketTimeout;
+    private final int hashcode;
+
+    @Override
+    public int hashCode() {
+	return hashcode;
+    }
+    
+    @Override
+    public boolean equals(Object o){
+	if ( o == this ) return true;
+	if ( o.hashCode() != hashcode) return false;
+	if ( o instanceof DiscoveryConstraints) {
+	    DiscoveryConstraints that = (DiscoveryConstraints) o;
+	    if ( unfulfilled != null ) {
+		if ( !unfulfilled.equals(that.unfulfilled) ) return false;
+	    } else if ( unfulfilled != that.unfulfilled) return false;
+	    if (  protocolVersions != null ) {
+		if ( !protocolVersions.equals(that.protocolVersions) ) return false;
+	    } else if ( protocolVersions!= that.protocolVersions) return false;
+	    if (  connectionAbsoluteTime != null ) {
+		if ( !connectionAbsoluteTime.equals(that.connectionAbsoluteTime) ) return false;
+	    } else if ( connectionAbsoluteTime != that.connectionAbsoluteTime) return false;
+	    if (preferredProtocolVersion != that.preferredProtocolVersion) return false;
+	    if ( maxPacketSize  != null ) {
+		if ( !maxPacketSize.equals(that.maxPacketSize) ) return false;
+	    } else if ( maxPacketSize != that.maxPacketSize) return false;    
+	    if (  timeToLive != null ) {
+		if ( !timeToLive.equals(that.timeToLive) ) return false;
+	    } else if ( timeToLive != that.timeToLive) return false;
+	    if (  socketTimeout != null ) {
+		if ( !socketTimeout.equals(that.socketTimeout) ) return false;
+	    } else if ( socketTimeout != that.socketTimeout) return false;    		
+	    return true;	    
+	}
+	return false;
+    }
 
     /**
      * Empty method which serves as a {@link MethodConstraints} key for looking
@@ -163,6 +199,15 @@ public class DiscoveryConstraints {
 	connectionAbsoluteTime = s.isEmpty() ?
 				    null :
 				    (ConnectionAbsoluteTime) getElement(s);
+	int hash = 7;
+	hash = 41 * hash + (this.unfulfilled != null ? this.unfulfilled.hashCode() : 0);
+	hash = 41 * hash + (this.protocolVersions != null ? this.protocolVersions.hashCode() : 0);
+	hash = 41 * hash + this.preferredProtocolVersion;
+	hash = 41 * hash + (this.connectionAbsoluteTime != null ? this.connectionAbsoluteTime.hashCode() : 0);
+	hash = 41 * hash + (this.maxPacketSize != null ? this.maxPacketSize.hashCode() : 0);
+	hash = 41 * hash + (this.timeToLive != null ? this.timeToLive.hashCode() : 0);
+	hash = 41 * hash + (this.socketTimeout != null ? this.socketTimeout.hashCode() : 0);
+	hashcode = hash;
     }
 
     /**

Modified: incubator/river/jtsk/trunk/src/com/sun/jini/phoenix/RegistrySunExporter.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/phoenix/RegistrySunExporter.java?rev=1034268&r1=1034267&r2=1034268&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/phoenix/RegistrySunExporter.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/phoenix/RegistrySunExporter.java Fri Nov 12 04:54:10 2010
@@ -102,9 +102,11 @@ public class RegistrySunExporter extends
          * This method is an overridden method from UnicastServerRef which is
          * a sun internal implementation class.
          * 
-         * @depreciated no replacement
+         * @deprecated no replacement
          * @see java.rmi.server.RemoteCall
 	 */
+	@Deprecated
+	@Override
 	public void dispatch(Remote obj, RemoteCall call) throws IOException {
 	    try {
 		useCodebaseOnly.invoke(call.getInputStream(), new Object[0]);

Modified: incubator/river/jtsk/trunk/src/net/jini/discovery/LookupLocatorDiscovery.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/discovery/LookupLocatorDiscovery.java?rev=1034268&r1=1034267&r2=1034268&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/discovery/LookupLocatorDiscovery.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/discovery/LookupLocatorDiscovery.java Fri Nov 12 04:54:10 2010
@@ -68,7 +68,9 @@ import net.jini.security.ProxyPreparer;
  * discovering entity supply this class with specific information about the
  * desired lookup services; namely, the location of the device(s) hosting
  * each lookup service. This information is supplied through an instance
- * of the {@link net.jini.core.discovery.LookupLocator LookupLocator} class.
+ * of the {@link net.jini.core.discovery.LookupLocator LookupLocator} class,
+ * or its subclass {@link net.jini.discovery.ConstrainableLookupLocator
+ * ConstrainableLookupLocator}.
  *
  * @com.sun.jini.impl <!-- Implementation Specifics -->
  *