public abstract class AbstractExtender extends Object implements org.osgi.framework.BundleActivator, org.osgi.util.tracker.BundleTrackerCustomizer, org.osgi.framework.SynchronousBundleListener
Extension
for each of them to manage it.
The extender will handle all concurrency and synchronization issues, see
Extension
for more information about the additional constraints.
The extender guarantee that all extensions will be stopped synchronously with
the STOPPING event of a given bundle and that all extensions will be stopped
before the extender bundle is stopped.Constructor and Description |
---|
AbstractExtender() |
Modifier and Type | Method and Description |
---|---|
Object |
addingBundle(org.osgi.framework.Bundle bundle,
org.osgi.framework.BundleEvent event) |
void |
bundleChanged(org.osgi.framework.BundleEvent event) |
protected Collection<org.osgi.framework.Bundle> |
chooseBundlesToDestroy(Set<org.osgi.framework.Bundle> bundles) |
protected ExecutorService |
createExecutor()
Create the executor used to start extensions asynchronously.
|
protected abstract void |
debug(org.osgi.framework.Bundle bundle,
String msg) |
protected abstract Extension |
doCreateExtension(org.osgi.framework.Bundle bundle)
Create the extension for the given bundle, or null if the bundle is not to be extended.
|
protected void |
doStart() |
protected void |
doStop() |
protected abstract void |
error(String msg,
Throwable t) |
org.osgi.framework.BundleContext |
getBundleContext() |
ExecutorService |
getExecutors() |
boolean |
isPreemptiveShutdown()
Check if the extender performs a preemptive shutdown
of all extensions when the framework is being stopped.
|
boolean |
isStopping() |
boolean |
isSynchronous()
Check if the extender is synchronous or not.
|
void |
modifiedBundle(org.osgi.framework.Bundle bundle,
org.osgi.framework.BundleEvent event,
Object object) |
void |
removedBundle(org.osgi.framework.Bundle bundle,
org.osgi.framework.BundleEvent event,
Object object) |
void |
setPreemptiveShutdown(boolean preemptiveShutdown) |
void |
setSynchronous(boolean synchronous) |
void |
start(org.osgi.framework.BundleContext context) |
protected void |
startTracking() |
void |
stop(org.osgi.framework.BundleContext context) |
protected void |
stopTracking() |
protected abstract void |
warn(org.osgi.framework.Bundle bundle,
String msg,
Throwable t) |
public boolean isSynchronous()
public boolean isPreemptiveShutdown()
public org.osgi.framework.BundleContext getBundleContext()
public ExecutorService getExecutors()
public void setSynchronous(boolean synchronous)
public void setPreemptiveShutdown(boolean preemptiveShutdown)
public boolean isStopping()
public void start(org.osgi.framework.BundleContext context) throws Exception
start
in interface org.osgi.framework.BundleActivator
Exception
public void stop(org.osgi.framework.BundleContext context) throws Exception
stop
in interface org.osgi.framework.BundleActivator
Exception
protected void startTracking()
protected void stopTracking()
protected ExecutorService createExecutor()
protected Collection<org.osgi.framework.Bundle> chooseBundlesToDestroy(Set<org.osgi.framework.Bundle> bundles)
public void bundleChanged(org.osgi.framework.BundleEvent event)
bundleChanged
in interface org.osgi.framework.BundleListener
public Object addingBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event)
addingBundle
in interface org.osgi.util.tracker.BundleTrackerCustomizer
public void modifiedBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event, Object object)
modifiedBundle
in interface org.osgi.util.tracker.BundleTrackerCustomizer
public void removedBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event, Object object)
removedBundle
in interface org.osgi.util.tracker.BundleTrackerCustomizer
protected abstract Extension doCreateExtension(org.osgi.framework.Bundle bundle) throws Exception
bundle
- the bundle to extendException
- If something goes wrongprotected abstract void debug(org.osgi.framework.Bundle bundle, String msg)
Copyright © 2017. All rights reserved.