|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jetty.osgi.boot.internal.webapp.WebBundleDeployerHelper
public class WebBundleDeployerHelper
Bridges the jetty deployers with the OSGi lifecycle where applications are managed inside OSGi-bundles.
This class should be called as a consequence of the activation of a new
service that is a ContextHandler.
This way the new webapps are exposed as OSGi services.
Helper methods to register a bundle that is a web-application or a context.
Limitations:
Field Summary | |
---|---|
static BundleClassLoaderHelper |
BUNDLE_CLASS_LOADER_HELPER
By default set to: DefaultBundleClassLoaderHelper . |
static BundleFileLocatorHelper |
BUNDLE_FILE_LOCATOR_HELPER
By default set to: DefaultBundleClassLoaderHelper . |
static Collection<WebappRegistrationCustomizer> |
JSP_REGISTRATION_HELPERS
By default set to: DefaultBundleClassLoaderHelper . |
Fields inherited from interface org.eclipse.jetty.osgi.boot.internal.webapp.IWebBundleDeployerHelper |
---|
INTERNAL_SERVICE_PROP_UNKNOWN_CONTEXT_HANDLER_TYPE |
Constructor Summary | |
---|---|
WebBundleDeployerHelper(ServerInstanceWrapper wrapper)
|
Method Summary | |
---|---|
protected void |
configureWebappClassLoader(org.osgi.framework.Bundle contributor,
ContextHandler context,
OSGiWebappClassLoader webappClassLoader)
Configure a classloader onto the context. |
protected void |
configureWebAppContext(ContextHandler wah,
org.osgi.framework.Bundle contributor,
String requireTldBundle)
Applies the properties of WebAppDeployer as defined in jetty.xml. |
protected ContextHandler |
createContextHandler(ContextHandler handlerToConfigure,
org.osgi.framework.Bundle bundle,
File contextFile,
String extraClasspath,
String overrideBundleInstallLocation,
String requireTldBundle)
|
protected ContextHandler |
createContextHandler(ContextHandler handlerToConfigure,
org.osgi.framework.Bundle bundle,
InputStream contextInputStream,
String extraClasspath,
String overrideBundleInstallLocation,
String requireTldBundle)
|
protected OSGiWebappClassLoader |
createWebappClassLoader(org.osgi.framework.Bundle contributor)
No matter what the type of webapp, we create a WebappClassLoader. |
ContextHandler |
registerContext(org.osgi.framework.Bundle contributor,
String contextFileRelativePath,
String extraClasspath,
String overrideBundleInstallLocation,
String requireTldBundle,
ContextHandler handler)
This type of registration relies on jetty's complete context xml file. |
WebAppContext |
registerWebapplication(org.osgi.framework.Bundle bundle,
String webappFolderPath,
String contextPath,
String extraClasspath,
String overrideBundleInstallLocation,
String requireTldBundle,
String webXmlPath,
String defaultWebXmlPath,
WebAppContext webAppContext)
Deploy a new web application on the jetty server. |
static void |
staticInit()
|
void |
unregister(ContextHandler contextHandler)
Stop a ContextHandler and remove it from the collection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static BundleClassLoaderHelper BUNDLE_CLASS_LOADER_HELPER
DefaultBundleClassLoaderHelper
. It supports
equinox and apache-felix fragment bundles that are specific to an OSGi
implementation should set a different implementation.
public static BundleFileLocatorHelper BUNDLE_FILE_LOCATOR_HELPER
DefaultBundleClassLoaderHelper
. It supports
equinox and apache-felix fragment bundles that are specific to an OSGi
implementation should set a different implementation.
public static Collection<WebappRegistrationCustomizer> JSP_REGISTRATION_HELPERS
DefaultBundleClassLoaderHelper
. It supports
equinox and apache-felix fragment bundles that are specific to an OSGi
implementation should set a different implementation.
Several of those objects can be added here: For example we could have an optional fragment that setups a specific implementation of JSF for the whole of jetty-osgi.
Constructor Detail |
---|
public WebBundleDeployerHelper(ServerInstanceWrapper wrapper)
Method Detail |
---|
public static void staticInit()
public WebAppContext registerWebapplication(org.osgi.framework.Bundle bundle, String webappFolderPath, String contextPath, String extraClasspath, String overrideBundleInstallLocation, String requireTldBundle, String webXmlPath, String defaultWebXmlPath, WebAppContext webAppContext) throws Exception
registerWebapplication
in interface IWebBundleDeployerHelper
bundle
- The bundlewebappFolderPath
- The path to the root of the webapp. Must be a path relative to
bundle; either an absolute path.contextPath
- The context path. Must start with "/"extraClasspath
- overrideBundleInstallLocation
- requireTldBundle
- The list of bundles's symbolic names that contain
tld files that are required by this WAB.webXmlPath
- defaultWebXmlPath
- TODO: parameter description
Exception
public void unregister(ContextHandler contextHandler) throws Exception
IWebBundleDeployerHelper
unregister
in interface IWebBundleDeployerHelper
Exception
ContextDeployer.undeploy(java.lang.String)
public ContextHandler registerContext(org.osgi.framework.Bundle contributor, String contextFileRelativePath, String extraClasspath, String overrideBundleInstallLocation, String requireTldBundle, ContextHandler handler) throws Exception
IWebBundleDeployerHelper
registerContext
in interface IWebBundleDeployerHelper
requireTldBundle
- The list of bundles'symbolic name that contain tld files for this webapp.handler
- the context handler passed in the server
reference that will be configured, deployed and started.
Exception
protected void configureWebAppContext(ContextHandler wah, org.osgi.framework.Bundle contributor, String requireTldBundle)
around the comment
// configure it
protected ContextHandler createContextHandler(ContextHandler handlerToConfigure, org.osgi.framework.Bundle bundle, File contextFile, String extraClasspath, String overrideBundleInstallLocation, String requireTldBundle)
contextFile
-
protected ContextHandler createContextHandler(ContextHandler handlerToConfigure, org.osgi.framework.Bundle bundle, InputStream contextInputStream, String extraClasspath, String overrideBundleInstallLocation, String requireTldBundle)
contextFile
-
protected void configureWebappClassLoader(org.osgi.framework.Bundle contributor, ContextHandler context, OSGiWebappClassLoader webappClassLoader) throws Exception
If the context is not a WebAppContext, same but with a simpler URLClassLoader. Note that the URLClassLoader is pretty much fake: it delegate all actual classloading to the parent classloaders.
The URL[] returned by the URLClassLoader create contained specifically the jars that some j2ee tools expect and look into. For example the jars that contain tld files for jasper's jstl support.
Also as the jars in the lib folder and the classes in the classes folder might already be in the OSGi classloader we filter them out of the WebAppClassLoader
context
- contributor
- webapp
- contextPath
- classInBundle
-
Exception
protected OSGiWebappClassLoader createWebappClassLoader(org.osgi.framework.Bundle contributor) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |