public abstract class AbstractExtender
extends java.lang.Object
implements org.osgi.framework.BundleActivator, org.osgi.util.tracker.BundleTrackerCustomizer<org.osgi.framework.Bundle>, org.osgi.framework.SynchronousBundleListener
| Modifier and Type | Field and Description |
|---|---|
private org.osgi.framework.BundleContext |
context |
private java.util.concurrent.ConcurrentMap<org.osgi.framework.Bundle,java.util.concurrent.FutureTask<java.lang.Void>> |
destroying |
private java.util.concurrent.ConcurrentMap<org.osgi.framework.Bundle,Activator.ScrExtension> |
extensions |
private boolean |
stopped |
private boolean |
stopping |
private org.osgi.util.tracker.BundleTracker<org.osgi.framework.Bundle> |
tracker |
| Constructor and Description |
|---|
AbstractExtender() |
| Modifier and Type | Method and Description |
|---|---|
org.osgi.framework.Bundle |
addingBundle(org.osgi.framework.Bundle bundle,
org.osgi.framework.BundleEvent event) |
void |
bundleChanged(org.osgi.framework.BundleEvent event) |
protected java.util.Collection<org.osgi.framework.Bundle> |
chooseBundlesToDestroy(java.util.Set<org.osgi.framework.Bundle> bundles) |
protected java.util.concurrent.ExecutorService |
createExecutor()
Create the executor used to start extensions asynchronously.
|
private void |
createExtension(org.osgi.framework.Bundle bundle) |
protected abstract void |
debug(org.osgi.framework.Bundle bundle,
java.lang.String msg) |
private void |
destroyExtension(org.osgi.framework.Bundle bundle) |
protected abstract Activator.ScrExtension |
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() |
org.osgi.framework.BundleContext |
getBundleContext() |
boolean |
isStopping() |
void |
modifiedBundle(org.osgi.framework.Bundle bundle,
org.osgi.framework.BundleEvent event,
org.osgi.framework.Bundle object) |
void |
removedBundle(org.osgi.framework.Bundle bundle,
org.osgi.framework.BundleEvent event,
org.osgi.framework.Bundle object) |
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,
java.lang.String msg,
java.lang.Throwable t) |
private final java.util.concurrent.ConcurrentMap<org.osgi.framework.Bundle,Activator.ScrExtension> extensions
private final java.util.concurrent.ConcurrentMap<org.osgi.framework.Bundle,java.util.concurrent.FutureTask<java.lang.Void>> destroying
private volatile boolean stopping
private volatile boolean stopped
private org.osgi.framework.BundleContext context
private org.osgi.util.tracker.BundleTracker<org.osgi.framework.Bundle> tracker
public org.osgi.framework.BundleContext getBundleContext()
public boolean isStopping()
public void start(org.osgi.framework.BundleContext context)
throws java.lang.Exception
start in interface org.osgi.framework.BundleActivatorjava.lang.Exceptionpublic void stop(org.osgi.framework.BundleContext context)
throws java.lang.Exception
stop in interface org.osgi.framework.BundleActivatorjava.lang.Exceptionprotected void doStart()
throws java.lang.Exception
java.lang.Exceptionprotected void doStop()
throws java.lang.Exception
java.lang.Exceptionprotected void startTracking()
protected void stopTracking()
protected java.util.concurrent.ExecutorService createExecutor()
protected java.util.Collection<org.osgi.framework.Bundle> chooseBundlesToDestroy(java.util.Set<org.osgi.framework.Bundle> bundles)
public void bundleChanged(org.osgi.framework.BundleEvent event)
bundleChanged in interface org.osgi.framework.BundleListenerpublic org.osgi.framework.Bundle addingBundle(org.osgi.framework.Bundle bundle,
org.osgi.framework.BundleEvent event)
addingBundle in interface org.osgi.util.tracker.BundleTrackerCustomizer<org.osgi.framework.Bundle>public void modifiedBundle(org.osgi.framework.Bundle bundle,
org.osgi.framework.BundleEvent event,
org.osgi.framework.Bundle object)
modifiedBundle in interface org.osgi.util.tracker.BundleTrackerCustomizer<org.osgi.framework.Bundle>public void removedBundle(org.osgi.framework.Bundle bundle,
org.osgi.framework.BundleEvent event,
org.osgi.framework.Bundle object)
removedBundle in interface org.osgi.util.tracker.BundleTrackerCustomizer<org.osgi.framework.Bundle>private void createExtension(org.osgi.framework.Bundle bundle)
private void destroyExtension(org.osgi.framework.Bundle bundle)
protected abstract Activator.ScrExtension doCreateExtension(org.osgi.framework.Bundle bundle) throws java.lang.Exception
bundle - the bundle to extendjava.lang.Exception - If something goes wrongprotected abstract void debug(org.osgi.framework.Bundle bundle,
java.lang.String msg)
protected abstract void warn(org.osgi.framework.Bundle bundle,
java.lang.String msg,
java.lang.Throwable t)