org.apache.felix.framework
Class Felix

java.lang.Object
  extended by org.apache.felix.framework.Felix
All Implemented Interfaces:
org.osgi.framework.Bundle

public class Felix
extends java.lang.Object


Field Summary
 
Fields inherited from interface org.osgi.framework.Bundle
ACTIVE, INSTALLED, RESOLVED, STARTING, STOPPING, UNINSTALLED
 
Constructor Summary
Felix(Logger logger, java.util.Map configMutableMap, java.util.List activatorList)
           This method creates the framework instance; instances of the framework are not active until they are started.
Felix(java.util.Map configMutableMap, java.util.List activatorList)
          Creates a new Felix framework instance with a default logger.
 
Method Summary
protected  void _resolveBundle(org.apache.felix.framework.FelixBundle bundle)
           
protected  void _updateBundle(org.apache.felix.framework.FelixBundle bundle, java.io.InputStream is)
           
protected  void acquireBundleLock(org.apache.felix.framework.FelixBundle bundle)
           
protected  boolean acquireBundleLockOrFail(org.apache.felix.framework.FelixBundle bundle)
           
protected  org.apache.felix.framework.FelixBundle[] acquireBundleRefreshLocks(org.osgi.framework.Bundle[] targets)
           
protected  org.apache.felix.framework.FelixBundle[] acquireBundleResolveLocks(org.osgi.framework.Bundle[] targets)
           
protected  void acquireInstallLock(java.lang.String location)
           
protected  void addBundleListener(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleListener l)
           
protected  void addFrameworkListener(org.osgi.framework.Bundle bundle, org.osgi.framework.FrameworkListener l)
           
protected  void addRequirement(org.apache.felix.framework.FelixBundle bundle, java.lang.String s)
           
protected  void addServiceListener(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceListener l, java.lang.String f)
          Implementation for BundleContext.addServiceListener().
protected  boolean bundleHasPermission(org.apache.felix.framework.FelixBundle bundle, java.lang.Object obj)
           
protected  java.util.Enumeration findBundleEntries(org.apache.felix.framework.FelixBundle bundle, java.lang.String path, java.lang.String filePattern, boolean recurse)
          Implementation for findEntries().
 java.util.Enumeration findEntries(java.lang.String path, java.lang.String filePattern, boolean recurse)
           
protected  org.osgi.framework.ServiceReference[] getAllowedServiceReferences(org.apache.felix.framework.FelixBundle bundle, java.lang.String className, java.lang.String expr, boolean checkAssignable)
          Retrieves Array of ServiceReference objects based on calling bundle, service class name, optional filter expression, and optionally filters further on the version.
protected  org.osgi.framework.Bundle getBundle(java.lang.Class clazz)
          This method returns the bundle associated with the specified class if the class was loaded from a bundle from this framework instance.
protected  org.osgi.framework.Bundle getBundle(long id)
          Implementation for BundleContext.getBundle().
protected  org.osgi.framework.Bundle getBundle(java.lang.String location)
          Retrieves a bundle from its location.
 org.osgi.framework.BundleContext getBundleContext()
           
protected  java.net.URL getBundleEntry(org.apache.felix.framework.FelixBundle bundle, java.lang.String name)
          Implementation for Bundle.getEntry().
protected  java.util.Enumeration getBundleEntryPaths(org.apache.felix.framework.FelixBundle bundle, java.lang.String path)
          Implementation for Bundle.getEntryPaths().
protected  java.util.Dictionary getBundleHeaders(org.apache.felix.framework.FelixBundle bundle, java.lang.String locale)
          Get bundle headers and resolve any localized strings from resource bundles.
 long getBundleId()
           
protected  java.lang.String getBundleLocation(org.apache.felix.framework.FelixBundle bundle)
          Implementation for Bundle.getLocation().
protected  org.osgi.framework.ServiceReference[] getBundleRegisteredServices(org.apache.felix.framework.FelixBundle bundle)
           
protected  java.net.URL getBundleResource(org.apache.felix.framework.FelixBundle bundle, java.lang.String name)
          Implementation for Bundle.getResource().
protected  java.util.Enumeration getBundleResources(org.apache.felix.framework.FelixBundle bundle, java.lang.String name)
          Implementation for Bundle.getResources().
protected  org.osgi.framework.Bundle[] getBundles()
          Implementation for BundleContext.getBundles().
protected  org.osgi.framework.ServiceReference[] getBundleServicesInUse(org.osgi.framework.Bundle bundle)
           
protected  int getBundleStartLevel(org.osgi.framework.Bundle bundle)
          Returns the start level for the specified bundle; this method implements functionality for the Start Level service.
protected  java.lang.String getBundleSymbolicName(org.apache.felix.framework.FelixBundle bundle)
          Implementation for Bundle.getSymbolicName().
protected  java.io.File getDataFile(org.apache.felix.framework.FelixBundle bundle, java.lang.String s)
           
protected  org.osgi.framework.Bundle[] getDependentBundles(org.apache.felix.framework.FelixBundle exporter)
           
 java.net.URL getEntry(java.lang.String name)
           
 java.util.Enumeration getEntryPaths(java.lang.String path)
           
protected  org.osgi.service.packageadmin.ExportedPackage[] getExportedPackages(org.osgi.framework.Bundle b)
          Returns an array of all actively exported packages from the specified bundle or if the specified bundle is null an array containing all actively exported packages by all bundles.
protected  org.osgi.service.packageadmin.ExportedPackage[] getExportedPackages(java.lang.String pkgName)
          Returns the exported packages associated with the specified package name.
 java.util.Dictionary getHeaders()
           
 java.util.Dictionary getHeaders(java.lang.String locale)
           
protected  org.osgi.framework.Bundle[] getImportingBundles(org.osgi.service.packageadmin.ExportedPackage ep)
           
protected  int getInitialBundleStartLevel()
          Returns the start level into which newly installed bundles will be placed by default; this method implements functionality for the Start Level service.
 long getLastModified()
           
 java.lang.String getLocation()
           
protected  java.lang.String getProperty(java.lang.String key)
          Implementation for BundleContext.getProperty().
 org.osgi.framework.ServiceReference[] getRegisteredServices()
           
 java.net.URL getResource(java.lang.String name)
           
 java.util.Enumeration getResources(java.lang.String name)
           
protected  java.lang.Object getService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceReference ref)
           
protected  org.osgi.framework.ServiceReference[] getServiceReferences(org.apache.felix.framework.FelixBundle bundle, java.lang.String className, java.lang.String expr, boolean checkAssignable)
          Retrieves an array of ServiceReference objects based on calling bundle, service class name, and filter expression.
 org.osgi.framework.ServiceReference[] getServicesInUse()
           
protected  int getStartLevel()
          Returns the active start level of the framework; this method implements functionality for the Start Level service.
 int getState()
           
 java.lang.String getSymbolicName()
           
 boolean hasPermission(java.lang.Object obj)
           
protected  org.osgi.framework.Bundle installBundle(java.lang.String location, java.io.InputStream is)
           
protected  boolean isBundlePersistentlyStarted(org.osgi.framework.Bundle bundle)
          Returns whether a bundle is persistently started; this is an method implementation for the Start Level service.
protected  java.lang.Class loadBundleClass(org.apache.felix.framework.FelixBundle bundle, java.lang.String name)
          Implementation for Bundle.loadClass().
 java.lang.Class loadClass(java.lang.String name)
           
protected  void refreshPackages(org.osgi.framework.Bundle[] targets)
           
protected  org.osgi.framework.ServiceRegistration registerService(org.apache.felix.framework.FelixBundle bundle, java.lang.String[] classNames, java.lang.Object svcObj, java.util.Dictionary dict)
          Implementation for BundleContext.registerService().
protected  void releaseBundleLock(org.apache.felix.framework.FelixBundle bundle)
           
protected  void releaseBundleLocks(org.apache.felix.framework.FelixBundle[] bundles)
           
protected  void releaseInstallLock(java.lang.String location)
           
protected  void removeBundleListener(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleListener l)
           
protected  void removeFrameworkListener(org.osgi.framework.Bundle bundle, org.osgi.framework.FrameworkListener l)
           
protected  void removeServiceListener(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceListener l)
          Implementation for BundleContext.removeServiceListener().
protected  boolean resolveBundles(org.osgi.framework.Bundle[] targets)
           
protected  void setBundleStartLevel(org.osgi.framework.Bundle bundle, int startLevel)
          Sets the start level of the specified bundle; this method implements functionality for the Start Level service.
protected  void setFrameworkStartLevel(int requestedLevel)
          Implements the functionality of the setStartLevel() method for the StartLevel service, but does not do the security or parameter check.
protected  void setInitialBundleStartLevel(int startLevel)
          Sets the default start level into which newly installed bundles will be placed; this method implements functionality for the Start Level service.
 void start()
           
protected  void startBundle(org.apache.felix.framework.FelixBundle bundle, boolean record)
          Implementation for Bundle.start().
 void stop()
          This method cleanly shuts down the framework, it must be called at the end of a session in order to shutdown all active bundles.
 void stopAndWait()
           
protected  void stopBundle(org.apache.felix.framework.FelixBundle bundle, boolean record)
           
 java.lang.String toString()
           
protected  boolean ungetService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceReference ref)
           
 void uninstall()
           
protected  void uninstallBundle(org.apache.felix.framework.FelixBundle bundle)
           
 void update()
           
 void update(java.io.InputStream is)
           
protected  void updateBundle(org.apache.felix.framework.FelixBundle bundle, java.io.InputStream is)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Felix

public Felix(java.util.Map configMutableMap,
             java.util.List activatorList)
Creates a new Felix framework instance with a default logger.

Parameters:
configMutableMap - An map for obtaining configuration properties, may be null.
activatorList - A list of System Bundle activators.
See Also:
Felix(Logger, Map, List)

Felix

public Felix(Logger logger,
             java.util.Map configMutableMap,
             java.util.List activatorList)

This method creates the framework instance; instances of the framework are not active until they are started. The constructor accepts a Map instance that will be used to obtain configuration or framework properties. Configuration properties are used internally by the framework and its extensions to alter its default behavior. Framework properties are used by bundles and are accessible from BundleContext.getProperty(). This map instance is used directly (i.e., it is not copied), which means that it is possible to change the property values externally at run time, but this is strongly discouraged for the framework's configuration properties.

Configuration properties are the sole means to configure the framework's default behavior; the framework does not refer to any system properties for configuration information. If a Map is supplied to this method for configuration properties, then the framework will consult the Map instance for any and all configuration properties. It is possible to specify a null for the configuration property map, in which case the framework will use its default behavior in all cases. However, if the DefaulBundleCache is used, then at a minimum a profile name or profile directory must be specified.

The following configuration properties can be specified:

Besides the above framework configuration properties, it is also possible to specify properties for the bundle cache. The available bundle cache properties depend on the cache implementation being used. For the properties of the default bundle cache, refer to the DefaulBundleCache API documentation.

The Main class implements some functionality for default property file handling, which makes it possible to specify configuration properties and framework properties in files that are automatically loaded when starting the framework. If you plan to create your own framework instance, you may be able to take advantage of the features it provides; refer to its class documentation for more information.

Parameters:
logger - The logger for use by the framework or null use the default logger.
configMutableMap - A map for obtaining configuration properties, may be null.
activatorList - A list of System Bundle activators.
Method Detail

getBundleContext

public org.osgi.framework.BundleContext getBundleContext()

getBundleId

public long getBundleId()

getEntry

public java.net.URL getEntry(java.lang.String name)

getEntryPaths

public java.util.Enumeration getEntryPaths(java.lang.String path)

findEntries

public java.util.Enumeration findEntries(java.lang.String path,
                                         java.lang.String filePattern,
                                         boolean recurse)

getHeaders

public java.util.Dictionary getHeaders()

getHeaders

public java.util.Dictionary getHeaders(java.lang.String locale)

getLastModified

public long getLastModified()

getLocation

public java.lang.String getLocation()

getResource

public java.net.URL getResource(java.lang.String name)

getResources

public java.util.Enumeration getResources(java.lang.String name)
                                   throws java.io.IOException
Throws:
java.io.IOException

getRegisteredServices

public org.osgi.framework.ServiceReference[] getRegisteredServices()

getServicesInUse

public org.osgi.framework.ServiceReference[] getServicesInUse()

getState

public int getState()

getSymbolicName

public java.lang.String getSymbolicName()

hasPermission

public boolean hasPermission(java.lang.Object obj)

loadClass

public java.lang.Class loadClass(java.lang.String name)
                          throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

start

public void start()
           throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

stop

public void stop()
          throws org.osgi.framework.BundleException
This method cleanly shuts down the framework, it must be called at the end of a session in order to shutdown all active bundles.

Throws:
org.osgi.framework.BundleException

stopAndWait

public void stopAndWait()

uninstall

public void uninstall()
               throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

update

public void update()
            throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

update

public void update(java.io.InputStream is)
            throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getStartLevel

protected int getStartLevel()
Returns the active start level of the framework; this method implements functionality for the Start Level service.

Returns:
The active start level of the framework.

setFrameworkStartLevel

protected void setFrameworkStartLevel(int requestedLevel)
Implements the functionality of the setStartLevel() method for the StartLevel service, but does not do the security or parameter check. The security and parameter check are done in the StartLevel service implementation because this method is called on a separate thread and the caller's thread would already be gone if we did the checks in this method. This method should not be called directly.

Parameters:
requestedLevel - The new start level of the framework.

getInitialBundleStartLevel

protected int getInitialBundleStartLevel()
Returns the start level into which newly installed bundles will be placed by default; this method implements functionality for the Start Level service.

Returns:
The default start level for newly installed bundles.

setInitialBundleStartLevel

protected void setInitialBundleStartLevel(int startLevel)
Sets the default start level into which newly installed bundles will be placed; this method implements functionality for the Start Level service.

Parameters:
startLevel - The new default start level for newly installed bundles.
Throws:
java.lang.IllegalArgumentException - If the specified start level is not greater than zero.
java.security.SecurityException - If the caller does not have AdminPermission.

getBundleStartLevel

protected int getBundleStartLevel(org.osgi.framework.Bundle bundle)
Returns the start level for the specified bundle; this method implements functionality for the Start Level service.

Parameters:
bundle - The bundle to examine.
Returns:
The start level of the specified bundle.
Throws:
java.lang.IllegalArgumentException - If the specified bundle has been uninstalled.

setBundleStartLevel

protected void setBundleStartLevel(org.osgi.framework.Bundle bundle,
                                   int startLevel)
Sets the start level of the specified bundle; this method implements functionality for the Start Level service.

Parameters:
bundle - The bundle whose start level is to be modified.
startLevel - The new start level of the specified bundle.
Throws:
java.lang.IllegalArgumentException - If the specified bundle is the system bundle or if the bundle has been uninstalled.
java.security.SecurityException - If the caller does not have AdminPermission.

isBundlePersistentlyStarted

protected boolean isBundlePersistentlyStarted(org.osgi.framework.Bundle bundle)
Returns whether a bundle is persistently started; this is an method implementation for the Start Level service.

Parameters:
bundle - The bundle to examine.
Returns:
true if the bundle is marked as persistently started, false otherwise.
Throws:
java.lang.IllegalArgumentException - If the specified bundle has been uninstalled.

getBundleSymbolicName

protected java.lang.String getBundleSymbolicName(org.apache.felix.framework.FelixBundle bundle)
Implementation for Bundle.getSymbolicName().


getBundleHeaders

protected java.util.Dictionary getBundleHeaders(org.apache.felix.framework.FelixBundle bundle,
                                                java.lang.String locale)
Get bundle headers and resolve any localized strings from resource bundles.

Parameters:
bundle -
locale -
Returns:
localized bundle headers dictionary.

getBundleLocation

protected java.lang.String getBundleLocation(org.apache.felix.framework.FelixBundle bundle)
Implementation for Bundle.getLocation().


getBundleResource

protected java.net.URL getBundleResource(org.apache.felix.framework.FelixBundle bundle,
                                         java.lang.String name)
Implementation for Bundle.getResource().


getBundleResources

protected java.util.Enumeration getBundleResources(org.apache.felix.framework.FelixBundle bundle,
                                                   java.lang.String name)
Implementation for Bundle.getResources().


getBundleEntry

protected java.net.URL getBundleEntry(org.apache.felix.framework.FelixBundle bundle,
                                      java.lang.String name)
Implementation for Bundle.getEntry().


getBundleEntryPaths

protected java.util.Enumeration getBundleEntryPaths(org.apache.felix.framework.FelixBundle bundle,
                                                    java.lang.String path)
Implementation for Bundle.getEntryPaths().


findBundleEntries

protected java.util.Enumeration findBundleEntries(org.apache.felix.framework.FelixBundle bundle,
                                                  java.lang.String path,
                                                  java.lang.String filePattern,
                                                  boolean recurse)
Implementation for findEntries().


getBundleRegisteredServices

protected org.osgi.framework.ServiceReference[] getBundleRegisteredServices(org.apache.felix.framework.FelixBundle bundle)

getBundleServicesInUse

protected org.osgi.framework.ServiceReference[] getBundleServicesInUse(org.osgi.framework.Bundle bundle)

bundleHasPermission

protected boolean bundleHasPermission(org.apache.felix.framework.FelixBundle bundle,
                                      java.lang.Object obj)

loadBundleClass

protected java.lang.Class loadBundleClass(org.apache.felix.framework.FelixBundle bundle,
                                          java.lang.String name)
                                   throws java.lang.ClassNotFoundException
Implementation for Bundle.loadClass().

Throws:
java.lang.ClassNotFoundException

startBundle

protected void startBundle(org.apache.felix.framework.FelixBundle bundle,
                           boolean record)
                    throws org.osgi.framework.BundleException
Implementation for Bundle.start().

Throws:
org.osgi.framework.BundleException

_resolveBundle

protected void _resolveBundle(org.apache.felix.framework.FelixBundle bundle)
                       throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

updateBundle

protected void updateBundle(org.apache.felix.framework.FelixBundle bundle,
                            java.io.InputStream is)
                     throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

_updateBundle

protected void _updateBundle(org.apache.felix.framework.FelixBundle bundle,
                             java.io.InputStream is)
                      throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

stopBundle

protected void stopBundle(org.apache.felix.framework.FelixBundle bundle,
                          boolean record)
                   throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

uninstallBundle

protected void uninstallBundle(org.apache.felix.framework.FelixBundle bundle)
                        throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

addRequirement

protected void addRequirement(org.apache.felix.framework.FelixBundle bundle,
                              java.lang.String s)
                       throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

getProperty

protected java.lang.String getProperty(java.lang.String key)
Implementation for BundleContext.getProperty(). Returns environment property associated with the framework.

Parameters:
key - The name of the property to retrieve.
Returns:
The value of the specified property or null.

installBundle

protected org.osgi.framework.Bundle installBundle(java.lang.String location,
                                                  java.io.InputStream is)
                                           throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

getBundle

protected org.osgi.framework.Bundle getBundle(java.lang.String location)
Retrieves a bundle from its location.

Parameters:
location - The location of the bundle to retrieve.
Returns:
The bundle associated with the location or null if there is no bundle associated with the location.

getBundle

protected org.osgi.framework.Bundle getBundle(long id)
Implementation for BundleContext.getBundle(). Retrieves a bundle from its identifier.

Parameters:
id - The identifier of the bundle to retrieve.
Returns:
The bundle associated with the identifier or null if there is no bundle associated with the identifier.

getBundles

protected org.osgi.framework.Bundle[] getBundles()
Implementation for BundleContext.getBundles(). Retrieves all installed bundles.

Returns:
An array containing all installed bundles or null if there are no installed bundles.

addBundleListener

protected void addBundleListener(org.osgi.framework.Bundle bundle,
                                 org.osgi.framework.BundleListener l)

removeBundleListener

protected void removeBundleListener(org.osgi.framework.Bundle bundle,
                                    org.osgi.framework.BundleListener l)

addServiceListener

protected void addServiceListener(org.osgi.framework.Bundle bundle,
                                  org.osgi.framework.ServiceListener l,
                                  java.lang.String f)
                           throws org.osgi.framework.InvalidSyntaxException
Implementation for BundleContext.addServiceListener(). Adds service listener to the listener list so that is can listen for ServiceEvents.

Parameters:
bundle - The bundle that registered the listener.
l - The service listener to add to the listener list.
f - The filter for the listener; may be null.
Throws:
org.osgi.framework.InvalidSyntaxException

removeServiceListener

protected void removeServiceListener(org.osgi.framework.Bundle bundle,
                                     org.osgi.framework.ServiceListener l)
Implementation for BundleContext.removeServiceListener(). Removes service listeners from the listener list.

Parameters:
bundle - The context bundle of the listener
l - The service listener to remove from the listener list.

addFrameworkListener

protected void addFrameworkListener(org.osgi.framework.Bundle bundle,
                                    org.osgi.framework.FrameworkListener l)

removeFrameworkListener

protected void removeFrameworkListener(org.osgi.framework.Bundle bundle,
                                       org.osgi.framework.FrameworkListener l)

registerService

protected org.osgi.framework.ServiceRegistration registerService(org.apache.felix.framework.FelixBundle bundle,
                                                                 java.lang.String[] classNames,
                                                                 java.lang.Object svcObj,
                                                                 java.util.Dictionary dict)
Implementation for BundleContext.registerService(). Registers a service for the specified bundle bundle.

Parameters:
classNames - A string array containing the names of the classes under which the new service is available.
svcObj - The service object or ServiceFactory.
dict - A dictionary of properties that further describe the service or null.
Returns:
A ServiceRegistration object or null.

getServiceReferences

protected org.osgi.framework.ServiceReference[] getServiceReferences(org.apache.felix.framework.FelixBundle bundle,
                                                                     java.lang.String className,
                                                                     java.lang.String expr,
                                                                     boolean checkAssignable)
                                                              throws org.osgi.framework.InvalidSyntaxException
Retrieves an array of ServiceReference objects based on calling bundle, service class name, and filter expression. Optionally checks for isAssignable to make sure that the service can be cast to the

Parameters:
bundle - Calling Bundle
className - Service Classname or null for all
expr - Filter Criteria or null
Returns:
Array of ServiceReference objects that meet the criteria
Throws:
org.osgi.framework.InvalidSyntaxException

getAllowedServiceReferences

protected org.osgi.framework.ServiceReference[] getAllowedServiceReferences(org.apache.felix.framework.FelixBundle bundle,
                                                                            java.lang.String className,
                                                                            java.lang.String expr,
                                                                            boolean checkAssignable)
                                                                     throws org.osgi.framework.InvalidSyntaxException
Retrieves Array of ServiceReference objects based on calling bundle, service class name, optional filter expression, and optionally filters further on the version. If running under a SecurityManager, checks that the calling bundle has permissions to see the service references and removes references that aren't.

Parameters:
bundle - Calling Bundle
className - Service Classname or null for all
expr - Filter Criteria or null
checkAssignable - true to check for isAssignable, false to return all versions
Returns:
Array of ServiceReference objects that meet the criteria
Throws:
org.osgi.framework.InvalidSyntaxException

getService

protected java.lang.Object getService(org.osgi.framework.Bundle bundle,
                                      org.osgi.framework.ServiceReference ref)

ungetService

protected boolean ungetService(org.osgi.framework.Bundle bundle,
                               org.osgi.framework.ServiceReference ref)

getDataFile

protected java.io.File getDataFile(org.apache.felix.framework.FelixBundle bundle,
                                   java.lang.String s)

getBundle

protected org.osgi.framework.Bundle getBundle(java.lang.Class clazz)
This method returns the bundle associated with the specified class if the class was loaded from a bundle from this framework instance. If the class was not loaded from a bundle or was loaded by a bundle in another framework instance, then null is returned.

Parameters:
clazz - the class for which to find its associated bundle.
Returns:
the bundle associated with the specified class or null if the class was not loaded by a bundle or its associated bundle belongs to a different framework instance.

getExportedPackages

protected org.osgi.service.packageadmin.ExportedPackage[] getExportedPackages(java.lang.String pkgName)
Returns the exported packages associated with the specified package name. This is used by the PackageAdmin service implementation.

Parameters:
pkgName - The name of the exported package to find.
Returns:
The exported package or null if no matching package was found.

getExportedPackages

protected org.osgi.service.packageadmin.ExportedPackage[] getExportedPackages(org.osgi.framework.Bundle b)
Returns an array of all actively exported packages from the specified bundle or if the specified bundle is null an array containing all actively exported packages by all bundles.

Parameters:
b - The bundle whose exported packages are to be retrieved or null if the exported packages of all bundles are to be retrieved.
Returns:
An array of exported packages.

getDependentBundles

protected org.osgi.framework.Bundle[] getDependentBundles(org.apache.felix.framework.FelixBundle exporter)

getImportingBundles

protected org.osgi.framework.Bundle[] getImportingBundles(org.osgi.service.packageadmin.ExportedPackage ep)

resolveBundles

protected boolean resolveBundles(org.osgi.framework.Bundle[] targets)

refreshPackages

protected void refreshPackages(org.osgi.framework.Bundle[] targets)

acquireInstallLock

protected void acquireInstallLock(java.lang.String location)
                           throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

releaseInstallLock

protected void releaseInstallLock(java.lang.String location)

acquireBundleLock

protected void acquireBundleLock(org.apache.felix.framework.FelixBundle bundle)

acquireBundleLockOrFail

protected boolean acquireBundleLockOrFail(org.apache.felix.framework.FelixBundle bundle)

releaseBundleLock

protected void releaseBundleLock(org.apache.felix.framework.FelixBundle bundle)

acquireBundleResolveLocks

protected org.apache.felix.framework.FelixBundle[] acquireBundleResolveLocks(org.osgi.framework.Bundle[] targets)

acquireBundleRefreshLocks

protected org.apache.felix.framework.FelixBundle[] acquireBundleRefreshLocks(org.osgi.framework.Bundle[] targets)

releaseBundleLocks

protected void releaseBundleLocks(org.apache.felix.framework.FelixBundle[] bundles)