public class JettyContextHandlerServiceTracker extends Object implements org.osgi.framework.ServiceListener
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 and Description |
---|
JettyContextHandlerServiceTracker(IManagedJettyServerRegistry registry) |
Modifier and Type | Method and Description |
---|---|
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() |
public JettyContextHandlerServiceTracker(IManagedJettyServerRegistry registry) throws Exception
registry
- Exception
protected void setupContextHomeScanner(File contextHome) throws IOException
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.IOException
public void serviceChanged(org.osgi.framework.ServiceEvent ev)
serviceChanged
in interface org.osgi.framework.ServiceListener
ev
- The ServiceEvent
object.Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.