org.jboss.osgi.testing
Interface OSGiBundle


public interface OSGiBundle

An abstraction of an OSGi Bundle.

Since:
25-Sep-2008
Author:
Thomas.Diesler@jboss.org

Method Summary
 long getBundleId()
          Returns this bundle's unique identifier.
 File getDataFile(String filename)
          Creates a File object for a file in the persistent storage area provided for the bundle by the Framework.
 URL getEntry(String path)
          Returns a URL to the entry at the specified path in this bundle.
 Dictionary<String,String> getHeaders()
          Returns this bundle's Manifest headers and values.
 Dictionary<String,String> getHeaders(String locale)
          Returns this bundle's Manifest headers and values localized to the specified locale.
 String getLocation()
          Returns this bundle's location.
 String getProperty(String key)
          Returns the value of the specified property.
 URL getResource(String name)
          Find the specified resource from this bundle's class loader.
 OSGiRuntime getRuntime()
          Get the runtime associated with this bundle.
 int getState()
          Returns this bundle's current state.
 String getSymbolicName()
          Returns the symbolic name of this bundle as specified by its Bundle-SymbolicName manifest header.
 Version getVersion()
          Returns the version of this bundle.
 OSGiBundle loadClass(String name)
          Loads the specified class using this bundle's class loader.
 void start()
          Starts this bundle.
 void stop()
          Stops this bundle.
 void uninstall()
          Uninstalls this bundle.
 

Method Detail

getRuntime

OSGiRuntime getRuntime()
Get the runtime associated with this bundle.


getBundleId

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


getSymbolicName

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


getVersion

Version getVersion()
Returns the version of this bundle.


getLocation

String getLocation()
Returns this bundle's location.


getHeaders

Dictionary<String,String> getHeaders()
Returns this bundle's Manifest headers and values.


getHeaders

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


getState

int getState()
Returns this bundle's current state.


getProperty

String getProperty(String key)
Returns the value of the specified property.


getDataFile

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


loadClass

OSGiBundle loadClass(String name)
                     throws ClassNotFoundException
Loads the specified class using this bundle's class loader.

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

getEntry

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

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

getResource

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

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

start

void start()
           throws BundleException
Starts this bundle.

Throws:
BundleException

stop

void stop()
          throws BundleException
Stops this bundle.

Throws:
BundleException

uninstall

void uninstall()
               throws BundleException
Uninstalls this bundle.

Throws:
BundleException


Copyright © 2010. All Rights Reserved.