public abstract class CompositeBase extends BundleHost implements CompositeResolveHelper, CompositeModule
Modifier and Type | Field and Description |
---|---|
protected Framework |
companionFramework |
protected static String |
PROP_COMPOSITE |
protected static String |
PROP_PARENTFRAMEWORK |
protected ThreadLocal |
resolving |
context, fragments, LAZY_TRIGGER
bundledata, domain, framework, manifestLocalization, state, statechangeLock, stateChanging
ACTIVE, INSTALLED, RESOLVED, SIGNERS_ALL, SIGNERS_TRUSTED, START_ACTIVATION_POLICY, START_TRANSIENT, STARTING, STOP_TRANSIENT, STOPPING, UNINSTALLED
Constructor and Description |
---|
CompositeBase(BundleData bundledata,
Framework framework) |
Modifier and Type | Method and Description |
---|---|
protected abstract Framework |
findCompanionFramework(Framework thisFramework,
BundleData thisData) |
protected abstract Bundle |
getCompanionBundle() |
BundleDescription |
getCompositeDescription() |
ClassLoaderDelegate |
getDelegate() |
protected boolean |
isSurrogate() |
void |
refreshContent() |
boolean |
resolveContent() |
void |
started(CompositeModule surrogate) |
void |
stopped(CompositeModule surrogate) |
void |
update()
Updates this bundle.
|
void |
update(InputStream in)
Updates this bundle from an
InputStream . |
void |
updateContent(InputStream content) |
attachFragment, createContext, getBundleLoader, getClassLoader, getContext, getFragments, getLoaderProxy, getRegisteredServices, getResource, getResources, getServicesInUse, load, loadClass, readyToResume, refresh, reload, startHook, startWorker, stopHook, stopWorker, unload
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
giveExports
protected static String PROP_COMPOSITE
protected static String PROP_PARENTFRAMEWORK
protected final Framework companionFramework
protected final ThreadLocal resolving
public CompositeBase(BundleData bundledata, Framework framework) throws BundleException
BundleException
protected abstract Framework findCompanionFramework(Framework thisFramework, BundleData thisData) throws BundleException
BundleException
protected abstract Bundle getCompanionBundle()
protected boolean isSurrogate()
public BundleDescription getCompositeDescription()
getCompositeDescription
in interface CompositeModule
public ClassLoaderDelegate getDelegate()
getDelegate
in interface CompositeModule
public void refreshContent()
refreshContent
in interface CompositeModule
public boolean resolveContent()
resolveContent
in interface CompositeModule
public void started(CompositeModule surrogate)
started
in interface CompositeModule
public void stopped(CompositeModule surrogate)
stopped
in interface CompositeModule
public void updateContent(InputStream content) throws BundleException
updateContent
in interface CompositeModule
BundleException
public void update() throws BundleException
Bundle
This method performs the same function as calling
Bundle.update(InputStream)
with a null
InputStream.
update
in interface Bundle
update
in class AbstractBundle
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
.Bundle.update(InputStream)
public void update(InputStream in) throws BundleException
Bundle
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:
UNINSTALLED
then an
IllegalStateException
is thrown.
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.
BundleException
must be thrown after completion of the remaining
steps.
INSTALLED
.
BundleEvent.UPDATED
is fired.
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.
getState()
not in { UNINSTALLED
}.
getState()
in { INSTALLED
, RESOLVED
,
ACTIVE
}.
getState()
in { INSTALLED
, RESOLVED
,
ACTIVE
}.
update
in interface Bundle
update
in class AbstractBundle
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.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
.Bundle.stop()
,
Bundle.start()
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.