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

java.lang.Object
  extended by org.eclipse.jetty.osgi.boot.internal.webapp.JettyContextHandlerServiceTracker
All Implemented Interfaces:
EventListener, org.osgi.framework.ServiceListener

public class JettyContextHandlerServiceTracker
extends Object
implements org.osgi.framework.ServiceListener

When a ContextHandler service is activated we look into it and if the corresponding webapp is actually not configured then we go and register it.

The idea is to always go through this class when we deploy a new webapp on jetty.

We are exposing each web-application as an OSGi service. This lets us update the webapps and stop/start them directly at the OSGi layer. It also give us many ways to declare those services: Declarative Services for example.
It is a bit different from the way the HttpService works where we would have a WebappService and we woud register a webapp onto it.
It does not go against RFC-66 nor does it prevent us from supporting the WebappContainer semantics.


Constructor Summary
JettyContextHandlerServiceTracker(IManagedJettyServerRegistry registry)
           
 
Method Summary
 void reloadJettyContextHandler(String canonicalNameOfFileChanged, String osgiContextHomeFolderCanonicalPath)
          Called by the scanner when one of the context files is changed.
 void serviceChanged(org.osgi.framework.ServiceEvent ev)
          Receives notification that a service has had a lifecycle change.
protected  void setupContextHomeScanner(File contextHome)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JettyContextHandlerServiceTracker

public JettyContextHandlerServiceTracker(IManagedJettyServerRegistry registry)
                                  throws Exception
Parameters:
registry -
Throws:
Exception
Method Detail

stop

public void stop()
          throws Exception
Throws:
Exception

setupContextHomeScanner

protected void setupContextHomeScanner(File contextHome)
                                throws IOException
Parameters:
contextHome - Parent folder where the context files can override the context files defined in the web bundles: equivalent to the contexts folder in a traditional jetty installation. when null, just do nothing.
Throws:
IOException

serviceChanged

public void serviceChanged(org.osgi.framework.ServiceEvent ev)
Receives notification that a service has had a lifecycle change.

Specified by:
serviceChanged in interface org.osgi.framework.ServiceListener
Parameters:
ev - The ServiceEvent object.

reloadJettyContextHandler

public void reloadJettyContextHandler(String canonicalNameOfFileChanged,
                                      String osgiContextHomeFolderCanonicalPath)
Called by the scanner when one of the context files is changed.

Parameters:
contextFileFully -


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