org.jboss.osgi.spi.framework
Class MicrocontainerBootstrapProvider

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

public class MicrocontainerBootstrapProvider
extends java.lang.Object
implements OSGiBootstrapProvider

Bootstrap the OSGiFramework through the MC

   <deployment xmlns="urn:jboss:bean-deployer:2.0" ...>
    
      <!-- The OSGiFramework -->
      <bean name="jboss.osgi:service=Framework" class="org.jboss.osgi.felix.framework.FelixIntegration">
       <property name="felixProperties">
        <map keyClass="java.lang.String" valueClass="java.lang.String">
         <entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
         <entry>
           <key>org.osgi.framework.system.packages</key>
           <value>
             org.osgi.framework; version=1.4,
             org.osgi.util.tracker
           </value>
         </entry>
        </map>
       </property>
      </bean>
      ...
    </deployment>
 

Since:
18-Jun-2008
Author:
thomas.diesler@jboss.com

Field Summary
static java.lang.String DEFAULT_OSGI_BOOTSTRAP_XML
          The default framework beans: jboss-osgi-bootstrap-beans.xml
static java.lang.String DEFAULT_OSGI_FRAMEWORK_XML
          The default framework beans: jboss-osgi-beans.xml
static java.lang.String OSGI_BOOTSTRAP_BEANS
          The default framework beans property: jboss.osgi.bootstrap.beans
static java.lang.String OSGI_FRAMEWORK_BEANS
          The default framework beans property: jboss.osgi.framework.beans
 
Fields inherited from interface org.jboss.osgi.spi.framework.OSGiBootstrapProvider
DEFAULT_FRAMEWORK_NAME
 
Constructor Summary
MicrocontainerBootstrapProvider()
           
 
Method Summary
 void configure()
          Configure this provider with the default configuration
 void configure(java.io.InputStream streamConfig)
          Configure this provider from a given input stream
 void configure(java.lang.String resourceConfig)
          Configure this provider from a given resource
 void configure(java.net.URL urlConfig)
          Configure this provider from the given URL
 OSGiFramework getFramework()
          Get the OSGiFramework that registerd with the default name
 OSGiFramework getFramework(java.lang.String beanName)
          Get an OSGiFramework with a given name from this OSGiBootstrapProvider
 java.lang.Object getInstance(java.lang.String name)
          Get a named instance
<T> T
getInstance(java.lang.String name, java.lang.Class<T> expectedType)
          Get a named instance for a given type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OSGI_BOOTSTRAP_BEANS

public static final java.lang.String OSGI_BOOTSTRAP_BEANS
The default framework beans property: jboss.osgi.bootstrap.beans

See Also:
Constant Field Values

DEFAULT_OSGI_BOOTSTRAP_XML

public static final java.lang.String DEFAULT_OSGI_BOOTSTRAP_XML
The default framework beans: jboss-osgi-bootstrap-beans.xml

See Also:
Constant Field Values

OSGI_FRAMEWORK_BEANS

public static final java.lang.String OSGI_FRAMEWORK_BEANS
The default framework beans property: jboss.osgi.framework.beans

See Also:
Constant Field Values

DEFAULT_OSGI_FRAMEWORK_XML

public static final java.lang.String DEFAULT_OSGI_FRAMEWORK_XML
The default framework beans: jboss-osgi-beans.xml

See Also:
Constant Field Values
Constructor Detail

MicrocontainerBootstrapProvider

public MicrocontainerBootstrapProvider()
Method Detail

getFramework

public OSGiFramework getFramework()
Description copied from interface: OSGiBootstrapProvider
Get the OSGiFramework that registerd with the default name

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

getFramework

public OSGiFramework getFramework(java.lang.String beanName)
Description copied from interface: OSGiBootstrapProvider
Get an OSGiFramework with a given name from this OSGiBootstrapProvider

Specified by:
getFramework in interface OSGiBootstrapProvider
Parameters:
beanName - the framework name
Returns:
The configured instance of a Framework, or null

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(java.io.InputStream streamConfig)
Description copied from interface: OSGiBootstrapProvider
Configure this provider from a given input stream

Specified by:
configure in interface OSGiBootstrapProvider

configure

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

Specified by:
configure in interface OSGiBootstrapProvider

configure

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

Specified by:
configure in interface OSGiBootstrapProvider

getInstance

public java.lang.Object getInstance(java.lang.String name)
Description copied from interface: NamedInstanceProvider
Get a named instance

Specified by:
getInstance in interface NamedInstanceProvider
Parameters:
name - the attribute name
Returns:
attribute

getInstance

public <T> T getInstance(java.lang.String name,
                         java.lang.Class<T> expectedType)
Description copied from interface: NamedInstanceProvider
Get a named instance for a given type

Specified by:
getInstance in interface NamedInstanceProvider
Type Parameters:
T - exact attribute type
Parameters:
name - the attribute name
expectedType - the expected type
Returns:
attribute


Copyright © 2009. All Rights Reserved.