bactivator, bundleContext, bundleDir, generations, operationACTIVE, INSTALLED, RESOLVED, SIGNERS_ALL, SIGNERS_TRUSTED, START_ACTIVATION_POLICY, START_TRANSIENT, STARTING, STOP_TRANSIENT, STOPPING, UNINSTALLED| Modifier and Type | Method and Description |
|---|---|
<A> A |
adapt(java.lang.Class<A> type)
Adapt this bundle to the specified type.
|
java.util.Enumeration<java.net.URL> |
findEntries(java.lang.String path,
java.lang.String filePattern,
boolean recurse)
Get bundle data.
|
java.net.URL |
getEntry(java.lang.String name)
Returns a URL to the entry at the specified path in this bundle.
|
java.util.Enumeration<java.lang.String> |
getEntryPaths(java.lang.String path)
Returns an Enumeration of all the paths (
String objects) to
entries within this bundle whose longest sub-path matches the specified
path. |
java.util.Dictionary<java.lang.String,java.lang.String> |
getHeaders()
Get header data.
|
java.util.Dictionary<java.lang.String,java.lang.String> |
getHeaders(java.lang.String locale)
Get header data.
|
boolean |
hasPermission(java.lang.Object permission)
The system has all the permissions.
|
void |
init()
Initialize this framework.
|
void |
init(FrameworkListener... listeners)
Initialize this framework and call listeners.
|
void |
start(int options)
Start this framework.
|
void |
stop(int options)
Stop this framework.
|
void |
uninstall()
Uninstall of framework are not allowed.
|
void |
update(java.io.InputStream in)
Restart this framework.
|
FrameworkEvent |
waitForStop(long timeout)
Wait until this Framework has completely stopped.
|
compareTo, getBundleContext, getBundleId, getDataFile, getLastModified, getLocation, getRegisteredServices, getResource, getResources, getServicesInUse, getSignerCertificates, getState, getSymbolicName, getVersion, loadClass, start, stop, toString, updateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetBundleId, getLastModified, getLocation, getSymbolicName, start, stop, updategetBundleContext, getDataFile, getRegisteredServices, getResource, getResources, getServicesInUse, getSignerCertificates, getState, getVersion, loadClasspublic void init()
throws BundleException
init in interface FrameworkBundleException - If this Framework could not be initialized.Framework.init()public void init(FrameworkListener... listeners) throws BundleException
init in interface Frameworklisteners - Zero or more listeners to be notified when framework
events occur while initializing the framework. The specified
listeners do not need to be otherwise registered with the
framework. If a specified listener is registered with the
framework, it will be notified twice for each framework event.BundleException - If this Framework could not be initialized.Framework.init(FrameworkListener...)public void start(int options)
throws BundleException
start in interface Bundlestart in interface Frameworkstart in class BundleImploptions - The options for starting this bundle. See
Bundle.START_TRANSIENT and Bundle.START_ACTIVATION_POLICY. The
Framework must ignore unrecognized options.BundleException - If this bundle could not be started.
BundleException types thrown by this method include:
BundleException.START_TRANSIENT_ERROR,
BundleException.NATIVECODE_ERROR,
BundleException.RESOLVE_ERROR,
BundleException.STATECHANGE_ERROR, and
BundleException.ACTIVATOR_ERROR.org.osgi.framework.Framework#startpublic FrameworkEvent waitForStop(long timeout) throws java.lang.InterruptedException
Frameworkstop and
update methods on a Framework performs an asynchronous stop of
the Framework. This method can be used to wait until the asynchronous
stop of this Framework has completed. This method will only wait if
called when this Framework is in the Bundle.STARTING, Bundle.ACTIVE,
or Bundle.STOPPING states. Otherwise it will return immediately.
A Framework Event is returned to indicate why this Framework has stopped.
waitForStop in interface Frameworktimeout - Maximum number of milliseconds to wait until this
Framework has completely stopped. A value of zero will wait
indefinitely.FrameworkEvent types may be returned by this
method.
STOPPED - This Framework has
been stopped. STOPPED_UPDATE - This
Framework has been updated which has shutdown and will now
restart.STOPPED_BOOTCLASSPATH_MODIFIED - This Framework has been stopped
and a bootclasspath extension bundle has been installed or
updated. The VM must be restarted in order for the changed boot
class path to take effect. ERROR - The Framework
encountered an error while shutting down or an error has occurred
which forced the framework to shutdown. WAIT_TIMEDOUT - This
method has timed out and returned before this Framework has
stopped.java.lang.InterruptedException - If another thread interrupted the current
thread before or while the current thread was waiting for this
Framework to completely stop. The interrupted status of
the current thread is cleared when this exception is thrown.public void stop(int options)
throws BundleException
stop in interface Bundlestop in interface Frameworkstop in class BundleImploptions - The options for stopping this bundle. See
Bundle.STOP_TRANSIENT. The Framework must ignore unrecognized
options.BundleException - BundleException types thrown by this method
include: BundleException.STATECHANGE_ERROR and
BundleException.ACTIVATOR_ERROR.org.osgi.framework.Framework#stoppublic void update(java.io.InputStream in)
throws BundleException
update in interface Bundleupdate in interface Frameworkupdate in class BundleImplin - The InputStream from which to read the new bundle or
null to indicate the Framework must create the input
stream from this bundle's Bundle-UpdateLocation Manifest header, if present, or this
bundle's original location. The input stream must always be closed
when this method completes, even if an exception is thrown.BundleException - If this bundle could not be updated.
BundleException types thrown by this method include:
BundleException.READ_ERROR,
BundleException.DUPLICATE_BUNDLE_ERROR,
BundleException.MANIFEST_ERROR,
BundleException.NATIVECODE_ERROR,
BundleException.RESOLVE_ERROR,
BundleException.STATECHANGE_ERROR, and
BundleException.ACTIVATOR_ERROR.org.osgi.framework.Framework#updatepublic void uninstall()
throws BundleException
uninstall in interface Bundleuninstall in interface Frameworkuninstall in class BundleImplBundleException - If the uninstall failed. This can occur if
another thread is attempting to change this bundle's state and
does not complete in a timely manner. BundleException types
thrown by this method include:
BundleException.STATECHANGE_ERRORorg.osgi.framework.Framework#uninstallpublic boolean hasPermission(java.lang.Object permission)
hasPermission in interface BundlehasPermission in class BundleImplpermission - The permission to verify.true if this bundle has the specified permission or the
permissions possessed by this bundle imply the specified
permission; false if this bundle does not have the
specified permission or permission is not an
instanceof java.security.Permission.Bundle.hasPermission(java.lang.Object)public java.util.Dictionary<java.lang.String,java.lang.String> getHeaders()
getHeaders in interface BundlegetHeaders in class BundleImplDictionary object containing this
bundle's Manifest headers and values.Bundle.getHeaders()public java.util.Dictionary<java.lang.String,java.lang.String> getHeaders(java.lang.String locale)
getHeaders in interface BundlegetHeaders in class BundleImpllocale - The locale name into which the header values are to be
localized. If the specified locale is null then the locale
returned by java.util.Locale.getDefault is used. If the
specified locale is the empty string, this method will return the
raw (unlocalized) manifest headers including any leading
"%".Dictionary object containing this
bundle's Manifest headers and values.Bundle.getHeaders()public java.util.Enumeration<java.net.URL> findEntries(java.lang.String path,
java.lang.String filePattern,
boolean recurse)
findEntries in interface BundlefindEntries in interface FrameworkfindEntries in class BundleImplpath - The path name in which to look. The path is always relative
to the root of this bundle and may begin with "/". A
path value of "/" indicates the root of this bundle.filePattern - The file name pattern for selecting entries in the
specified path. The pattern is only matched against the last
element of the entry path. If the entry is a directory then the
trailing "/" is not used for pattern matching. Substring
matching is supported, as specified in the Filter specification,
using the wildcard character ("*"). If null is
specified, this is equivalent to "*" and matches all
files.recurse - If true, recurse into subdirectories. Otherwise
only return entries from the specified path.null if no matching entry could be found or if the caller
does not have the appropriate
AdminPermission[this,RESOURCE], and the Java Runtime
Environment supports permissions. The URLs are sorted such that
entries from this bundle are returned first followed by the
entries from attached fragments in attachment order. If this
bundle is a fragment, then only matching entries in this fragment
are returned.Bundle.findEntries(java.lang.String, java.lang.String, boolean)public java.net.URL getEntry(java.lang.String name)
BundleThe specified path is always relative to the root of this bundle and may begin with "/". A path value of "/" indicates the root of this bundle.
Note: Jar and zip files are not required to include directory entries. URLs to directory entries will not be returned if the bundle contents do not contain directory entries.
getEntry in interface BundlegetEntry in interface FrameworkgetEntry in class BundleImplname - The path name of the entry.null if no entry could be found or
if the caller does not have the appropriate
AdminPermission[this,RESOURCE] and the Java Runtime
Environment supports permissions.public java.util.Enumeration<java.lang.String> getEntryPaths(java.lang.String path)
BundleString objects) to
entries within this bundle whose longest sub-path matches the specified
path. This bundle's class loader is not used to search for entries. Only
the contents of this bundle are searched.
The specified path is always relative to the root of this bundle and may begin with a "/". A path value of "/" indicates the root of this bundle.
Returned paths indicating subdirectory paths end with a "/". The returned paths are all relative to the root of this bundle and must not begin with "/".
Note: Jar and zip files are not required to include directory entries. Paths to directory entries will not be returned if the bundle contents do not contain directory entries.
getEntryPaths in interface BundlegetEntryPaths in interface FrameworkgetEntryPaths in class BundleImplpath - The path name for which to return entry paths.String objects) or
null if no entry could be found or if the caller does not
have the appropriate AdminPermission[this,RESOURCE] and
the Java Runtime Environment supports permissions.public <A> A adapt(java.lang.Class<A> type)
Bundle
Adapting this bundle to the specified type may require certain checks,
including security checks, to succeed. If a check does not succeed, then
this bundle cannot be adapted and null is returned.
adapt in interface Bundleadapt in interface Frameworkadapt in class BundleImplA - The type to which this bundle is to be adapted.type - Class object for the type to which this bundle is to be
adapted.null if this bundle cannot be adapted to the
specified type.