org.eclipse.osgi.internal.composite
Class CompositeImpl

java.lang.Object
  extended by org.eclipse.osgi.framework.internal.core.AbstractBundle
      extended by org.eclipse.osgi.framework.internal.core.BundleHost
          extended by org.eclipse.osgi.internal.composite.CompositeBase
              extended by org.eclipse.osgi.internal.composite.CompositeImpl
All Implemented Interfaces:
java.lang.Comparable<Bundle>, KeyedElement, CompositeResolveHelper, CompositeModule, Bundle, BundleReference, BundleStartLevel, BundleRevisions, CompositeBundle

public class CompositeImpl
extends CompositeBase
implements CompositeBundle


Field Summary
static java.lang.String COMPOSITE_CONFIGURATION
           
 
Fields inherited from class org.eclipse.osgi.internal.composite.CompositeBase
companionFramework, PROP_COMPOSITE, PROP_PARENTFRAMEWORK, resolving
 
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
CompositeImpl(BundleData bundledata, Framework framework)
           
 
Method Summary
protected  Framework findCompanionFramework(Framework thisFramework, BundleData thisData)
           
protected  Bundle getCompanionBundle()
           
 Framework getCompositeFramework()
          Returns the child framework associated with this composite bundle.
 SurrogateBundle getSurrogateBundle()
          Returns the surrogate bundle associated with this composite bundle.
 boolean giveExports(ExportPackageDescription[] matchingExports)
           
 void started(CompositeModule surrogate)
           
protected  void startHook()
           
protected  void stopHook()
           
 void stopped(CompositeModule surrogate)
           
 void uninstall()
          Uninstall this bundle.
 void update(java.util.Map compositeManifest)
          Updates this composite bundle with the specified manifest.
 
Methods inherited from class org.eclipse.osgi.internal.composite.CompositeBase
getCompositeDescription, getDelegate, isSurrogate, refreshContent, resolveContent, update, update, updateContent
 
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, startWorker, 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, 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.service.framework.CompositeBundle
update, update
 
Methods inherited from interface org.osgi.framework.Bundle
adapt, findEntries, getBundleContext, getBundleId, getDataFile, getEntry, getEntryPaths, getHeaders, getHeaders, getLastModified, getLocation, getRegisteredServices, getResource, getResources, getServicesInUse, getSignerCertificates, getState, getSymbolicName, getVersion, hasPermission, loadClass, start, start, stop, stop
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

COMPOSITE_CONFIGURATION

public static java.lang.String COMPOSITE_CONFIGURATION
Constructor Detail

CompositeImpl

public CompositeImpl(BundleData bundledata,
                     Framework framework)
              throws BundleException
Throws:
BundleException
Method Detail

findCompanionFramework

protected Framework findCompanionFramework(Framework thisFramework,
                                           BundleData thisData)
                                    throws BundleException
Specified by:
findCompanionFramework in class CompositeBase
Throws:
BundleException

getCompositeFramework

public Framework getCompositeFramework()
Description copied from interface: CompositeBundle
Returns the child framework associated with this composite bundle.

Specified by:
getCompositeFramework in interface CompositeBundle
Returns:
the child framework.

getSurrogateBundle

public SurrogateBundle getSurrogateBundle()
Description copied from interface: CompositeBundle
Returns the surrogate bundle associated with this composite bundle. The surrogate bundle is installed in the child framework.

Specified by:
getSurrogateBundle in interface CompositeBundle
Returns:
the surrogate bundle.

getCompanionBundle

protected Bundle getCompanionBundle()
Specified by:
getCompanionBundle in class CompositeBase

update

public void update(java.util.Map compositeManifest)
            throws BundleException
Description copied from interface: CompositeBundle
Updates this composite bundle with the specified manifest.

Similar to normal bundle updates, the packages exported by a composite or surrogate bundle can not change as a result of calling update: the previous package exports must be available to other consuming bundles (in either the parent or child framework) until the PackageAdmin.refreshPackages method has been called to refresh the composite, or the parent Framework is re-launched.

Specified by:
update in interface CompositeBundle
Parameters:
compositeManifest - the new composite manifest.
Throws:
BundleException - If the update fails.
See Also:
CompositeBundleFactory.installCompositeBundle(Map, String, Map)

uninstall

public void uninstall()
               throws BundleException
Description copied from class: AbstractBundle
Uninstall this bundle.

This method removes all traces of the bundle, including any data in the persistent storage area provided for the bundle by the framework.

The following steps are followed to uninstall a bundle:

  1. If the bundle is Bundle.UNINSTALLEDthen an IllegalStateException is thrown.
  2. If the bundle is Bundle.ACTIVEor Bundle.STARTING, the bundle is stopped as described in the AbstractBundle.stop()method. If AbstractBundle.stop() throws an exception, a FrameworkEventof type FrameworkEvent.ERRORis broadcast containing the exception.
  3. A BundleEventof type BundleEvent.UNINSTALLEDis broadcast.
  4. The state of the bundle is set to Bundle.UNINSTALLED.
  5. The bundle and the persistent storage area provided for the bundle by the framework, if any, is removed.
Preconditions
Postconditons, no exceptions thrown
Postconditions, when an exception is thrown

Specified by:
uninstall in interface Bundle
Specified by:
uninstall in interface CompositeBundle
Overrides:
uninstall in class AbstractBundle
Throws:
BundleException - If the uninstall failed.
See Also:
AbstractBundle.stop()

startHook

protected void startHook()
                  throws BundleException
Overrides:
startHook in class BundleHost
Throws:
BundleException

stopHook

protected void stopHook()
                 throws BundleException
Overrides:
stopHook in class BundleHost
Throws:
BundleException

started

public void started(CompositeModule surrogate)
Specified by:
started in interface CompositeModule
Overrides:
started in class CompositeBase

stopped

public void stopped(CompositeModule surrogate)
Specified by:
stopped in interface CompositeModule
Overrides:
stopped in class CompositeBase

giveExports

public boolean giveExports(ExportPackageDescription[] matchingExports)
Specified by:
giveExports in interface CompositeResolveHelper


Copyright © 2007-2012 FuseSource, Corp.. All Rights Reserved.