/** * Determines the equality of two ServicePermission objects. * * Checks that specified object has the same class name and action as this * {@code ServicePermission}. * * @param obj The object to test for equality. * @return true if obj is a {@code ServicePermission}, and has the same * class name and actions as this {@code ServicePermission} object; * {@code false} otherwise. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof ServicePermission)) { return false; } ServicePermission sp = (ServicePermission) obj; return (action_mask == sp.action_mask) && getName().equals(sp.getName()) && ((service == sp.service) || ((service != null) && (service.compareTo(sp.service) == 0))); }
@Override public int compareTo(final ResourceAccessGateHandler o) { // services with higher service ranking should be the first in a list return -this.reference.compareTo(o.reference); }
/** * @see java.lang.Comparable#compareTo(java.lang.Object) */ public int compareTo(final Object spa) { return this.reference.compareTo(((InventoryPrinterDescription) spa).reference); }
public int compare(ServiceReference o1, ServiceReference o2) { return o2.compareTo(o1); } });
public int compare(ServiceReference o1, ServiceReference o2) { return o2.compareTo(o1); } });
@Override public int compareTo(final Object reference) { return delegate == null ? -1 : delegate.compareTo(reference); } }
@Override public int compareTo(final Holder o) { // sort, highest first return -reference.compareTo(o.reference); }
@Override public int compareTo(final Holder o) { // sort, highest first return -reference.compareTo(o.reference); }
public int compare(ServiceReference o1, ServiceReference o2) { return o2.compareTo(o1); }
@Override public int compareTo(SlingRepositoryInitializerInfo o) { return ref.compareTo(o.ref); } }
@Override public int compareTo(final Object reference) { return delegate == null ? -1 : delegate.compareTo(reference); } }
@Override public int compareTo(final ResourceProviderInfo o) { int result = path.compareTo(o.path); if ( result == 0 ) { result = o.ref.compareTo(ref); } return result; }
/** * Try to release the service and notify the change. */ private synchronized void releaseService(final ServiceReference<?> ref) { if ( this.reference != null && this.reference.compareTo(ref) == 0 ) { this.service = null; bundleContext.ungetService(this.reference); this.reference = null; notifyChange(); } }
private void checkForUpdate() { ServiceReference<T> highestReference = null; for (ServiceReference<T> reference : m_trackedServiceRefs) { if (highestReference == null || highestReference.compareTo(reference) < 1) { highestReference = reference; } } m_dependency.changed(highestReference); } }
@Override public Object addingService(ServiceReference reference) { Object service = cc.getBundleContext().getService(reference); if(service != null){ if(yardTracker.getServiceReference() == null || //the first added Service or //the new service as higher ranking as the current (reference.compareTo(yardTracker.getServiceReference()) > 0)){ yard = (Yard)service; updateServiceRegistration(cc, yard, additionalMappings, nsPrefixService); } // else the new service has lower ranking as the currently use one } //else service == null -> ignore return service; } });
@Override public int compareTo( IPentahoObjectReference<T> o ) { if ( o == null ) { return 1; } if ( o instanceof OsgiPentahoObjectReference ) { OsgiPentahoObjectReference ref = (OsgiPentahoObjectReference) o; return osgiRef.compareTo( ref.osgiRef ); } Integer ourRank = getRanking(); Integer theirRanking = o.getRanking(); return ourRank.compareTo( theirRanking ); } }
@Override public int compare(final RefPair<?, ?> o1, final RefPair<?, ?> o2) { return o1.getRef().compareTo(o2.getRef()); } });
@Override public int compare(final RefPair<?, ?> o1, final RefPair<?, ?> o2) { return o1.getRef().compareTo(o2.getRef()); } });
@Override public int compareTo(Event b) { return getReference().compareTo(((ServiceEventImpl) b).getReference()); }
@Override public int compare(final ResourceProviderHandler o1, final ResourceProviderHandler o2) { final ResourceProviderInfo i1 = o1.getInfo(); final ResourceProviderInfo i2 = o2.getInfo(); if ( i1 == null ) { return i2 == null ? 0 : -1; } if ( i2 == null ) { return 1; } return i2.getServiceReference().compareTo(i1.getServiceReference()); } });