org.jboss.osgi.framework
Interface BundleManager

All Superinterfaces:
org.jboss.msc.service.Service<BundleManager>, org.jboss.msc.value.Value<BundleManager>

public interface BundleManager
extends org.jboss.msc.service.Service<BundleManager>

Integration point for Bundle management.

Since:
24-Mar-2011
Author:
thomas.diesler@jboss.com

Field Summary
 
Fields inherited from interface org.jboss.msc.service.Service
NULL, NULL_VALUE
 
Method Summary
 Bundle getBundleById(long bundleId)
          Get a bundle by id Note, this will get the bundle regadless of its state.
 Bundle getBundleByLocation(String location)
          Get a bundle by location
 Set<Bundle> getBundles(Integer states)
          Get the set of bundles that are in one of the given states.
 Set<Bundle> getBundles(String symbolicName, String versionRange)
          Get the set of bundles with the given symbolic name and version Note, this will get bundles regadless of their state.
 Map<String,Object> getProperties()
          Returns the framework properties merged with the System properties.
 Object getProperty(String key)
          Get a framework property
 org.jboss.msc.service.ServiceContainer getServiceContainer()
          Get the service container
 Bundle getSystemBundle()
          Get the system bundle
 org.jboss.msc.service.ServiceName installBundle(Deployment deployment, org.jboss.msc.service.ServiceListener<Bundle> listener)
          Install a bundle from the given deployment
 boolean isFrameworkActive()
          True the framework has reached the Services.FRAMEWORK_ACTIVE state
 void uninstallBundle(Deployment dep)
          Uninstall the given deployment
 
Methods inherited from interface org.jboss.msc.service.Service
start, stop
 
Methods inherited from interface org.jboss.msc.value.Value
getValue
 

Method Detail

getBundleById

Bundle getBundleById(long bundleId)
Get a bundle by id Note, this will get the bundle regadless of its state. i.e. The returned bundle may have been UNINSTALLED

Parameters:
bundleId - The identifier of the bundle
Returns:
The bundle or null if there is no bundle with that id

getBundleByLocation

Bundle getBundleByLocation(String location)
Get a bundle by location

Parameters:
location - the location of the bundle
Returns:
the bundle or null if there is no bundle with that location

getBundles

Set<Bundle> getBundles(Integer states)
Get the set of bundles that are in one of the given states. If the states pattern is null, it returns all registered bundles.

Parameters:
states - The binary or combination of states or null

getBundles

Set<Bundle> getBundles(String symbolicName,
                       String versionRange)
Get the set of bundles with the given symbolic name and version Note, this will get bundles regadless of their state. i.e. The returned bundles may have been UNINSTALLED

Parameters:
symbolicName - The bundle symbolic name
versionRange - The optional bundle version
Returns:
The bundles or an empty list if there is no bundle with that name and version

getSystemBundle

Bundle getSystemBundle()
Get the system bundle

Returns:
the system bundle or null if the framework has not reached the Services.SYSTEM_BUNDLE state

isFrameworkActive

boolean isFrameworkActive()
True the framework has reached the Services.FRAMEWORK_ACTIVE state


installBundle

org.jboss.msc.service.ServiceName installBundle(Deployment deployment,
                                                org.jboss.msc.service.ServiceListener<Bundle> listener)
                                                throws BundleException
Install a bundle from the given deployment

Parameters:
deployment - The bundle deployment
listener - An optional listener on the INSTALL service
Returns:
The name of the INSTALL service
Throws:
BundleException

uninstallBundle

void uninstallBundle(Deployment dep)
Uninstall the given deployment


getServiceContainer

org.jboss.msc.service.ServiceContainer getServiceContainer()
Get the service container


getProperties

Map<String,Object> getProperties()
Returns the framework properties merged with the System properties.

Returns:
The effective framework properties in a map

getProperty

Object getProperty(String key)
Get a framework property

Returns:
The properties value or the given default


Copyright © 2012. All Rights Reserved.