|
||||||||||
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 org.osgi.framework.Bundle[] |
getBundleDependencies(org.osgi.framework.Bundle bundle,
AgentContext ac)
|
static long |
getBundleId(java.lang.String symbolicName,
AgentContext ac)
|
static int |
getBundleStartLevel(org.osgi.framework.Bundle bundle,
AgentContext ac)
|
static org.osgi.service.packageadmin.ExportedPackage[] |
getExportedPackages(org.osgi.framework.Bundle bundle,
AgentContext ac)
|
static java.util.Hashtable |
getHashtable(java.util.Dictionary dic)
|
static org.osgi.service.packageadmin.ExportedPackage[] |
getImportedPackages(org.osgi.framework.Bundle bundle,
AgentContext ac)
|
static java.lang.String |
getPackageName(org.osgi.service.packageadmin.ExportedPackage pkg)
|
static java.lang.String[] |
getPackageNames(org.osgi.service.packageadmin.ExportedPackage[] packages)
OSGi exported packages can be uniquely identified by the tuple (packageName, packageVersion). |
static org.osgi.service.packageadmin.RequiredBundle |
getRequiredBundle(org.osgi.framework.Bundle bundle,
AgentContext ac)
|
static org.osgi.framework.Bundle[] |
getRequiringBundles(org.osgi.framework.Bundle bundle,
AgentContext ac)
|
static java.lang.String[] |
getServiceNames(org.osgi.framework.ServiceReference[] services)
OSGi Services can be registered under more than one interface (objectClass in the spec). |
static java.lang.String |
getState(int state)
|
static java.lang.String |
getSymbolicName(org.osgi.framework.Bundle bundle)
|
static java.lang.String[] |
getSymbolicNames(org.osgi.framework.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(org.osgi.framework.Bundle bundle,
AgentContext ac)
|
static boolean |
isBundleRequired(org.osgi.framework.Bundle bundle,
AgentContext ac)
|
static boolean |
isFragment(org.osgi.framework.Bundle bundle,
AgentContext ac)
|
static boolean |
isRequiredBundleRemovalPending(org.osgi.framework.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 java.lang.String[] getSymbolicNames(org.osgi.framework.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 java.lang.String getSymbolicName(org.osgi.framework.Bundle bundle)
public static java.lang.String[] getPackageNames(org.osgi.service.packageadmin.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 java.lang.String getPackageName(org.osgi.service.packageadmin.ExportedPackage pkg)
public static java.lang.String[] getServiceNames(org.osgi.framework.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 org.osgi.service.packageadmin.ExportedPackage[] getImportedPackages(org.osgi.framework.Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static org.osgi.framework.Bundle[] getRequiringBundles(org.osgi.framework.Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static org.osgi.framework.Bundle[] getBundleDependencies(org.osgi.framework.Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static boolean isBundleRequired(org.osgi.framework.Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static boolean isRequiredBundleRemovalPending(org.osgi.framework.Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static org.osgi.service.packageadmin.RequiredBundle getRequiredBundle(org.osgi.framework.Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static java.lang.String getState(int state)
public static boolean isBundlePersistentlyStarted(org.osgi.framework.Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static int getBundleStartLevel(org.osgi.framework.Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static org.osgi.service.packageadmin.ExportedPackage[] getExportedPackages(org.osgi.framework.Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static boolean isFragment(org.osgi.framework.Bundle bundle, AgentContext ac) throws ServiceNotAvailableException
ServiceNotAvailableException
public static java.util.Hashtable getHashtable(java.util.Dictionary dic)
public static long getBundleId(java.lang.String symbolicName, AgentContext ac) throws BundleNotAvailableException
BundleNotAvailableException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |