|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.felix.utils.extender.AbstractExtender
public abstract class AbstractExtender
Base class to write bundle extenders.
This extender tracks started bundles (or starting if they have a lazy activation
policy) and will create an 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 Summary | |
|---|---|
AbstractExtender()
|
|
| Method Summary | |
|---|---|
java.lang.Object |
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. |
protected abstract void |
debug(org.osgi.framework.Bundle bundle,
java.lang.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(java.lang.String msg,
java.lang.Throwable t)
|
org.osgi.framework.BundleContext |
getBundleContext()
|
java.util.concurrent.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,
java.lang.Object object)
|
void |
removedBundle(org.osgi.framework.Bundle bundle,
org.osgi.framework.BundleEvent event,
java.lang.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,
java.lang.String msg,
java.lang.Throwable t)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractExtender()
| Method Detail |
|---|
public boolean isSynchronous()
public boolean isPreemptiveShutdown()
public org.osgi.framework.BundleContext getBundleContext()
public java.util.concurrent.ExecutorService getExecutors()
public void setSynchronous(boolean synchronous)
public void setPreemptiveShutdown(boolean preemptiveShutdown)
public boolean isStopping()
public void start(org.osgi.framework.BundleContext context)
throws java.lang.Exception
start in interface org.osgi.framework.BundleActivatorjava.lang.Exception
public void stop(org.osgi.framework.BundleContext context)
throws java.lang.Exception
stop in interface org.osgi.framework.BundleActivatorjava.lang.Exception
protected void doStart()
throws java.lang.Exception
java.lang.Exception
protected 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)
bundles -
public void bundleChanged(org.osgi.framework.BundleEvent event)
bundleChanged in interface org.osgi.framework.BundleListener
public java.lang.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,
java.lang.Object object)
modifiedBundle in interface org.osgi.util.tracker.BundleTrackerCustomizer
public void removedBundle(org.osgi.framework.Bundle bundle,
org.osgi.framework.BundleEvent event,
java.lang.Object object)
removedBundle in interface org.osgi.util.tracker.BundleTrackerCustomizer
protected abstract Extension doCreateExtension(org.osgi.framework.Bundle bundle)
throws java.lang.Exception
bundle - the bundle to extend
java.lang.Exception
protected 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)
protected abstract void error(java.lang.String msg,
java.lang.Throwable t)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||