org.eclipse.jetty.osgi.boot.internal.webapp
Class WebBundleTrackerCustomizer

java.lang.Object
  extended by org.eclipse.jetty.osgi.boot.internal.webapp.WebBundleTrackerCustomizer
All Implemented Interfaces:
org.osgi.util.tracker.BundleTrackerCustomizer

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

Support bundles that declare the webapp directly through headers in their manifest.

Those headers will define a new WebApplication:

Those headers will define a new app started via a jetty-context or a list of them. ',' column is the separator between the various context files.

And generate a jetty WebAppContext or another ContextHandler then registers it as service. Kind of simpler than declarative services and their xml files. Also avoid having the contributing bundle depend on jetty's package for WebApp.

Author:
hmalphettes

Constructor Summary
WebBundleTrackerCustomizer()
           
 
Method Summary
 Object addingBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event)
          A bundle is being added to the BundleTracker.
 void modifiedBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event, Object object)
          A bundle tracked by the BundleTracker has been modified.
 void removedBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event, Object object)
          A bundle tracked by the BundleTracker has been removed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebBundleTrackerCustomizer

public WebBundleTrackerCustomizer()
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.


Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.