|
Service Activator Toolkit
Version 1.1.0 (20081206) |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.soda.sat.core.util.ServiceReferenceUtility
public final class ServiceReferenceUtility
The ServiceReferenceUtility
class is a utility that simplifies
working with ServiceReference
objects.
Note: This is a singleton class, accessible only via the static method
getInstance()
. For example:
ServiceReferenceUtility utility = ServiceReferenceUtility.getInstance(); String[] names = utility.getServiceNames(reference);
ServiceReference
Method Summary | |
---|---|
Comparator |
createServiceRankingComparator()
Create a Comparator for sorting an array or collection of
ServiceReference objects by service rank (highest to lowest)
and then by service id (lowest to highest). |
static ServiceReferenceUtility |
getInstance()
Public getter for the ServiceReferenceUtility singleton
instance. |
long |
getServiceId(ServiceReference reference)
Gets the Constants.SERVICE_ID property from the specified
ServiceReference objects. |
long[] |
getServiceIds(ServiceReference[] references)
Gets the Constants.SERVICE_ID properties from an array of
ServiceReference objects. |
List |
getServiceNames(ServiceReference reference)
Answers an array of service names available from the specified ServiceReference . |
List |
getServiceNames(ServiceReference[] references)
Gets the service names from an array of ServiceReference
objects. |
boolean |
isServiceInstanceOf(ServiceReference reference,
String name)
Answers true if the ServiceReference is an instance of the
service name. |
ServiceReference |
select(ServiceReference[] references)
Select an appropriate ServiceReference from an array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ServiceReferenceUtility getInstance()
ServiceReferenceUtility
singleton
instance.
ServiceReferenceUtility
singleton instance.public Comparator createServiceRankingComparator()
Comparator
for sorting an array or collection of
ServiceReference
objects by service rank (highest to lowest)
and then by service id (lowest to highest).
public long getServiceId(ServiceReference reference)
Constants.SERVICE_ID
property from the specified
ServiceReference
objects.
reference
- A ServiceReference
.
Constants.SERVICE_ID
property value.public long[] getServiceIds(ServiceReference[] references)
Constants.SERVICE_ID
properties from an array of
ServiceReference
objects.
references
- An array of ServiceReference
objects.
Constants.SERVICE_ID
property values.public List getServiceNames(ServiceReference reference)
ServiceReference
.
reference
- The ServiceReference
to be queried.
public List getServiceNames(ServiceReference[] references)
ServiceReference
objects.
references
- An array of ServiceReference
objects.
public boolean isServiceInstanceOf(ServiceReference reference, String name)
ServiceReference
is an instance of the
service name.
reference
- The ServiceReference
to be queried.name
- A fully qualified type name of a service.
ServiceReference
represents the service
name return true
, otherwise false
.public ServiceReference select(ServiceReference[] references)
ServiceReference
from an array. The
criteria for selection is as follows:
ServiceReference
with the highest ranking as
specified in its Constants.SERVICE_RANKING
property is
selected.
ServiceReference
with the lowest service ID, as specified in its
Constants.SERVICE_ID
property, is selected.
references
- An array of ServiceReference
objects from
which to select.
ServiceReference
or null
.
|
Service Activator Toolkit
Version 1.1.0 (20081206) |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2001, 2008 IBM Corporation and others. All Rights Reserved.