org.ow2.jonas.lib.loader
Class MetaInfScannerBundleTrackerCustomizer

java.lang.Object
  extended by org.ow2.jonas.lib.loader.MetaInfScannerBundleTrackerCustomizer
All Implemented Interfaces:
org.osgi.util.tracker.BundleTrackerCustomizer

public class MetaInfScannerBundleTrackerCustomizer
extends Object
implements org.osgi.util.tracker.BundleTrackerCustomizer

Tracker of META/INF entries in bundles.

Author:
Florent Benoit

Constructor Summary
MetaInfScannerBundleTrackerCustomizer(org.osgi.framework.BundleContext bundleContext)
          Default constructor.
 
Method Summary
 Object addingBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event)
          A bundle is being added to the BundleTracker.
 List<URL> getEntries(String name)
          Gets the list of the current URL entries.
 void modifiedBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event, Object object)
          A bundle tracked by the BundleTracker has been modified.
 void refresh()
          Refresh data of all URL entries.
 List<URL> register(org.osgi.framework.Bundle bundle)
          Find the URLs entries available in the given Bundle.
 void removedBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event, Object object)
          A bundle tracked by the BundleTracker has been removed.
 void unregister(org.osgi.framework.Bundle bundle)
          Unregister the URLs associated to the given bundle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaInfScannerBundleTrackerCustomizer

public MetaInfScannerBundleTrackerCustomizer(org.osgi.framework.BundleContext bundleContext)
Default constructor.

Parameters:
bundleContext - the given bundle context
Method Detail

addingBundle

public Object addingBundle(org.osgi.framework.Bundle bundle,
                           org.osgi.framework.BundleEvent event)
A bundle is being added to the BundleTracker. This method is called before a bundle which matched the search parameters of the BundleTracker is added to the BundleTracker. This method should return the object to be tracked for the specified Bundle. The returned object is stored in the BundleTracker and is available from the getObject method.

Specified by:
addingBundle in interface org.osgi.util.tracker.BundleTrackerCustomizer
Parameters:
bundle - The Bundle being added to the BundleTracker.
event - The bundle event which caused this customizer method to be called or null if there is no bundle event associated with the call to this method.
Returns:
The object to be tracked for the specified Bundle object or null if the specified Bundle object should not be tracked.

modifiedBundle

public void modifiedBundle(org.osgi.framework.Bundle bundle,
                           org.osgi.framework.BundleEvent event,
                           Object object)
A bundle tracked by the BundleTracker has been modified. This method is called when a bundle being tracked by the BundleTracker has had its state modified.

Specified by:
modifiedBundle in interface org.osgi.util.tracker.BundleTrackerCustomizer
Parameters:
bundle - The Bundle whose state has been modified.
event - The bundle event which caused this customizer method to be called or null if there is no bundle event associated with the call to this method.
object - The tracked object for the specified bundle.

removedBundle

public void removedBundle(org.osgi.framework.Bundle bundle,
                          org.osgi.framework.BundleEvent event,
                          Object object)
A bundle tracked by the BundleTracker has been removed. This method is called after a bundle is no longer being tracked by the BundleTracker.

Specified by:
removedBundle in interface org.osgi.util.tracker.BundleTrackerCustomizer
Parameters:
bundle - The Bundle that has been removed.
event - The bundle event which caused this customizer method to be called or null if there is no bundle event associated with the call to this method.
object - The tracked object for the specified bundle.

register

public List<URL> register(org.osgi.framework.Bundle bundle)
Find the URLs entries available in the given Bundle.

Parameters:
bundle - the bundle to analyze
Returns:
the updated list of URLs found in META-INF directory

unregister

public void unregister(org.osgi.framework.Bundle bundle)
Unregister the URLs associated to the given bundle.

Parameters:
bundle - the bundle that is stopping

refresh

public void refresh()
Refresh data of all URL entries.


getEntries

public List<URL> getEntries(String name)
Gets the list of the current URL entries.

Parameters:
name - the given name
Returns:
the list of URL


Copyright © 2012 OW2 Consortium. All Rights Reserved.