org.jboss.osgi.spi.framework
Class PropertiesBootstrapProvider

java.lang.Object
  extended by org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
All Implemented Interfaces:
OSGiBootstrapProvider

public class PropertiesBootstrapProvider
extends Object
implements OSGiBootstrapProvider

A simple properties based bootstrap provider The PropertiesBootstrapProvider supports the following properties

All other properties are passed on to configure the framework.
    # Properties to configure the Framework
    org.osgi.framework.storage.clean=onFirstInit
    org.osgi.framework.system.packages=\
       org.osgi.framework; version=1.4, \
       javax.management
    
    # Bundles that need to be installed with the Framework automatically 
    org.jboss.osgi.framework.autoInstall=\
       file://${test.archive.directory}/bundles/org.osgi.compendium.jar
    
    # Bundles that need to be started automatically 
    org.jboss.osgi.framework.autoStart=\
       file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
       file://${test.archive.directory}/bundles/jboss-osgi-common.jar \
 

Since:
24-Apr-2009
Author:
thomas.diesler@jboss.com

Field Summary
static String DEFAULT_OSGI_FRAMEWORK_PROPERTIES
          The default framework config: jboss-osgi-framework.properties
static String OSGI_FRAMEWORK_CONFIG
          The default framework property: jboss.osgi.framework.properties
static String PROP_OSGI_FRAMEWORK_AUTO_INSTALL
          Optional list of bundles that get installed automatically: org.jboss.osgi.framework.autoInstall
static String PROP_OSGI_FRAMEWORK_AUTO_START
          Optional list of bundles that get started automatically: org.jboss.osgi.framework.autoStart
static String PROP_OSGI_FRAMEWORK_EXTRA
          Optional path to extra properties: org.jboss.osgi.framework.extra
 
Constructor Summary
PropertiesBootstrapProvider()
           
 
Method Summary
 void configure()
          Configure this provider with the default configuration
 void configure(InputStream streamConfig)
          Configure this provider from a given input stream
 void configure(String resourceConfig)
          Configure this provider from a given resource
 void configure(URL urlConfig)
          Configure this provider from the given URL
protected  org.osgi.framework.launch.Framework createFramework(Map<String,Object> properties)
          Overwrite to create the framework
 org.osgi.framework.launch.Framework getFramework()
          Get the configured OSGi Framework
protected  void registerSystemServices(org.osgi.framework.BundleContext context)
          Overwrite to register system services before bundles get installed.
protected  void unregisterSystemServices(org.osgi.framework.BundleContext context)
          Overwrite to unregister system services before bundles get installed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OSGI_FRAMEWORK_CONFIG

public static final String OSGI_FRAMEWORK_CONFIG
The default framework property: jboss.osgi.framework.properties

See Also:
Constant Field Values

DEFAULT_OSGI_FRAMEWORK_PROPERTIES

public static final String DEFAULT_OSGI_FRAMEWORK_PROPERTIES
The default framework config: jboss-osgi-framework.properties

See Also:
Constant Field Values

PROP_OSGI_FRAMEWORK_AUTO_INSTALL

public static final String PROP_OSGI_FRAMEWORK_AUTO_INSTALL
Optional list of bundles that get installed automatically: org.jboss.osgi.framework.autoInstall

See Also:
Constant Field Values

PROP_OSGI_FRAMEWORK_AUTO_START

public static final String PROP_OSGI_FRAMEWORK_AUTO_START
Optional list of bundles that get started automatically: org.jboss.osgi.framework.autoStart

See Also:
Constant Field Values

PROP_OSGI_FRAMEWORK_EXTRA

public static final String PROP_OSGI_FRAMEWORK_EXTRA
Optional path to extra properties: org.jboss.osgi.framework.extra

See Also:
Constant Field Values
Constructor Detail

PropertiesBootstrapProvider

public PropertiesBootstrapProvider()
Method Detail

configure

public void configure()
Description copied from interface: OSGiBootstrapProvider
Configure this provider with the default configuration

Specified by:
configure in interface OSGiBootstrapProvider

configure

public void configure(String resourceConfig)
Description copied from interface: OSGiBootstrapProvider
Configure this provider from a given resource

Specified by:
configure in interface OSGiBootstrapProvider

configure

public void configure(URL urlConfig)
Description copied from interface: OSGiBootstrapProvider
Configure this provider from the given URL

Specified by:
configure in interface OSGiBootstrapProvider

configure

public void configure(InputStream streamConfig)
Description copied from interface: OSGiBootstrapProvider
Configure this provider from a given input stream

Specified by:
configure in interface OSGiBootstrapProvider

createFramework

protected org.osgi.framework.launch.Framework createFramework(Map<String,Object> properties)
Overwrite to create the framework


registerSystemServices

protected void registerSystemServices(org.osgi.framework.BundleContext context)
Overwrite to register system services before bundles get installed.


unregisterSystemServices

protected void unregisterSystemServices(org.osgi.framework.BundleContext context)
Overwrite to unregister system services before bundles get installed.


getFramework

public org.osgi.framework.launch.Framework getFramework()
Description copied from interface: OSGiBootstrapProvider
Get the configured OSGi Framework

Specified by:
getFramework in interface OSGiBootstrapProvider
Returns:
The configured instance of a Framework


Copyright © 2012. All Rights Reserved.