Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBJ Hargrave2008-10-01 19:49:49 +0000
committerBJ Hargrave2008-10-01 19:49:49 +0000
commit19c51e86352d7f6ef6f0dd1c525ce14c118585e5 (patch)
tree48cdfce5479b2ec4eb26a005d96a90823e375a44 /bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/serviceregistry/ServiceReferenceImpl.java
parentbe5cb5ffadb37eca2cf7fd201fe0b397d580c9cb (diff)
downloadrt.equinox.framework-19c51e86352d7f6ef6f0dd1c525ce14c118585e5.tar.gz
rt.equinox.framework-19c51e86352d7f6ef6f0dd1c525ce14c118585e5.tar.xz
rt.equinox.framework-19c51e86352d7f6ef6f0dd1c525ce14c118585e5.zip
ASSIGNED - bug 244625: Implement new service registry hooks (RFC 126)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=244625 Add FindHook support
Diffstat (limited to 'bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/serviceregistry/ServiceReferenceImpl.java')
-rwxr-xr-xbundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/serviceregistry/ServiceReferenceImpl.java28
1 files changed, 4 insertions, 24 deletions
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/serviceregistry/ServiceReferenceImpl.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/serviceregistry/ServiceReferenceImpl.java
index 954e94b2f..345924288 100755
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/serviceregistry/ServiceReferenceImpl.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/internal/serviceregistry/ServiceReferenceImpl.java
@@ -188,7 +188,7 @@ public class ServiceReferenceImpl implements ServiceReference, Comparable {
* {@link Constants#SERVICE_ID service id} and greater if it has a lower
* service id.
*
- * @param reference The <code>ServiceReference</code> to be compared.
+ * @param object The <code>ServiceReference</code> to be compared.
* @return Returns a negative integer, zero, or a positive integer if this
* <code>ServiceReference</code> is less than, equal to, or
* greater than the specified <code>ServiceReference</code>.
@@ -196,9 +196,7 @@ public class ServiceReferenceImpl implements ServiceReference, Comparable {
*/
public int compareTo(Object object) {
ServiceReferenceImpl other = (ServiceReferenceImpl) object;
- if (this.getRanking() != other.getRanking())
- return this.getRanking() > other.getRanking() ? -1 : 1;
- return this.getId() == other.getId() ? 0 : this.getId() > other.getId() ? 1 : -1;
+ return registration.compareTo(other.registration);
}
/**
@@ -219,11 +217,11 @@ public class ServiceReferenceImpl implements ServiceReference, Comparable {
*/
public boolean equals(Object obj) {
if (obj == this) {
- return (true);
+ return true;
}
if (!(obj instanceof ServiceReferenceImpl)) {
- return (false);
+ return false;
}
ServiceReferenceImpl other = (ServiceReferenceImpl) obj;
@@ -257,22 +255,4 @@ public class ServiceReferenceImpl implements ServiceReference, Comparable {
String[] getClasses() {
return registration.getClasses();
}
-
- /**
- * Return the service id of the ServiceRegistration.
- *
- * @return service.id of the service
- */
- long getId() {
- return registration.getId();
- }
-
- /**
- * Return the service ranking of the ServiceRegistration.
- *
- * @return service.ranking of the service
- */
- int getRanking() {
- return registration.getRanking();
- }
}

Back to the top