org.eclipse.osgi.internal.composite
Class CompositeBase
java.lang.Object
org.eclipse.osgi.framework.internal.core.AbstractBundle
org.eclipse.osgi.framework.internal.core.BundleHost
org.eclipse.osgi.internal.composite.CompositeBase
- All Implemented Interfaces:
- java.lang.Comparable<Bundle>, KeyedElement, CompositeResolveHelper, CompositeModule, Bundle, BundleReference, BundleStartLevel, BundleRevisions
- Direct Known Subclasses:
- CompositeImpl, SurrogateImpl
public abstract class CompositeBase
- extends BundleHost
- implements CompositeResolveHelper, CompositeModule
This is a base class for both composite and surrogate bundles.
| 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 |
| Methods inherited from class org.eclipse.osgi.framework.internal.core.BundleHost |
attachFragment, createContext, getBundleLoader, getClassLoader, getContext, getFragments, getLoaderProxy, getRegisteredServices, getResource, getResources, getServicesInUse, load, loadClass, readyToResume, refresh, reload, startHook, startWorker, stopHook, stopWorker, unload |
| Methods inherited from class org.eclipse.osgi.framework.internal.core.AbstractBundle |
adapt, adapt0, beginStateChange, checkValid, close, compare, compareTo, completeStateChange, createBundle, findEntries, getBundle, getBundleContext, getBundleData, getBundleDescription, getBundleId, getDataFile, getEntry, getEntryPaths, getFramework, getHeaders, getHeaders, getKey, getKeyHashCode, getLastModified, getLocation, getProtectionDomain, getResolutionFailureException, getResourceBundle, getRevisions, getSignerCertificates, getStartLevel, getState, getStateChanging, getSymbolicName, getVersion, hasPermission, isActivationPolicyUsed, isActive, isFragment, isPersistentlyStarted, isResolved, loadBundleActivator, loadClass, resolve, resume, setStartLevel, setStatus, start, start, stop, stop, suspend, testStateChanging, toString, uninstall, uninstallWorker, uninstallWorkerPrivileged, updateWorker, updateWorkerPrivileged |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PROP_COMPOSITE
protected static java.lang.String PROP_COMPOSITE
PROP_PARENTFRAMEWORK
protected static java.lang.String PROP_PARENTFRAMEWORK
companionFramework
protected final Framework companionFramework
resolving
protected final java.lang.ThreadLocal resolving
CompositeBase
public CompositeBase(BundleData bundledata,
Framework framework)
throws BundleException
- Throws:
BundleException
findCompanionFramework
protected abstract Framework findCompanionFramework(Framework thisFramework,
BundleData thisData)
throws BundleException
- Throws:
BundleException
getCompanionBundle
protected abstract Bundle getCompanionBundle()
isSurrogate
protected boolean isSurrogate()
getCompositeDescription
public BundleDescription getCompositeDescription()
- Specified by:
getCompositeDescription in interface CompositeModule
getDelegate
public ClassLoaderDelegate getDelegate()
- Specified by:
getDelegate in interface CompositeModule
refreshContent
public void refreshContent()
- Specified by:
refreshContent in interface CompositeModule
resolveContent
public boolean resolveContent()
- Specified by:
resolveContent in interface CompositeModule
started
public void started(CompositeModule surrogate)
- Specified by:
started in interface CompositeModule
stopped
public void stopped(CompositeModule surrogate)
- Specified by:
stopped in interface CompositeModule
updateContent
public void updateContent(java.io.InputStream content)
throws BundleException
- Specified by:
updateContent in interface CompositeModule
- Throws:
BundleException
update
public void update()
throws BundleException
- Description copied from interface:
Bundle
- Updates this bundle.
This method performs the same function as calling
Bundle.update(InputStream) with a null InputStream.
- Specified by:
update in interface Bundle- Overrides:
update in class AbstractBundle
- Throws:
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.- See Also:
Bundle.update(InputStream)
update
public void update(java.io.InputStream in)
throws BundleException
- Description copied from interface:
Bundle
- Updates this bundle from an
InputStream.
If the specified InputStream is null, the Framework must
create the InputStream from which to read the updated bundle by
interpreting, in an implementation dependent manner, this bundle's
Bundle-UpdateLocation Manifest
header, if present, or this bundle's original location.
If this bundle's state is ACTIVE, it must be stopped before the
update and started after the update successfully completes.
If this bundle has exported any packages that are imported by another
bundle, these packages must remain exported until the
FrameworkWiring.refreshBundles method has been has been called or the
Framework is relaunched.
The following steps are required to update a bundle:
- If this bundle's state is
UNINSTALLED then an
IllegalStateException is thrown.
- If this bundle's state is
ACTIVE, STARTING or
STOPPING, this bundle is stopped as described in the
Bundle.stop method. If Bundle.stop throws an exception,
the exception is rethrown terminating the update.
- The updated version of this bundle is read from the input stream and
installed. If the Framework is unable to install the updated version of
this bundle, the original version of this bundle must be restored and a
BundleException must be thrown after completion of the remaining
steps.
- This bundle's state is set to
INSTALLED.
- If the updated version of this bundle was successfully installed, a
bundle event of type
BundleEvent.UPDATED is fired.
- If this bundle's state was originally
ACTIVE, the updated
bundle is started as described in the Bundle.start method. If
Bundle.start throws an exception, a Framework event of type
FrameworkEvent.ERROR is fired containing the exception.
Preconditions
getState() not in { UNINSTALLED }.
Postconditions, no exceptions thrown
getState() in { INSTALLED, RESOLVED,
ACTIVE }.
- This bundle has been updated.
Postconditions, when an exception is thrown
getState() in { INSTALLED, RESOLVED,
ACTIVE }.
- Original bundle is still used; no update occurred.
- Specified by:
update in interface Bundle- Overrides:
update in class AbstractBundle
- Parameters:
in - 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.
- Throws:
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.- See Also:
Bundle.stop(),
Bundle.start()
Copyright © 2007-2012 FuseSource, Corp.. All Rights Reserved.