com.caucho.loader.osgi
Class OsgiBundle

java.lang.Object
  extended by com.caucho.loader.osgi.OsgiBundle
Direct Known Subclasses:
OsgiSystemBundle

public class OsgiBundle
extends java.lang.Object

An osgi-bundle


Method Summary
 java.util.Enumeration findEntries(java.lang.String path, java.lang.String filePattern, boolean recurse)
          Returns entries matching a pattern.
 BundleContext getBundleContext()
          Returns the bundle's context
 long getBundleId()
          Returns the bundle's unique id
 java.net.URL getEntry(java.lang.String path)
          Returns a URL to the named entry
 java.util.Enumeration getEntryPaths(java.lang.String path)
          Returns the paths to entries in the bundle
 java.util.Dictionary getHeaders()
          Returns the Manifest headers
 java.util.Dictionary getHeaders(java.lang.String locale)
          Returns the localized view of the manifest
 long getLastModified()
          Returns the last modified time of the bundle.
 java.lang.String getLocation()
          Returns the location
 ServiceReference[] getRegisteredServices()
          Returns the bundle's registered services
 java.net.URL getResource(java.lang.String name)
          Returns the specified resource from the bundle
 java.util.Enumeration getResources(java.lang.String name)
          Returns the resources for the bundle
 ServiceReference[] getServicesInUse()
          Returns the services the bundle is using
 int getState()
          Returns the bundle's current state
 java.lang.String getSymbolicName()
          Returns the bundle's symbolic name
 boolean hasPermission(java.lang.Object permission)
          Returns true if the bundle has the specified permission
 java.lang.Class loadClass(java.lang.String name)
          Loads a class using the bundle's classloader
 void start()
          Start the bundle
 void start(int options)
          Start the bundle
 void stop()
          Start the bundle
 void stop(int options)
          Stop the bundle
 java.lang.String toString()
           
 void uninstall()
          Uninstall the bundle
 void update()
          Updates the bundle
 void update(java.io.InputStream is)
          Updates the bundle from an input stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getBundleId

public long getBundleId()
Returns the bundle's unique id


getSymbolicName

public java.lang.String getSymbolicName()
Returns the bundle's symbolic name


getLocation

public java.lang.String getLocation()
Returns the location


getState

public int getState()
Returns the bundle's current state


start

public void start(int options)
           throws BundleException
Start the bundle

Throws:
BundleException

start

public void start()
           throws BundleException
Start the bundle

Throws:
BundleException

stop

public void stop(int options)
          throws BundleException
Stop the bundle

Throws:
BundleException

stop

public void stop()
          throws BundleException
Start the bundle

Throws:
BundleException

update

public void update()
            throws BundleException
Updates the bundle

Throws:
BundleException

update

public void update(java.io.InputStream is)
            throws BundleException
Updates the bundle from an input stream

Throws:
BundleException

uninstall

public void uninstall()
               throws BundleException
Uninstall the bundle

Throws:
BundleException

getHeaders

public java.util.Dictionary getHeaders()
Returns the Manifest headers


getRegisteredServices

public ServiceReference[] getRegisteredServices()
Returns the bundle's registered services


getServicesInUse

public ServiceReference[] getServicesInUse()
Returns the services the bundle is using


hasPermission

public boolean hasPermission(java.lang.Object permission)
Returns true if the bundle has the specified permission


getResource

public java.net.URL getResource(java.lang.String name)
Returns the specified resource from the bundle


getHeaders

public java.util.Dictionary getHeaders(java.lang.String locale)
Returns the localized view of the manifest


loadClass

public java.lang.Class loadClass(java.lang.String name)
                          throws java.lang.ClassNotFoundException
Loads a class using the bundle's classloader

Throws:
java.lang.ClassNotFoundException

getResources

public java.util.Enumeration getResources(java.lang.String name)
                                   throws java.io.IOException
Returns the resources for the bundle

Throws:
java.io.IOException

getEntryPaths

public java.util.Enumeration getEntryPaths(java.lang.String path)
Returns the paths to entries in the bundle


getEntry

public java.net.URL getEntry(java.lang.String path)
Returns a URL to the named entry


getLastModified

public long getLastModified()
Returns the last modified time of the bundle.


findEntries

public java.util.Enumeration findEntries(java.lang.String path,
                                         java.lang.String filePattern,
                                         boolean recurse)
Returns entries matching a pattern.


getBundleContext

public BundleContext getBundleContext()
Returns the bundle's context


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object