org.jboss.osgi.spi.management
Interface ManagedBundleMBean

All Known Implementing Classes:
ManagedBundle

public interface ManagedBundleMBean

The managed view of an OSGi Bundle. Bundles are registered under the name jboss.osgi:name=[SymbolicName],id=[BundleId],version=[BundleVersion]

Since:
04-Mar-2009
Author:
thomas.diesler@jboss.com

Method Summary
 long getBundleId()
          Returns this bundle's unique identifier.
 java.io.File getDataFile(java.lang.String filename)
          Creates a File object for a file in the persistent storage area provided for the bundle by the Framework.
 java.lang.String getEntry(java.lang.String path)
          Returns a string encoded URL to the entry at the specified path in this bundle.
 java.util.Dictionary<java.lang.String,java.lang.String> getHeaders()
          Returns the bundle manifest headers
 java.util.Dictionary<java.lang.String,java.lang.String> getHeaders(java.lang.String locale)
          Returns this bundle's Manifest headers and values localized to the specified locale.
 java.lang.String getLocation()
          Returns the location of this bundle
 javax.management.ObjectName getObjectName()
          Get the bundles object name.
 java.lang.String getProperty(java.lang.String key)
          Returns the value of the specified property from the BundleContext.
 java.lang.String getResource(java.lang.String name)
          Find the specified resource from this bundle's class loader.
 int getState()
          Returns this bundle's current state.
 java.lang.String getSymbolicName()
          Returns the symbolic name of this bundle as specified by its Bundle-SymbolicName manifest header
 javax.management.ObjectName loadClass(java.lang.String name)
          Loads the specified class using this bundle's class loader.
 void start()
          Starts this bundle with no options
 void stop()
          Stops this bundle with no options.
 void update()
          Update this bundle.
 

Method Detail

getObjectName

javax.management.ObjectName getObjectName()
Get the bundles object name.


getState

int getState()
Returns this bundle's current state. A bundle can be in only one state at any time.

Returns:
An element of UNINSTALLED,INSTALLED, RESOLVED,STARTING, STOPPING,ACTIVE.

getBundleId

long getBundleId()
Returns this bundle's unique identifier.


getSymbolicName

java.lang.String getSymbolicName()
Returns the symbolic name of this bundle as specified by its Bundle-SymbolicName manifest header


getLocation

java.lang.String getLocation()
Returns the location of this bundle


getHeaders

java.util.Dictionary<java.lang.String,java.lang.String> getHeaders()
Returns the bundle manifest headers


getHeaders

java.util.Dictionary<java.lang.String,java.lang.String> getHeaders(java.lang.String locale)
Returns this bundle's Manifest headers and values localized to the specified locale.


getProperty

java.lang.String getProperty(java.lang.String key)
Returns the value of the specified property from the BundleContext.


loadClass

javax.management.ObjectName loadClass(java.lang.String name)
                                      throws java.lang.ClassNotFoundException
Loads the specified class using this bundle's class loader.

Parameters:
name - The name of the class to load
Returns:
The object name of the bundle that is wired to this bundle class loader and contains the class.
Throws:
java.lang.ClassNotFoundException - If no such class can be found or if this bundle is a fragment bundle

getEntry

java.lang.String getEntry(java.lang.String path)
Returns a string encoded URL to the entry at the specified path in this bundle.

Parameters:
name - The path name of the entry
Returns:
A URL to the entry, or null if no entry could be found

getResource

java.lang.String getResource(java.lang.String name)
Find the specified resource from this bundle's class loader.

Parameters:
name - The name of the resource.
Returns:
A string encoded URL to the named resource, or null if the resource could not be found

getDataFile

java.io.File getDataFile(java.lang.String filename)
Creates a File object for a file in the persistent storage area provided for the bundle by the Framework.


start

void start()
           throws org.osgi.framework.BundleException
Starts this bundle with no options

Throws:
org.osgi.framework.BundleException

stop

void stop()
          throws org.osgi.framework.BundleException
Stops this bundle with no options.

Throws:
org.osgi.framework.BundleException

update

void update()
            throws org.osgi.framework.BundleException
Update this bundle.

Throws:
org.osgi.framework.BundleException


Copyright © 2010. All Rights Reserved.