public class ServiceReferenceUtils
extends java.lang.Object
Constructor and Description |
---|
ServiceReferenceUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
containsReferenceById(java.util.List<? extends org.osgi.framework.ServiceReference> references,
org.osgi.framework.ServiceReference ref)
Checks whether a list of service references contains a reference with the same service.id as the
given reference.
|
static org.osgi.framework.ServiceReference |
getServiceReferenceById(java.util.List<? extends org.osgi.framework.ServiceReference> references,
org.osgi.framework.ServiceReference ref)
Gets a service reference with the same service.id as the given reference from the given list.
|
static boolean |
haveSameProperties(org.osgi.framework.ServiceReference ref1,
org.osgi.framework.ServiceReference ref2)
Checks whether the two references has the same properties and their value are equals.
|
static boolean |
haveSameServiceId(org.osgi.framework.ServiceReference ref1,
org.osgi.framework.ServiceReference ref2)
Checks whether two service references have the same service id.
|
static boolean |
match(org.osgi.framework.Filter filter,
org.osgi.framework.ServiceReference ref)
Checks if the given service reference match the current filter.
|
static java.lang.String |
toString(java.util.Collection<? extends org.osgi.framework.ServiceReference> references) |
public static boolean match(org.osgi.framework.Filter filter, org.osgi.framework.ServiceReference ref)
Filter.match(org.osgi.framework.ServiceReference)
method when manipulating a composite reference. In fact, this method thrown
a ClassCastException
on Equinox.ref
- the service reference to check.true
if the service reference matches.public static boolean containsReferenceById(java.util.List<? extends org.osgi.framework.ServiceReference> references, org.osgi.framework.ServiceReference ref)
references
- the list of referenceref
- the referencepublic static org.osgi.framework.ServiceReference getServiceReferenceById(java.util.List<? extends org.osgi.framework.ServiceReference> references, org.osgi.framework.ServiceReference ref)
references
- the list of referencesref
- the referencepublic static boolean haveSameProperties(org.osgi.framework.ServiceReference ref1, org.osgi.framework.ServiceReference ref2)
ref1
- first referenceref2
- second referencepublic static boolean haveSameServiceId(org.osgi.framework.ServiceReference ref1, org.osgi.framework.ServiceReference ref2)
ref1
- first referenceref2
- second referencepublic static java.lang.String toString(java.util.Collection<? extends org.osgi.framework.ServiceReference> references)
Copyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.