|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.osgi.framework.internal.core.AbstractBundle
org.eclipse.osgi.framework.internal.core.BundleHost
org.eclipse.osgi.framework.internal.core.InternalSystemBundle
public class InternalSystemBundle
This class subclasses Bundle to provide a system Bundle so that the framework can be represented as a bundle and can access the services provided by other bundles.
| Field Summary |
|---|
| Fields inherited from class org.eclipse.osgi.framework.internal.core.BundleHost |
|---|
context, fragments, LAZY_TRIGGER |
| Fields inherited from class org.eclipse.osgi.framework.internal.core.AbstractBundle |
|---|
bundledata, domain, framework, manifestLocalization, state, statechangeLock, stateChanging |
| Fields inherited from interface org.osgi.framework.Bundle |
|---|
ACTIVE, INSTALLED, RESOLVED, SIGNERS_ALL, SIGNERS_TRUSTED, START_ACTIVATION_POLICY, START_TRANSIENT, STARTING, STOP_TRANSIENT, STOPPING, UNINSTALLED |
| Constructor Summary | |
|---|---|
protected |
InternalSystemBundle(Framework framework)
Private SystemBundle object constructor. |
| Method Summary | |
|---|---|
protected void |
close()
Close the the Bundle's file. |
java.lang.ClassLoader |
getClassLoader()
Gets the class loader for the host bundle. |
java.util.Dictionary |
getHeaders(java.lang.String localeString)
Returns this bundle's Manifest headers and values. |
java.net.URL |
getResource(java.lang.String name)
Find the specified resource in this bundle. |
boolean |
hasPermission(java.lang.Object permission)
Determine whether the bundle has the requested permission. |
void |
init()
Initialize this Framework. |
protected boolean |
isUnresolved()
Indicate SystemBundle is resolved. |
protected void |
load()
Load the bundle. |
protected java.lang.Class |
loadClass(java.lang.String name,
boolean checkPermission)
This method loads a class from the bundle. |
protected void |
refresh()
Refresh the bundle. |
protected boolean |
reload(AbstractBundle newBundle)
Reload from a new bundle. |
protected void |
resume()
Start the SystemBundle. |
void |
start()
Start this bundle. |
void |
start(int options)
Starts this bundle. |
void |
stop()
Stop the framework. |
void |
stop(int options)
Stops this bundle. |
protected void |
suspend()
Stop the SystemBundle. |
protected void |
suspend(boolean lock)
Stop this bundle w/o marking is persistently stopped. |
void |
uninstall()
Uninstall this bundle. |
protected boolean |
unload()
Unload the bundle. |
protected void |
unresolvePermissions(AbstractBundle[] refreshedBundles)
No work to do for the SystemBundle. |
void |
update()
Update this bundle. |
void |
update(java.io.InputStream in)
Update this bundle from an InputStream. |
FrameworkEvent |
waitForStop(long timeout)
Wait until this Framework has completely stopped. |
| Methods inherited from class org.eclipse.osgi.framework.internal.core.BundleHost |
|---|
attachFragment, createContext, getBundleLoader, getContext, getFragments, getLoaderProxy, getRegisteredServices, getResources, getServicesInUse, readyToResume, startHook, startWorker, stopHook, stopWorker |
| Methods inherited from class org.eclipse.osgi.framework.internal.core.AbstractBundle |
|---|
beginStateChange, checkValid, compare, compareTo, completeStateChange, createBundle, findEntries, findLocalEntryPaths, getBundleContext, getBundleData, getBundleDescription, getBundleId, getEntry, getEntryPaths, getFramework, getHeaders, getKey, getKeyHashCode, getLastModified, getLocation, getProtectionDomain, getResolutionFailureException, getResourceBundle, getSignerCertificates, getStartLevel, getState, getStateChanging, getSymbolicName, getVersion, isActive, isFragment, isResolved, loadBundleActivator, loadClass, resolve, setStatus, testStateChanging, toString, uninstallWorker, uninstallWorkerPrivileged, updateWorker, updateWorkerPrivileged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.osgi.framework.launch.Framework |
|---|
getBundleId, getLocation, getSymbolicName |
| Methods inherited from interface org.osgi.framework.Bundle |
|---|
findEntries, getBundleContext, getEntry, getEntryPaths, getHeaders, getLastModified, getRegisteredServices, getResources, getServicesInUse, getSignerCertificates, getState, getVersion, loadClass |
| Constructor Detail |
|---|
protected InternalSystemBundle(Framework framework)
throws BundleException
framework - Framework this bundle is running in
BundleException| Method Detail |
|---|
protected void load()
load in class BundleHostprotected boolean reload(AbstractBundle newBundle)
reload in class BundleHostnewBundle -
protected void refresh()
refresh in class BundleHostprotected boolean unload()
unload in class BundleHostprotected void close()
close in class AbstractBundle
protected java.lang.Class loadClass(java.lang.String name,
boolean checkPermission)
throws java.lang.ClassNotFoundException
loadClass in class BundleHostname - the name of the desired Class.checkPermission - indicates whether a permission check should be done.
java.lang.ClassNotFoundException - if the class definition was not found.public java.net.URL getResource(java.lang.String name)
getResource in interface BundlegetResource in class BundleHostname - The name of the resource.
See java.lang.ClassLoader.getResource for a description of
the format of a resource name.
Bundle.getEntry(java.lang.String),
Bundle.findEntries(java.lang.String, java.lang.String, boolean)protected boolean isUnresolved()
public void start()
start in interface Bundlestart in interface Frameworkstart in class AbstractBundleBundle.start(int)public void start(int options)
Bundle
If this bundle's state is UNINSTALLED then an
IllegalStateException is thrown.
If the Framework implements the optional Start Level service and the current start level is less than this bundle's start level:
Bundle.START_TRANSIENT option is set, then a
BundleException is thrown indicating this bundle cannot be
started due to the Framework's current start level.
Bundle.START_ACTIVATION_POLICY option is set or
Started with eager activation if not set.
When the Framework's current start level becomes equal to or more than this bundle's start level, this bundle will be started.
Otherwise, the following steps are required to start this bundle:
BundleException is thrown to indicate this bundle was unable
to be started.
ACTIVE then this method
returns immediately.
Bundle.START_TRANSIENT option is not set then set this
bundle's autostart setting to Started with declared activation
if the Bundle.START_ACTIVATION_POLICY option is set or
Started with eager activation if not set. When the Framework is
restarted and this bundle's autostart setting is not Stopped,
this bundle must be automatically started.
RESOLVED, an attempt is
made to resolve this bundle. If the Framework cannot resolve this bundle,
a BundleException is thrown.
Bundle.START_ACTIVATION_POLICY option is set and this
bundle's declared activation policy is lazy then:
STARTING then this method
returns immediately.
STARTING.
BundleEvent.LAZY_ACTIVATION is fired.
STARTING.
BundleEvent.STARTING is fired.
BundleActivator.start(org.osgi.framework.BundleContext) method of this bundle's
BundleActivator, if one is specified, is called. If the
BundleActivator is invalid or throws an exception then:
STOPPING.
BundleEvent.STOPPING is fired.
RESOLVED.
BundleEvent.STOPPED is fired.
BundleException is then thrown.
UNINSTALLED, because this
bundle was uninstalled while the BundleActivator.start
method was running, a BundleException is thrown.
ACTIVE.
BundleEvent.STARTED is fired.
getState() in { INSTALLED,
RESOLVED } or { INSTALLED,
RESOLVED, STARTING } if this bundle has
a lazy activation policy.
Bundle.START_TRANSIENT option was set.
getState() in { ACTIVE }
unless the lazy activation policy was used.
BundleActivator.start() has been called and did not
throw an exception unless the lazy activation policy was used.
Bundle.START_TRANSIENT option was set.
getState() not in { STARTING,
ACTIVE }.
start in interface Bundlestart in interface Frameworkstart in class AbstractBundleoptions - The options for starting this bundle. See
Bundle.START_TRANSIENT and Bundle.START_ACTIVATION_POLICY. The
Framework must ignore unrecognized options.Framework.start()protected void resume()
resume in class AbstractBundlepublic void stop()
stop in interface Bundlestop in interface Frameworkstop in class AbstractBundleBundle.start(int)public void stop(int options)
BundleThe following steps are required to stop a bundle:
UNINSTALLED then an
IllegalStateException is thrown.
BundleException is thrown to indicate this bundle was unable
to be stopped.
Bundle.STOP_TRANSIENT option is not set then then set this
bundle's persistent autostart setting to to Stopped. When the
Framework is restarted and this bundle's autostart setting is
Stopped, this bundle must not be automatically started.
STARTING or
ACTIVE then this method returns immediately.
STOPPING.
BundleEvent.STOPPING is fired.
ACTIVE prior to setting the
state to STOPPING, the BundleActivator.stop(org.osgi.framework.BundleContext) method
of this bundle's BundleActivator, if one is specified, is
called. If that method throws an exception, this method must continue to
stop this bundle and a BundleException must be thrown after
completion of the remaining steps.
UNINSTALLED, because this
bundle was uninstalled while the BundleActivator.stop method
was running, a BundleException must be thrown.
RESOLVED.
BundleEvent.STOPPED is fired.
getState() in { ACTIVE }.
Bundle.STOP_TRANSIENT option was set.
getState() not in { ACTIVE,
STOPPING }.
BundleActivator.stop has been called and did not throw
an exception.
Bundle.STOP_TRANSIENT option was set.
stop in interface Bundlestop in interface Frameworkstop in class AbstractBundleoptions - The options for stoping this bundle. See
Bundle.STOP_TRANSIENT. The Framework must ignore unrecognized
options.Framework.stop()protected void suspend()
protected void suspend(boolean lock)
AbstractBundleThe following steps are followed to stop a bundle:
Bundle.UNINSTALLEDthen an IllegalStateException
is thrown.
Bundle.STOPPING,Bundle.RESOLVED, or
Bundle.INSTALLEDthen this method returns immediately.
Bundle.STARTINGthen this method may wait for
the bundle to reach the Bundle.ACTIVEstate before continuing. If this
does not occur in a reasonable time, a BundleExceptionis thrown
to indicate the bundle was unable to be stopped.
Bundle.STOPPING.
stopmethod of the bundle's
BundleActivator, if one is specified, is called. If the
BundleActivatorthrows an exception, this method will continue
to stop the bundle. A BundleExceptionwill be thrown after
completion of the remaining steps.
Bundle.RESOLVED.
BundleEventof type BundleEvent.STOPPEDis
broadcast.
Bundle.ACTIVE}.
Bundle.ACTIVE,Bundle.STOPPING}.
BundleActivator.stophas been called
and did not throw an exception.
suspend in class AbstractBundlelock - true if state change lock should be held when returning from
this method.public void update()
update in interface Bundleupdate in interface Frameworkupdate in class AbstractBundleBundle.update(InputStream)public void update(java.io.InputStream in)
update in interface Bundleupdate in interface Frameworkupdate in class AbstractBundlein - The InputStream from which to read the new bundle.Bundle.stop(),
Bundle.start()
public void uninstall()
throws BundleException
uninstall in interface Bundleuninstall in interface Frameworkuninstall in class AbstractBundleBundleException - If the uninstall failed.AbstractBundle.stop()public boolean hasPermission(java.lang.Object permission)
true.
hasPermission in interface BundlehasPermission in class AbstractBundlepermission - The requested permission.
trueprotected void unresolvePermissions(AbstractBundle[] refreshedBundles)
refreshedBundles - A list of bundles which have been refreshed as a result
of a packageRefreshpublic java.util.Dictionary getHeaders(java.lang.String localeString)
AbstractBundleManifest header names are case-insensitive. The methods of the returned Dictionary object will operate on header names in a case-insensitive manner. If a Manifest header begins with a '%', it will be evaluated with the specified properties file for the specied Locale.
For example, the following Manifest headers and values are included if they are present in the Manifest file:
Bundle-Name Bundle-Vendor Bundle-Version Bundle-Description Bundle-DocURL Bundle-ContactAddress
This method will continue to return Manifest header information while this bundle is in the UNINSTALLED state.
getHeaders in interface BundlegetHeaders in class AbstractBundlelocaleString - 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 "%".
Bundle.getHeaders(),
Constants.BUNDLE_LOCALIZATIONpublic void init()
FrameworkBundle.STARTING state.PackageAdmin, ConditionalPermissionAdmin,
StartLevel.
This Framework will not actually be started until start
is called.
This method does nothing if called when this Framework is in the
Bundle.STARTING, Bundle.ACTIVE or Bundle.STOPPING states.
init in interface Framework
public 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 affect. 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 java.lang.ClassLoader getClassLoader()
BundleHost
getClassLoader in class BundleHost
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||