|
Service Activator Toolkit
Version 1.0.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.soda.sat.core.util.BundleUtility
The BundleUtility class is a utility that simplifies working
with Bundle objects.
Note: This is a singleton class, accessible only via the static method
getInstance(). For example:
BundleUtility utility = BundleUtility.getInstance(); boolean result = utility.isBundleState(bundle, Bundle.INSTALLED);
| Method Summary | |
static BundleUtility |
getInstance()
Public getter for the BundleUtility singleton instance. |
ServiceReference |
getServiceInstanceOf(Bundle bundle,
String name)
Query a Bundle for a ServiceReference to a
named service. |
boolean |
isBundleState(Bundle bundle,
int state)
Tests whether a Bundle is in a specific state. |
boolean |
isRegisteredService(Bundle bundle,
ServiceReference serviceReference)
Answers true if the Bundle has registered the
ServiceReference, otherwise false. |
boolean |
isRegisteredService(Bundle bundle,
String name)
Answers true if the Bundle has registered a
service with the given name, otherwise false. |
boolean |
isServiceInUse(Bundle bundle,
ServiceReference serviceReference)
Answers true if the Bundle is using the
ServiceReference |
String |
toBundleStateString(Bundle bundle)
Get a human-readable string that describes the state of a given bundle. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static BundleUtility getInstance()
BundleUtility singleton instance.
BundleUtility
public ServiceReference getServiceInstanceOf(Bundle bundle,
String name)
Bundle for a ServiceReference to a
named service. Answers the ServiceReference or
null if no match was found.
bundle - The bundle to be queried.name - The fully qualified type name of the service.
ServiceReference or null.
public boolean isBundleState(Bundle bundle,
int state)
Bundle is in a specific state. Valid bundle
states are defined by the Bundle class:
- Bundle.UNINSTALLED
- Bundle.INSTALLED
- Bundle.RESOLVED
- Bundle.STARTING
- Bundle.STOPPING
- Bundle.ACTIVE
For example:
boolean active = BundleUntility.isBundle(bundle, Bundle.ACTIVE);
bundle - The bundle who's state is being tested.state - The state being tested for.
boolean
public boolean isRegisteredService(Bundle bundle,
ServiceReference serviceReference)
true if the Bundle has registered the
ServiceReference, otherwise false.
bundle - The Bundle being queried.serviceReference - The ServiceReference being searched
for.
- Returns:
boolean
public boolean isRegisteredService(Bundle bundle,
String name)
true if the Bundle has registered a
service with the given name, otherwise false.
bundle - The Bundle being queried.name - The fully qualified type name of the service.
- Returns:
boolean
public boolean isServiceInUse(Bundle bundle,
ServiceReference serviceReference)
Bundle is using the
ServiceReference, otherwise false.
- Parameters:
bundle - The Bundle being queried.serviceReference - The ServiceReference being searched
for.
- Returns:
boolean
public String toBundleStateString(Bundle bundle)
bundle - A Bundle.
String describing the state of the
Bundle.
|
Service Activator Toolkit
Version 1.0.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright © 2001, 2007 IBM Corporation and others. All Rights Reserved.