|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.jmood.utils.InstrumentationSupport
public class InstrumentationSupport
This class contains helper methods
Constructor Summary | |
---|---|
InstrumentationSupport(AgentContext ac)
|
Method Summary | |
---|---|
static Bundle[] |
getBundleDependencies(Bundle bundle,
AgentContext ac)
|
static long |
getBundleId(String symbolicName,
AgentContext ac)
|
static int |
getBundleStartLevel(Bundle bundle,
AgentContext ac)
|
static ExportedPackage[] |
getExportedPackages(Bundle bundle,
AgentContext ac)
|
static Hashtable |
getHashtable(Dictionary dic)
|
static ExportedPackage[] |
getImportedPackages(Bundle bundle,
AgentContext ac)
|
static String |
getPackageName(ExportedPackage pkg)
|
static String[] |
getPackageNames(ExportedPackage[] packages)
OSGi exported packages can be uniquely identified by the tuple (packageName, packageVersion). |
static RequiredBundle |
getRequiredBundle(Bundle bundle,
AgentContext ac)
|
static Bundle[] |
getRequiringBundles(Bundle bundle,
AgentContext ac)
|
static String[] |
getServiceNames(ServiceReference[] services)
OSGi Services can be registered under more than one interface (objectClass in the spec). |
static String |
getState(int state)
|
static String |
getSymbolicName(Bundle bundle)
|
static String[] |
getSymbolicNames(Bundle[] bundles)
For each BundleInfo, this method returns the symbolic name String, which we define as the concatenation of the getSymbolicName of the Bundle interface and the bundle version as specified
in the bundle header. |
static boolean |
isBundlePersistentlyStarted(Bundle bundle,
AgentContext ac)
|
static boolean |
isBundleRequired(Bundle bundle,
AgentContext ac)
|
static boolean |
isFragment(Bundle bundle,
AgentContext ac)
|
static boolean |
isRequiredBundleRemovalPending(Bundle bundle,
AgentContext ac)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InstrumentationSupport(AgentContext ac)
Method Detail |
---|
public static String[] getSymbolicNames(Bundle[] bundles)
For each BundleInfo, this method returns the symbolic name String, which we define as the concatenation of
the getSymbolicName of the Bundle
interface and the bundle version as specified
in the bundle header. Both parts are divided by a semicolon. An example would be:
com.acme.foo;1.0.0
bundles
- The Bundle
array to be converted
Bundle.getSymbolicName()
public static String getSymbolicName(Bundle bundle)
public static String[] getPackageNames(ExportedPackage[] packages)
OSGi exported packages can be uniquely identified by the tuple (packageName, packageVersion). This methods returns a String array representing those packages with the following syntax:
packageName;packageVersion
where packageName is as returned by the method getName() and packageVersion as returned by the method getVersion()
in package admin's ExportedPackage
class.
packages
- The ExportedPackage
array to be converted
ExportedPackage
public static String getPackageName(ExportedPackage pkg)
public static String[] getServiceNames(ServiceReference[] services)
OSGi Services can be registered under more than one interface (objectClass in the spec). Services have a mandatory unique service id (as defined in the SERVICE_ID property of the org.osgi.framework.Constants interface), during their lifetime (i.e, until they are garbage collected). To show this information in a consistent way, we use the following String representation of the service:
objectClass1[;objectClass2[;objectClass3...]]:service.id
where objectClass1..objectClassN are the elements of the mandatory objectClass array
included in the service property dictionary (and set by the framework at registration time. The property name is defined in org.osgi.framework.Constants#OBJECTCLASS
services
- The ServiceReference
array to be converted
Constants.OBJECTCLASS
,
Constants.SERVICE_ID
,
ServiceReference
public static ExportedPackage[] getImportedPackages(Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static Bundle[] getRequiringBundles(Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static Bundle[] getBundleDependencies(Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static boolean isBundleRequired(Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static boolean isRequiredBundleRemovalPending(Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static RequiredBundle getRequiredBundle(Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static String getState(int state)
public static boolean isBundlePersistentlyStarted(Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static int getBundleStartLevel(Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static ExportedPackage[] getExportedPackages(Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static boolean isFragment(Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static Hashtable getHashtable(Dictionary dic)
public static long getBundleId(String symbolicName, AgentContext ac) throws BundleNotAvailableException
BundleNotAvailableException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |