|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.ipojo.handler.extender.BundleTracker
public abstract class BundleTracker
This is a very simple bundle tracker utility class that tracks active bundles. The tracker must be given a bundle context upon creation, which it uses to listen for bundle events. The bundle tracker must be opened to track objects and closed when it is no longer needed. This class is abstract, which means in order to use it you must create a subclass of it. Subclasses must implement the addedBundle() and removedBundle() methods, which can be used to perform some custom action upon the activation or deactivation of bundles. Since this tracker is quite simple, its concurrency control approach is also simplistic. This means that subclasses should take great care to ensure that their addedBundle() and removedBundle() methods are very simple and do not do anything to change the state of any bundles.
Constructor Summary | |
---|---|
BundleTracker(BundleContext context)
Constructs a bundle tracker object that will use the specified bundle context. |
Method Summary | |
---|---|
protected abstract void |
addedBundle(Bundle bundle)
Subclasses must implement this method; it can be used to perform actions upon the activation of a bundle. |
void |
close()
Call this method to stop the tracking of active bundles. |
Bundle[] |
getBundles()
Returns the current set of active bundles. |
void |
open()
Call this method to start the tracking of active bundles. |
protected abstract void |
removedBundle(Bundle bundle)
Subclasses must implement this method; it can be used to perform actions upon the deactivation of a bundle. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BundleTracker(BundleContext context)
context
- the bundle context to use to track bundles.Method Detail |
---|
public Bundle[] getBundles()
public void open()
public void close()
protected abstract void addedBundle(Bundle bundle)
bundle
- the bundle being added to the active set.protected abstract void removedBundle(Bundle bundle)
bundle
- the bundle being removed from the active set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |