Fix up version number in manifests; reformat code; tidy xml and tweak
This commit is contained in:
parent
9d54ea4cde
commit
48982ced4a
|
@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: Jetty-OSGi-Jasper integration
|
Bundle-Name: Jetty-OSGi-Jasper integration
|
||||||
Fragment-Host: org.eclipse.jetty.osgi.boot
|
Fragment-Host: org.eclipse.jetty.osgi.boot
|
||||||
Bundle-SymbolicName: org.eclipse.jetty.osgi.boot.jsp
|
Bundle-SymbolicName: org.eclipse.jetty.osgi.boot.jsp
|
||||||
Bundle-Version: 8.1.2.qualifier
|
Bundle-Version: 8.1.3.qualifier
|
||||||
Bundle-Vendor: Mort Bay Consulting
|
Bundle-Vendor: Mort Bay Consulting
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Import-Package: com.sun.el;version="2.2.0";resolution:=optional,
|
Import-Package: com.sun.el;version="2.2.0";resolution:=optional,
|
||||||
|
@ -16,7 +16,7 @@ Import-Package: com.sun.el;version="2.2.0";resolution:=optional,
|
||||||
javax.servlet.jsp.jstl.tlv;version="1.2.0";resolution:=optional,
|
javax.servlet.jsp.jstl.tlv;version="1.2.0";resolution:=optional,
|
||||||
javax.servlet.jsp.resources;version="2.1.0",
|
javax.servlet.jsp.resources;version="2.1.0",
|
||||||
javax.servlet.jsp.tagext;version="2.1.0",
|
javax.servlet.jsp.tagext;version="2.1.0",
|
||||||
javax.servlet.resources;version="2.5.0",
|
javax.servlet.resources;version="2.6.0",
|
||||||
org.apache.jasper;version="2.2.2";resolution:=optional,
|
org.apache.jasper;version="2.2.2";resolution:=optional,
|
||||||
org.apache.jasper.compiler;version="2.2.2";resolution:=optional,
|
org.apache.jasper.compiler;version="2.2.2";resolution:=optional,
|
||||||
org.apache.jasper.compiler.tagplugin;version="2.2.2";resolution:=optional,
|
org.apache.jasper.compiler.tagplugin;version="2.2.2";resolution:=optional,
|
||||||
|
|
|
@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: Jetty-OSGi-Logback integration
|
Bundle-Name: Jetty-OSGi-Logback integration
|
||||||
Fragment-Host: org.eclipse.jetty.osgi.boot
|
Fragment-Host: org.eclipse.jetty.osgi.boot
|
||||||
Bundle-SymbolicName: org.eclipse.jetty.osgi.boot.logback;singleton:=true
|
Bundle-SymbolicName: org.eclipse.jetty.osgi.boot.logback;singleton:=true
|
||||||
Bundle-Version: 8.1.2.qualifier
|
Bundle-Version: 8.1.3.qualifier
|
||||||
Bundle-Vendor: Mort Bay Consulting
|
Bundle-Vendor: Mort Bay Consulting
|
||||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||||
Import-Package: ch.qos.logback.classic,
|
Import-Package: ch.qos.logback.classic,
|
||||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: Support for rfc66 war url scheme
|
Bundle-Name: Support for rfc66 war url scheme
|
||||||
Bundle-SymbolicName: org.eclipse.jetty.osgi.boot.warurl;singleton:=true
|
Bundle-SymbolicName: org.eclipse.jetty.osgi.boot.warurl;singleton:=true
|
||||||
Bundle-Version: 8.1.2.qualifier
|
Bundle-Version: 8.1.3.qualifier
|
||||||
Bundle-Activator: org.eclipse.jetty.osgi.boot.warurl.WarUrlActivator
|
Bundle-Activator: org.eclipse.jetty.osgi.boot.warurl.WarUrlActivator
|
||||||
Bundle-Vendor: Mort Bay Consulting
|
Bundle-Vendor: Mort Bay Consulting
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
|
|
|
@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: Jetty OSGi bootstrap
|
Bundle-Name: Jetty OSGi bootstrap
|
||||||
Bundle-SymbolicName: org.eclipse.jetty.osgi.boot
|
Bundle-SymbolicName: org.eclipse.jetty.osgi.boot
|
||||||
Bundle-Vendor: Mort Bay Consulting
|
Bundle-Vendor: Mort Bay Consulting
|
||||||
Bundle-Version: 8.1.2.qualifier
|
Bundle-Version: 8.1.3.qualifier
|
||||||
Bundle-Activator: org.eclipse.jetty.osgi.boot.JettyBootstrapActivator
|
Bundle-Activator: org.eclipse.jetty.osgi.boot.JettyBootstrapActivator
|
||||||
Import-Package: javax.mail;version="1.4.0";resolution:=optional,
|
Import-Package: javax.mail;version="1.4.0";resolution:=optional,
|
||||||
javax.mail.event;version="1.4.0";resolution:=optional,
|
javax.mail.event;version="1.4.0";resolution:=optional,
|
||||||
|
@ -14,20 +14,20 @@ Import-Package: javax.mail;version="1.4.0";resolution:=optional,
|
||||||
javax.servlet.http;version="2.6",
|
javax.servlet.http;version="2.6",
|
||||||
javax.transaction;version="1.1.0";resolution:=optional,
|
javax.transaction;version="1.1.0";resolution:=optional,
|
||||||
javax.transaction.xa;version="1.1.0";resolution:=optional,
|
javax.transaction.xa;version="1.1.0";resolution:=optional,
|
||||||
org.eclipse.jetty.annotations;version="8.1.2";resolution:=optional,
|
org.eclipse.jetty.annotations;version="8.1.3";resolution:=optional,
|
||||||
org.eclipse.jetty.deploy;version="8.1.2",
|
org.eclipse.jetty.deploy;version="8.1.3",
|
||||||
org.eclipse.jetty.deploy.providers;version="8.1.2",
|
org.eclipse.jetty.deploy.providers;version="8.1.3",
|
||||||
org.eclipse.jetty.http;version="8.1.2",
|
org.eclipse.jetty.http;version="8.1.3",
|
||||||
org.eclipse.jetty.nested;version="8.1.2";resolution:=optional,
|
org.eclipse.jetty.nested;version="8.1.3";resolution:=optional,
|
||||||
org.eclipse.jetty.server;version="8.1.2",
|
org.eclipse.jetty.server;version="8.1.3",
|
||||||
org.eclipse.jetty.server.handler;version="8.1.2",
|
org.eclipse.jetty.server.handler;version="8.1.3",
|
||||||
org.eclipse.jetty.servlet;version="8.1.2",
|
org.eclipse.jetty.servlet;version="8.1.3",
|
||||||
org.eclipse.jetty.util;version="8.1.2",
|
org.eclipse.jetty.util;version="8.1.3",
|
||||||
org.eclipse.jetty.util.component;version="8.1.2",
|
org.eclipse.jetty.util.component;version="8.1.3",
|
||||||
org.eclipse.jetty.util.log;version="8.1.2",
|
org.eclipse.jetty.util.log;version="8.1.3",
|
||||||
org.eclipse.jetty.util.resource;version="8.1.2",
|
org.eclipse.jetty.util.resource;version="8.1.3",
|
||||||
org.eclipse.jetty.webapp;version="8.1.2",
|
org.eclipse.jetty.webapp;version="8.1.3",
|
||||||
org.eclipse.jetty.xml;version="8.1.2",
|
org.eclipse.jetty.xml;version="8.1.3",
|
||||||
org.osgi.framework,
|
org.osgi.framework,
|
||||||
org.osgi.service.cm;version="1.2.0",
|
org.osgi.service.cm;version="1.2.0",
|
||||||
org.osgi.service.packageadmin,
|
org.osgi.service.packageadmin,
|
||||||
|
@ -41,8 +41,8 @@ Import-Package: javax.mail;version="1.4.0";resolution:=optional,
|
||||||
org.xml.sax.helpers
|
org.xml.sax.helpers
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Bundle-Classpath: .
|
Bundle-Classpath: .
|
||||||
Export-Package: org.eclipse.jetty.osgi.boot;version="8.1.2",
|
Export-Package: org.eclipse.jetty.osgi.boot;version="8.1.3",
|
||||||
org.eclipse.jetty.osgi.nested;version="8.1.2",
|
org.eclipse.jetty.osgi.nested;version="8.1.3",
|
||||||
org.eclipse.jetty.osgi.boot.utils;version="8.1.2",
|
org.eclipse.jetty.osgi.boot.utils;version="8.1.3",
|
||||||
org.eclipse.jetty.osgi.annotations;version="8.1.2"
|
org.eclipse.jetty.osgi.annotations;version="8.1.3"
|
||||||
DynamicImport-Package: org.eclipse.jetty.*;version="[8.1,9)"
|
DynamicImport-Package: org.eclipse.jetty.*;version="[8.1,9)"
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
<New class="org.eclipse.jetty.util.thread.QueuedThreadPool">
|
<New class="org.eclipse.jetty.util.thread.QueuedThreadPool">
|
||||||
<Set name="minThreads">10</Set>
|
<Set name="minThreads">10</Set>
|
||||||
<Set name="maxThreads">200</Set>
|
<Set name="maxThreads">200</Set>
|
||||||
|
<Set name="detailedDump">false</Set>
|
||||||
</New>
|
</New>
|
||||||
</Set>
|
</Set>
|
||||||
|
|
||||||
|
@ -45,19 +46,6 @@
|
||||||
</Arg>
|
</Arg>
|
||||||
</Call>
|
</Call>
|
||||||
|
|
||||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
|
||||||
<!-- To add a HTTP blocking connector -->
|
|
||||||
<!-- mixin jetty-bio.xml: -->
|
|
||||||
<!-- java -jar start.jar etc/jetty-bio.xml -->
|
|
||||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
|
||||||
|
|
||||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
|
||||||
<!-- To allow Jetty to be started from xinetd -->
|
|
||||||
<!-- mixin jetty-xinetd.xml: -->
|
|
||||||
<!-- java -jar start.jar etc/jetty-xinetd.xml -->
|
|
||||||
<!-- -->
|
|
||||||
<!-- See jetty-xinetd.xml for further instructions. -->
|
|
||||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
|
||||||
|
|
||||||
<!-- =========================================================== -->
|
<!-- =========================================================== -->
|
||||||
<!-- Set handler Collection Structure -->
|
<!-- Set handler Collection Structure -->
|
||||||
|
@ -82,10 +70,6 @@
|
||||||
|
|
||||||
<!-- =========================================================== -->
|
<!-- =========================================================== -->
|
||||||
<!-- Configure the deployment manager -->
|
<!-- Configure the deployment manager -->
|
||||||
<!-- -->
|
|
||||||
<!-- Sets up 2 monitored dir app providers that are configured -->
|
|
||||||
<!-- to behave in a similaraly to the legacy ContextDeployer -->
|
|
||||||
<!-- and WebAppDeployer from previous versions of Jetty. -->
|
|
||||||
<!-- =========================================================== -->
|
<!-- =========================================================== -->
|
||||||
<Call name="addBean">
|
<Call name="addBean">
|
||||||
<Arg>
|
<Arg>
|
||||||
|
@ -95,7 +79,7 @@
|
||||||
</Set>
|
</Set>
|
||||||
<Call name="setContextAttribute">
|
<Call name="setContextAttribute">
|
||||||
<Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
|
<Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
|
||||||
<Arg>.*/jsp-api-[^/]*\.jar$|.*/jsp-[^/]*\.jar$</Arg>
|
<Arg>.*/servlet-api-[^/]*\.jar$</Arg>
|
||||||
</Call>
|
</Call>
|
||||||
<!-- Providers of OSGi Apps -->
|
<!-- Providers of OSGi Apps -->
|
||||||
<Call name="addAppProvider">
|
<Call name="addAppProvider">
|
||||||
|
@ -126,8 +110,12 @@
|
||||||
<Set name="sendServerVersion">true</Set>
|
<Set name="sendServerVersion">true</Set>
|
||||||
<Set name="sendDateHeader">true</Set>
|
<Set name="sendDateHeader">true</Set>
|
||||||
<Set name="gracefulShutdown">1000</Set>
|
<Set name="gracefulShutdown">1000</Set>
|
||||||
|
<Set name="dumpAfterStart">false</Set>
|
||||||
|
<Set name="dumpBeforeStop">false</Set>
|
||||||
|
|
||||||
<!-- jetty-jndi by default -->
|
<!-- =========================================================== -->
|
||||||
|
<!-- Configure Jetty's JNDI impl by default -->
|
||||||
|
<!-- =========================================================== -->
|
||||||
<Call class="java.lang.System" name="setProperty">
|
<Call class="java.lang.System" name="setProperty">
|
||||||
<Arg>java.naming.factory.initial</Arg>
|
<Arg>java.naming.factory.initial</Arg>
|
||||||
<Arg><Property name="java.naming.factory.initial" default="org.eclipse.jetty.jndi.InitialContextFactory"/></Arg>
|
<Arg><Property name="java.naming.factory.initial" default="org.eclipse.jetty.jndi.InitialContextFactory"/></Arg>
|
||||||
|
|
|
@ -54,10 +54,6 @@
|
||||||
|
|
||||||
<!-- =========================================================== -->
|
<!-- =========================================================== -->
|
||||||
<!-- Configure the deployment manager -->
|
<!-- Configure the deployment manager -->
|
||||||
<!-- -->
|
|
||||||
<!-- Sets up 2 monitored dir app providers that are configured -->
|
|
||||||
<!-- to behave in a similaraly to the legacy ContextDeployer -->
|
|
||||||
<!-- and WebAppDeployer from previous versions of Jetty. -->
|
|
||||||
<!-- =========================================================== -->
|
<!-- =========================================================== -->
|
||||||
<Call name="addBean">
|
<Call name="addBean">
|
||||||
<Arg>
|
<Arg>
|
||||||
|
@ -67,7 +63,7 @@
|
||||||
</Set>
|
</Set>
|
||||||
<Call name="setContextAttribute">
|
<Call name="setContextAttribute">
|
||||||
<Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
|
<Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
|
||||||
<Arg>.*/jsp-api-[^/]*\.jar$|.*/jsp-[^/]*\.jar$</Arg>
|
<Arg>.*/servlet-api-[^/]*\.jar$</Arg>
|
||||||
</Call>
|
</Call>
|
||||||
<!-- Providers of OSGi Apps -->
|
<!-- Providers of OSGi Apps -->
|
||||||
<Call name="addAppProvider">
|
<Call name="addAppProvider">
|
||||||
|
@ -82,7 +78,7 @@
|
||||||
contain custom tag libraries (*.tld files)
|
contain custom tag libraries (*.tld files)
|
||||||
if those bundles don't exist or can't be loaded no errors or warning will be issued!
|
if those bundles don't exist or can't be loaded no errors or warning will be issued!
|
||||||
this default value is to plug the tld files of the reference implementation of JSF -->
|
this default value is to plug the tld files of the reference implementation of JSF -->
|
||||||
<Set name="tldBundles"><Property name="org.eclipse.jetty.osgi.tldsbundles"
|
<Set name="tldBundles"><Property name="org.eclipse.jetty.osgi.tldbundles"
|
||||||
default="javax.faces.jsf-impl" /></Set>
|
default="javax.faces.jsf-impl" /></Set>
|
||||||
</New>
|
</New>
|
||||||
</Arg>
|
</Arg>
|
||||||
|
@ -99,8 +95,12 @@
|
||||||
<Set name="sendServerVersion">true</Set>
|
<Set name="sendServerVersion">true</Set>
|
||||||
<Set name="sendDateHeader">true</Set>
|
<Set name="sendDateHeader">true</Set>
|
||||||
<Set name="gracefulShutdown">1000</Set>
|
<Set name="gracefulShutdown">1000</Set>
|
||||||
|
<Set name="dumpAfterStart">false</Set>
|
||||||
|
<Set name="dumpBeforeStop">false</Set>
|
||||||
|
|
||||||
<!-- jetty-jndi by default -->
|
<!-- =========================================================== -->
|
||||||
|
<!-- Configure Jetty's JNDI impl by default -->
|
||||||
|
<!-- =========================================================== -->
|
||||||
<Call class="java.lang.System" name="setProperty">
|
<Call class="java.lang.System" name="setProperty">
|
||||||
<Arg>java.naming.factory.initial</Arg>
|
<Arg>java.naming.factory.initial</Arg>
|
||||||
<Arg><Property name="java.naming.factory.initial" default="org.eclipse.jetty.jndi.InitialContextFactory"/></Arg>
|
<Arg><Property name="java.naming.factory.initial" default="org.eclipse.jetty.jndi.InitialContextFactory"/></Arg>
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
private static Logger __logger = Log.getLogger(WebBundleDeployerHelper.class.getName());
|
private static Logger __logger = Log.getLogger(WebBundleDeployerHelper.class.getName());
|
||||||
|
|
||||||
private static boolean INITIALIZED = false;
|
private static boolean INITIALIZED = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* By default set to: {@link DefaultBundleClassLoaderHelper}. It supports
|
* By default set to: {@link DefaultBundleClassLoaderHelper}. It supports
|
||||||
* equinox and apache-felix fragment bundles that are specific to an OSGi
|
* equinox and apache-felix fragment bundles that are specific to an OSGi
|
||||||
|
@ -168,16 +168,16 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public WebAppContext registerWebapplication(Bundle bundle,
|
public WebAppContext registerWebapplication(Bundle bundle,
|
||||||
String webappFolderPath, String contextPath, String extraClasspath,
|
String webappFolderPath, String contextPath, String extraClasspath,
|
||||||
String overrideBundleInstallLocation,
|
String overrideBundleInstallLocation,
|
||||||
String requireTldBundle, String webXmlPath,
|
String requireTldBundle, String webXmlPath,
|
||||||
String defaultWebXmlPath, WebAppContext webAppContext) throws Exception
|
String defaultWebXmlPath, WebAppContext webAppContext) throws Exception
|
||||||
{
|
{
|
||||||
File bundleInstall = overrideBundleInstallLocation == null?BUNDLE_FILE_LOCATOR_HELPER.getBundleInstallLocation(bundle):new File(
|
File bundleInstall = overrideBundleInstallLocation == null?BUNDLE_FILE_LOCATOR_HELPER.getBundleInstallLocation(bundle):new File(
|
||||||
overrideBundleInstallLocation);
|
overrideBundleInstallLocation);
|
||||||
File webapp = null;
|
File webapp = null;
|
||||||
URL baseWebappInstallURL = null;
|
URL baseWebappInstallURL = null;
|
||||||
|
|
||||||
if (webappFolderPath != null && webappFolderPath.length() != 0 && !webappFolderPath.equals("."))
|
if (webappFolderPath != null && webappFolderPath.length() != 0 && !webappFolderPath.equals("."))
|
||||||
{
|
{
|
||||||
if (webappFolderPath.startsWith("/") || webappFolderPath.startsWith("file:"))
|
if (webappFolderPath.startsWith("/") || webappFolderPath.startsWith("file:"))
|
||||||
|
@ -204,28 +204,28 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
if (baseWebappInstallURL == null && (webapp == null || !webapp.exists()))
|
if (baseWebappInstallURL == null && (webapp == null || !webapp.exists()))
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException("Unable to locate " + webappFolderPath + " inside "
|
throw new IllegalArgumentException("Unable to locate " + webappFolderPath + " inside "
|
||||||
+ (bundleInstall != null?bundleInstall.getAbsolutePath():"unlocated bundle '" + bundle.getSymbolicName() + "'"));
|
+ (bundleInstall != null?bundleInstall.getAbsolutePath():"unlocated bundle '" + bundle.getSymbolicName() + "'"));
|
||||||
}
|
}
|
||||||
if (baseWebappInstallURL == null && webapp != null)
|
if (baseWebappInstallURL == null && webapp != null)
|
||||||
{
|
{
|
||||||
baseWebappInstallURL = webapp.toURI().toURL();
|
baseWebappInstallURL = webapp.toURI().toURL();
|
||||||
}
|
}
|
||||||
return registerWebapplication(bundle,webappFolderPath,baseWebappInstallURL,contextPath,
|
return registerWebapplication(bundle,webappFolderPath,baseWebappInstallURL,contextPath,
|
||||||
extraClasspath,bundleInstall,requireTldBundle,webXmlPath,defaultWebXmlPath,webAppContext);
|
extraClasspath,bundleInstall,requireTldBundle,webXmlPath,defaultWebXmlPath,webAppContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.jetty.osgi.boot.internal.webapp.IWebBundleDeployerHelper#registerWebapplication(org.osgi.framework.Bundle, java.lang.String, java.io.File, java.lang.String, java.lang.String, java.io.File, java.lang.String, java.lang.String)
|
* @see org.eclipse.jetty.osgi.boot.internal.webapp.IWebBundleDeployerHelper#registerWebapplication(org.osgi.framework.Bundle, java.lang.String, java.io.File, java.lang.String, java.lang.String, java.io.File, java.lang.String, java.lang.String)
|
||||||
*/
|
*/
|
||||||
private WebAppContext registerWebapplication(Bundle contributor, String pathInBundleToWebApp,
|
private WebAppContext registerWebapplication(Bundle contributor, String pathInBundleToWebApp,
|
||||||
URL baseWebappInstallURL, String contextPath, String extraClasspath, File bundleInstall,
|
URL baseWebappInstallURL, String contextPath, String extraClasspath, File bundleInstall,
|
||||||
String requireTldBundle, String webXmlPath, String defaultWebXmlPath, WebAppContext context)
|
String requireTldBundle, String webXmlPath, String defaultWebXmlPath, WebAppContext context)
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
ClassLoader contextCl = Thread.currentThread().getContextClassLoader();
|
ClassLoader contextCl = Thread.currentThread().getContextClassLoader();
|
||||||
String[] oldServerClasses = null;
|
String[] oldServerClasses = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// make sure we provide access to all the jetty bundles by going
|
// make sure we provide access to all the jetty bundles by going
|
||||||
|
@ -277,13 +277,13 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
context.setDefaultsDescriptor(defaultWebXml.getAbsolutePath());
|
context.setDefaultsDescriptor(defaultWebXml.getAbsolutePath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//other parameters that might be defines on the OSGiAppProvider:
|
//other parameters that might be defines on the OSGiAppProvider:
|
||||||
context.setParentLoaderPriority(_wrapper.getOSGiAppProvider().isParentLoaderPriority());
|
context.setParentLoaderPriority(_wrapper.getOSGiAppProvider().isParentLoaderPriority());
|
||||||
|
|
||||||
configureWebappClassLoader(contributor,context,composite, requireTldBundle);
|
configureWebappClassLoader(contributor,context,composite, requireTldBundle);
|
||||||
configureWebAppContext(context,contributor,requireTldBundle);
|
configureWebAppContext(context,contributor,requireTldBundle);
|
||||||
|
|
||||||
|
|
||||||
// @see
|
// @see
|
||||||
// org.eclipse.jetty.webapp.JettyWebXmlConfiguration#configure(WebAppContext)
|
// org.eclipse.jetty.webapp.JettyWebXmlConfiguration#configure(WebAppContext)
|
||||||
|
@ -292,36 +292,36 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
// through the webapp classloader.
|
// through the webapp classloader.
|
||||||
oldServerClasses = context.getServerClasses();
|
oldServerClasses = context.getServerClasses();
|
||||||
context.setServerClasses(null);
|
context.setServerClasses(null);
|
||||||
|
|
||||||
_wrapper.getOSGiAppProvider().addContext(contributor,pathInBundleToWebApp,context);
|
_wrapper.getOSGiAppProvider().addContext(contributor,pathInBundleToWebApp,context);
|
||||||
|
|
||||||
//support for patch resources. ideally this should be done inside a configurator.
|
//support for patch resources. ideally this should be done inside a configurator.
|
||||||
List<Resource> patchResources =
|
List<Resource> patchResources =
|
||||||
(List<Resource>)context.getAttribute(WebInfConfiguration.RESOURCE_URLS+".patch");
|
(List<Resource>)context.getAttribute(WebInfConfiguration.RESOURCE_URLS+".patch");
|
||||||
if (patchResources != null)
|
if (patchResources != null)
|
||||||
{
|
{
|
||||||
LinkedList<Resource> resourcesPath = new LinkedList<Resource>();
|
LinkedList<Resource> resourcesPath = new LinkedList<Resource>();
|
||||||
//place the patch resources at the beginning of the lookup path.
|
//place the patch resources at the beginning of the lookup path.
|
||||||
resourcesPath.addAll(patchResources);
|
resourcesPath.addAll(patchResources);
|
||||||
//then place the ones from the host web bundle.
|
//then place the ones from the host web bundle.
|
||||||
Resource hostResources = context.getBaseResource();
|
Resource hostResources = context.getBaseResource();
|
||||||
if (hostResources instanceof ResourceCollection)
|
if (hostResources instanceof ResourceCollection)
|
||||||
{
|
{
|
||||||
for (Resource re : ((ResourceCollection)hostResources).getResources())
|
for (Resource re : ((ResourceCollection)hostResources).getResources())
|
||||||
{
|
{
|
||||||
resourcesPath.add(re);
|
resourcesPath.add(re);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
resourcesPath.add(hostResources);
|
resourcesPath.add(hostResources);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResourceCollection rc = new ResourceCollection(resourcesPath.toArray(
|
ResourceCollection rc = new ResourceCollection(resourcesPath.toArray(
|
||||||
new Resource[resourcesPath.size()]));
|
new Resource[resourcesPath.size()]));
|
||||||
context.setBaseResource(rc);
|
context.setBaseResource(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -347,8 +347,8 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
* @see org.eclipse.jetty.osgi.boot.internal.webapp.IWebBundleDeployerHelper#registerContext(org.osgi.framework.Bundle, java.lang.String, java.lang.String, java.lang.String)
|
* @see org.eclipse.jetty.osgi.boot.internal.webapp.IWebBundleDeployerHelper#registerContext(org.osgi.framework.Bundle, java.lang.String, java.lang.String, java.lang.String)
|
||||||
*/
|
*/
|
||||||
public ContextHandler registerContext(Bundle contributor, String contextFileRelativePath, String extraClasspath,
|
public ContextHandler registerContext(Bundle contributor, String contextFileRelativePath, String extraClasspath,
|
||||||
String overrideBundleInstallLocation, String requireTldBundle, ContextHandler handler)
|
String overrideBundleInstallLocation, String requireTldBundle, ContextHandler handler)
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
File contextsHome = _wrapper.getOSGiAppProvider().getContextXmlDirAsFile();
|
File contextsHome = _wrapper.getOSGiAppProvider().getContextXmlDirAsFile();
|
||||||
if (contextsHome != null)
|
if (contextsHome != null)
|
||||||
|
@ -357,12 +357,12 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
if (prodContextFile.exists())
|
if (prodContextFile.exists())
|
||||||
{
|
{
|
||||||
return registerContext(contributor,contextFileRelativePath,prodContextFile,extraClasspath,
|
return registerContext(contributor,contextFileRelativePath,prodContextFile,extraClasspath,
|
||||||
overrideBundleInstallLocation,requireTldBundle,handler);
|
overrideBundleInstallLocation,requireTldBundle,handler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File rootFolder = overrideBundleInstallLocation != null
|
File rootFolder = overrideBundleInstallLocation != null
|
||||||
? Resource.newResource(overrideBundleInstallLocation).getFile()
|
? Resource.newResource(overrideBundleInstallLocation).getFile()
|
||||||
: BUNDLE_FILE_LOCATOR_HELPER.getBundleInstallLocation(contributor);
|
: BUNDLE_FILE_LOCATOR_HELPER.getBundleInstallLocation(contributor);
|
||||||
File contextFile = rootFolder != null?new File(rootFolder,contextFileRelativePath):null;
|
File contextFile = rootFolder != null?new File(rootFolder,contextFileRelativePath):null;
|
||||||
if (contextFile != null && contextFile.exists())
|
if (contextFile != null && contextFile.exists())
|
||||||
{
|
{
|
||||||
|
@ -378,7 +378,7 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
{
|
{
|
||||||
contextFileRelativePath = "/" + contextFileRelativePath;
|
contextFileRelativePath = "/" + contextFileRelativePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
URL contextURL = contributor.getEntry(contextFileRelativePath);
|
URL contextURL = contributor.getEntry(contextFileRelativePath);
|
||||||
if (contextURL != null)
|
if (contextURL != null)
|
||||||
{
|
{
|
||||||
|
@ -386,7 +386,7 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
return registerContext(contributor,contextFileRelativePath,r.getInputStream(),extraClasspath,overrideBundleInstallLocation,requireTldBundle,handler);
|
return registerContext(contributor,contextFileRelativePath,r.getInputStream(),extraClasspath,overrideBundleInstallLocation,requireTldBundle,handler);
|
||||||
}
|
}
|
||||||
throw new IllegalArgumentException("Could not find the context " + "file " + contextFileRelativePath + " for the bundle "
|
throw new IllegalArgumentException("Could not find the context " + "file " + contextFileRelativePath + " for the bundle "
|
||||||
+ contributor.getSymbolicName() + (overrideBundleInstallLocation != null?" using the install location " + overrideBundleInstallLocation:""));
|
+ contributor.getSymbolicName() + (overrideBundleInstallLocation != null?" using the install location " + overrideBundleInstallLocation:""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -401,21 +401,21 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private ContextHandler registerContext(Bundle contributor, String pathInBundle, File contextFile,
|
private ContextHandler registerContext(Bundle contributor, String pathInBundle, File contextFile,
|
||||||
String extraClasspath, String overrideBundleInstallLocation,
|
String extraClasspath, String overrideBundleInstallLocation,
|
||||||
String requireTldBundle, ContextHandler handler) throws Exception
|
String requireTldBundle, ContextHandler handler) throws Exception
|
||||||
{
|
{
|
||||||
InputStream contextFileInputStream = null;
|
InputStream contextFileInputStream = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
contextFileInputStream = new BufferedInputStream(new FileInputStream(contextFile));
|
contextFileInputStream = new BufferedInputStream(new FileInputStream(contextFile));
|
||||||
return registerContext(contributor, pathInBundle, contextFileInputStream,
|
return registerContext(contributor, pathInBundle, contextFileInputStream,
|
||||||
extraClasspath,overrideBundleInstallLocation,requireTldBundle,handler);
|
extraClasspath,overrideBundleInstallLocation,requireTldBundle,handler);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
IO.close(contextFileInputStream);
|
IO.close(contextFileInputStream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param contributor
|
* @param contributor
|
||||||
|
@ -425,10 +425,10 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private ContextHandler registerContext(Bundle contributor,
|
private ContextHandler registerContext(Bundle contributor,
|
||||||
String pathInsideBundle, InputStream contextFileInputStream,
|
String pathInsideBundle, InputStream contextFileInputStream,
|
||||||
String extraClasspath, String overrideBundleInstallLocation,
|
String extraClasspath, String overrideBundleInstallLocation,
|
||||||
String requireTldBundle, ContextHandler handler)
|
String requireTldBundle, ContextHandler handler)
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
ClassLoader contextCl = Thread.currentThread().getContextClassLoader();
|
ClassLoader contextCl = Thread.currentThread().getContextClassLoader();
|
||||||
String[] oldServerClasses = null;
|
String[] oldServerClasses = null;
|
||||||
|
@ -443,8 +443,8 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
// that the contributor gives access to.
|
// that the contributor gives access to.
|
||||||
Thread.currentThread().setContextClassLoader(composite);
|
Thread.currentThread().setContextClassLoader(composite);
|
||||||
ContextHandler context = createContextHandler(handler, contributor,
|
ContextHandler context = createContextHandler(handler, contributor,
|
||||||
contextFileInputStream,extraClasspath,
|
contextFileInputStream,extraClasspath,
|
||||||
overrideBundleInstallLocation,requireTldBundle);
|
overrideBundleInstallLocation,requireTldBundle);
|
||||||
if (context == null)
|
if (context == null)
|
||||||
{
|
{
|
||||||
return null;// did not happen
|
return null;// did not happen
|
||||||
|
@ -454,7 +454,7 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
// that there
|
// that there
|
||||||
// was at least one such handler for webapps.
|
// was at least one such handler for webapps.
|
||||||
//the actual registration must happen via the new Deployment API.
|
//the actual registration must happen via the new Deployment API.
|
||||||
// _ctxtHandler.addHandler(context);
|
// _ctxtHandler.addHandler(context);
|
||||||
|
|
||||||
configureWebappClassLoader(contributor,context,composite, requireTldBundle);
|
configureWebappClassLoader(contributor,context,composite, requireTldBundle);
|
||||||
if (context instanceof WebAppContext)
|
if (context instanceof WebAppContext)
|
||||||
|
@ -486,8 +486,8 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
* <code>// configure it</code>
|
* <code>// configure it</code>
|
||||||
*/
|
*/
|
||||||
protected void configureWebAppContext(ContextHandler wah, Bundle contributor,
|
protected void configureWebAppContext(ContextHandler wah, Bundle contributor,
|
||||||
String requireTldBundle) throws IOException
|
String requireTldBundle) throws IOException
|
||||||
{
|
{
|
||||||
// rfc66
|
// rfc66
|
||||||
wah.setAttribute(OSGiWebappConstants.RFC66_OSGI_BUNDLE_CONTEXT,contributor.getBundleContext());
|
wah.setAttribute(OSGiWebappConstants.RFC66_OSGI_BUNDLE_CONTEXT,contributor.getBundleContext());
|
||||||
|
|
||||||
|
@ -496,12 +496,12 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
//org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext
|
//org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext
|
||||||
//then we need to do this to:
|
//then we need to do this to:
|
||||||
wah.setAttribute("org.springframework.osgi.web." + BundleContext.class.getName(),
|
wah.setAttribute("org.springframework.osgi.web." + BundleContext.class.getName(),
|
||||||
contributor.getBundleContext());
|
contributor.getBundleContext());
|
||||||
|
|
||||||
//also pass the bundle directly. sometimes a bundle does not have a bundlecontext.
|
//also pass the bundle directly. sometimes a bundle does not have a bundlecontext.
|
||||||
//it is still useful to have access to the Bundle from the servlet context.
|
//it is still useful to have access to the Bundle from the servlet context.
|
||||||
wah.setAttribute(OSGiWebappConstants.JETTY_OSGI_BUNDLE, contributor);
|
wah.setAttribute(OSGiWebappConstants.JETTY_OSGI_BUNDLE, contributor);
|
||||||
|
|
||||||
//pass the value of the require tld bundle so that the TagLibOSGiConfiguration
|
//pass the value of the require tld bundle so that the TagLibOSGiConfiguration
|
||||||
//can pick it up.
|
//can pick it up.
|
||||||
wah.setAttribute(OSGiWebappConstants.REQUIRE_TLD_BUNDLE, requireTldBundle);
|
wah.setAttribute(OSGiWebappConstants.REQUIRE_TLD_BUNDLE, requireTldBundle);
|
||||||
|
@ -513,7 +513,7 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
((WebAppContext)wah).setConfigurationClasses(_wrapper.getOSGiAppProvider().getConfigurationClasses());
|
((WebAppContext)wah).setConfigurationClasses(_wrapper.getOSGiAppProvider().getConfigurationClasses());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Bundle[] fragments = PackageAdminServiceTracker.INSTANCE.getFragmentsAndRequiredBundles(contributor);
|
Bundle[] fragments = PackageAdminServiceTracker.INSTANCE.getFragmentsAndRequiredBundles(contributor);
|
||||||
if (fragments != null && fragments.length != 0)
|
if (fragments != null && fragments.length != 0)
|
||||||
{
|
{
|
||||||
|
@ -537,7 +537,7 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
if (fragUrl == null)
|
if (fragUrl == null)
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException("Unable to locate " + fragFolder + " inside "
|
throw new IllegalArgumentException("Unable to locate " + fragFolder + " inside "
|
||||||
+ " the fragment '" + frag.getSymbolicName() + "'");
|
+ " the fragment '" + frag.getSymbolicName() + "'");
|
||||||
}
|
}
|
||||||
fragUrl = DefaultFileLocatorHelper.getLocalURL(fragUrl);
|
fragUrl = DefaultFileLocatorHelper.getLocalURL(fragUrl);
|
||||||
String key = fragFolder.startsWith("/") ? fragFolder.substring(1) : fragFolder;
|
String key = fragFolder.startsWith("/") ? fragFolder.substring(1) : fragFolder;
|
||||||
|
@ -549,7 +549,7 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
if (patchFragUrl == null)
|
if (patchFragUrl == null)
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException("Unable to locate " + patchFragUrl + " inside "
|
throw new IllegalArgumentException("Unable to locate " + patchFragUrl + " inside "
|
||||||
+ " the fragment '" + frag.getSymbolicName() + "'");
|
+ " the fragment '" + frag.getSymbolicName() + "'");
|
||||||
}
|
}
|
||||||
patchFragUrl = DefaultFileLocatorHelper.getLocalURL(patchFragUrl);
|
patchFragUrl = DefaultFileLocatorHelper.getLocalURL(patchFragUrl);
|
||||||
String key = patchFragFolder.startsWith("/") ? patchFragFolder.substring(1) : patchFragFolder;
|
String key = patchFragFolder.startsWith("/") ? patchFragFolder.substring(1) : patchFragFolder;
|
||||||
|
@ -558,93 +558,93 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
}
|
}
|
||||||
if (!appendedResourcesPath.isEmpty())
|
if (!appendedResourcesPath.isEmpty())
|
||||||
{
|
{
|
||||||
wah.setAttribute(WebInfConfiguration.RESOURCE_URLS, new ArrayList<Resource>(appendedResourcesPath.values()));
|
wah.setAttribute(WebInfConfiguration.RESOURCE_URLS, new ArrayList<Resource>(appendedResourcesPath.values()));
|
||||||
}
|
}
|
||||||
if (!patchResourcesPath.isEmpty())
|
if (!patchResourcesPath.isEmpty())
|
||||||
{
|
{
|
||||||
wah.setAttribute(WebInfConfiguration.RESOURCE_URLS + ".patch", new ArrayList<Resource>(patchResourcesPath.values()));
|
wah.setAttribute(WebInfConfiguration.RESOURCE_URLS + ".patch", new ArrayList<Resource>(patchResourcesPath.values()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wah instanceof WebAppContext)
|
if (wah instanceof WebAppContext)
|
||||||
{
|
{
|
||||||
//This is the equivalent of what MetaInfConfiguration does. For OSGi bundles without the JarScanner
|
//This is the equivalent of what MetaInfConfiguration does. For OSGi bundles without the JarScanner
|
||||||
WebAppContext webappCtxt = (WebAppContext)wah;
|
WebAppContext webappCtxt = (WebAppContext)wah;
|
||||||
//take care of the web-fragments, meta-inf resources and tld resources:
|
//take care of the web-fragments, meta-inf resources and tld resources:
|
||||||
//similar to what MetaInfConfiguration does.
|
//similar to what MetaInfConfiguration does.
|
||||||
List<Resource> frags = (List<Resource>)wah.getAttribute(FragmentConfiguration.FRAGMENT_RESOURCES);
|
List<Resource> frags = (List<Resource>)wah.getAttribute(FragmentConfiguration.FRAGMENT_RESOURCES);
|
||||||
List<Resource> resfrags = (List<Resource>)wah.getAttribute(WebInfConfiguration.RESOURCE_URLS);
|
List<Resource> resfrags = (List<Resource>)wah.getAttribute(WebInfConfiguration.RESOURCE_URLS);
|
||||||
List<Resource> tldfrags = (List<Resource>)wah.getAttribute(TagLibConfiguration.TLD_RESOURCES);
|
List<Resource> tldfrags = (List<Resource>)wah.getAttribute(TagLibConfiguration.TLD_RESOURCES);
|
||||||
for (Bundle frag : fragments)
|
for (Bundle frag : fragments)
|
||||||
{
|
{
|
||||||
URL webFrag = frag.getEntry("/META-INF/web-fragment.xml");
|
URL webFrag = frag.getEntry("/META-INF/web-fragment.xml");
|
||||||
Enumeration<URL> resEnum = frag.findEntries("/META-INF/resources", "*", true);
|
Enumeration<URL> resEnum = frag.findEntries("/META-INF/resources", "*", true);
|
||||||
Enumeration<URL> tldEnum = frag.findEntries("/META-INF", "*.tld", false);
|
Enumeration<URL> tldEnum = frag.findEntries("/META-INF", "*.tld", false);
|
||||||
if (webFrag != null || (resEnum != null && resEnum.hasMoreElements())
|
if (webFrag != null || (resEnum != null && resEnum.hasMoreElements())
|
||||||
|| (tldEnum != null && tldEnum.hasMoreElements()))
|
|| (tldEnum != null && tldEnum.hasMoreElements()))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
File fragFile = BUNDLE_FILE_LOCATOR_HELPER.getBundleInstallLocation(frag);
|
File fragFile = BUNDLE_FILE_LOCATOR_HELPER.getBundleInstallLocation(frag);
|
||||||
//add it to the webinf jars collection:
|
//add it to the webinf jars collection:
|
||||||
//no need to check that it was not there yet: it was not there yet for sure.
|
//no need to check that it was not there yet: it was not there yet for sure.
|
||||||
Resource fragFileAsResource = Resource.newResource(fragFile.toURI());
|
Resource fragFileAsResource = Resource.newResource(fragFile.toURI());
|
||||||
webappCtxt.getMetaData().addWebInfJar(fragFileAsResource);
|
webappCtxt.getMetaData().addWebInfJar(fragFileAsResource);
|
||||||
|
|
||||||
if (webFrag != null)
|
if (webFrag != null)
|
||||||
{
|
{
|
||||||
if (frags == null)
|
if (frags == null)
|
||||||
{
|
{
|
||||||
frags = new ArrayList<Resource>();
|
frags = new ArrayList<Resource>();
|
||||||
wah.setAttribute(FragmentConfiguration.FRAGMENT_RESOURCES, frags);
|
wah.setAttribute(FragmentConfiguration.FRAGMENT_RESOURCES, frags);
|
||||||
}
|
}
|
||||||
frags.add(fragFileAsResource);
|
frags.add(fragFileAsResource);
|
||||||
}
|
}
|
||||||
if (resEnum != null && resEnum.hasMoreElements())
|
if (resEnum != null && resEnum.hasMoreElements())
|
||||||
{
|
{
|
||||||
URL resourcesEntry = frag.getEntry("/META-INF/resources/");
|
URL resourcesEntry = frag.getEntry("/META-INF/resources/");
|
||||||
if (resourcesEntry == null)
|
if (resourcesEntry == null)
|
||||||
{
|
{
|
||||||
//probably we found some fragments to a bundle.
|
//probably we found some fragments to a bundle.
|
||||||
//those are already contributed.
|
//those are already contributed.
|
||||||
//so we skip this.
|
//so we skip this.
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (resfrags == null)
|
if (resfrags == null)
|
||||||
{
|
{
|
||||||
resfrags = new ArrayList<Resource>();
|
resfrags = new ArrayList<Resource>();
|
||||||
wah.setAttribute(WebInfConfiguration.RESOURCE_URLS, resfrags);
|
wah.setAttribute(WebInfConfiguration.RESOURCE_URLS, resfrags);
|
||||||
}
|
}
|
||||||
resfrags.add(Resource.newResource(
|
resfrags.add(Resource.newResource(
|
||||||
DefaultFileLocatorHelper.getLocalURL(resourcesEntry)));
|
DefaultFileLocatorHelper.getLocalURL(resourcesEntry)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (tldEnum != null && tldEnum.hasMoreElements())
|
if (tldEnum != null && tldEnum.hasMoreElements())
|
||||||
{
|
{
|
||||||
if (tldfrags == null)
|
if (tldfrags == null)
|
||||||
{
|
{
|
||||||
tldfrags = new ArrayList<Resource>();
|
tldfrags = new ArrayList<Resource>();
|
||||||
wah.setAttribute(TagLibConfiguration.TLD_RESOURCES, tldfrags);
|
wah.setAttribute(TagLibConfiguration.TLD_RESOURCES, tldfrags);
|
||||||
}
|
}
|
||||||
while (tldEnum.hasMoreElements())
|
while (tldEnum.hasMoreElements())
|
||||||
{
|
{
|
||||||
URL tldUrl = tldEnum.nextElement();
|
URL tldUrl = tldEnum.nextElement();
|
||||||
tldfrags.add(Resource.newResource(
|
tldfrags.add(Resource.newResource(
|
||||||
DefaultFileLocatorHelper.getLocalURL(tldUrl)));
|
DefaultFileLocatorHelper.getLocalURL(tldUrl)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
__logger.warn("Unable to locate the bundle " + frag.getBundleId(),e);
|
__logger.warn("Unable to locate the bundle " + frag.getBundleId(),e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @See {@link ContextDeployer#scan}
|
* @See {@link ContextDeployer#scan}
|
||||||
|
@ -652,14 +652,14 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected ContextHandler createContextHandler(ContextHandler handlerToConfigure,
|
protected ContextHandler createContextHandler(ContextHandler handlerToConfigure,
|
||||||
Bundle bundle, File contextFile, String extraClasspath,
|
Bundle bundle, File contextFile, String extraClasspath,
|
||||||
String overrideBundleInstallLocation, String requireTldBundle)
|
String overrideBundleInstallLocation, String requireTldBundle)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return createContextHandler(handlerToConfigure,bundle,
|
return createContextHandler(handlerToConfigure,bundle,
|
||||||
new BufferedInputStream(new FileInputStream(contextFile)),
|
new BufferedInputStream(new FileInputStream(contextFile)),
|
||||||
extraClasspath,overrideBundleInstallLocation,requireTldBundle);
|
extraClasspath,overrideBundleInstallLocation,requireTldBundle);
|
||||||
}
|
}
|
||||||
catch (FileNotFoundException e)
|
catch (FileNotFoundException e)
|
||||||
{
|
{
|
||||||
|
@ -675,8 +675,8 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
protected ContextHandler createContextHandler(ContextHandler handlerToConfigure,
|
protected ContextHandler createContextHandler(ContextHandler handlerToConfigure,
|
||||||
Bundle bundle, InputStream contextInputStream, String extraClasspath,
|
Bundle bundle, InputStream contextInputStream, String extraClasspath,
|
||||||
String overrideBundleInstallLocation, String requireTldBundle)
|
String overrideBundleInstallLocation, String requireTldBundle)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Do something identical to what the ContextProvider would have done:
|
* Do something identical to what the ContextProvider would have done:
|
||||||
|
@ -694,7 +694,7 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
XmlConfiguration xmlConfiguration = new XmlConfiguration(contextInputStream);
|
XmlConfiguration xmlConfiguration = new XmlConfiguration(contextInputStream);
|
||||||
HashMap properties = new HashMap();
|
HashMap properties = new HashMap();
|
||||||
properties.put("Server",_wrapper.getServer());
|
properties.put("Server",_wrapper.getServer());
|
||||||
|
|
||||||
// insert the bundle's location as a property.
|
// insert the bundle's location as a property.
|
||||||
setThisBundleHomeProperty(bundle,properties,overrideBundleInstallLocation);
|
setThisBundleHomeProperty(bundle,properties,overrideBundleInstallLocation);
|
||||||
xmlConfiguration.getProperties().putAll(properties);
|
xmlConfiguration.getProperties().putAll(properties);
|
||||||
|
@ -709,7 +709,7 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
xmlConfiguration.configure(handlerToConfigure);
|
xmlConfiguration.configure(handlerToConfigure);
|
||||||
context = handlerToConfigure;
|
context = handlerToConfigure;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context instanceof WebAppContext)
|
if (context instanceof WebAppContext)
|
||||||
{
|
{
|
||||||
((WebAppContext)context).setExtraClasspath(extraClasspath);
|
((WebAppContext)context).setExtraClasspath(extraClasspath);
|
||||||
|
@ -805,7 +805,7 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
// if this is a real webapp we will set it on it a bit later: once we
|
// if this is a real webapp we will set it on it a bit later: once we
|
||||||
// know.
|
// know.
|
||||||
OSGiWebappClassLoader webappClassLoader = new OSGiWebappClassLoader(
|
OSGiWebappClassLoader webappClassLoader = new OSGiWebappClassLoader(
|
||||||
_wrapper.getParentClassLoaderForWebapps(),new WebAppContext(),contributor,BUNDLE_CLASS_LOADER_HELPER);
|
_wrapper.getParentClassLoaderForWebapps(),new WebAppContext(),contributor,BUNDLE_CLASS_LOADER_HELPER);
|
||||||
/* DEBUG
|
/* DEBUG
|
||||||
try {
|
try {
|
||||||
Class c = webappClassLoader.loadClass("org.glassfish.jsp.api.ResourceInjector");
|
Class c = webappClassLoader.loadClass("org.glassfish.jsp.api.ResourceInjector");
|
||||||
|
@ -817,7 +817,7 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
System.err.println("LOADED org.apache.jasper.xmlparser.ParserUtils from "+c.getClassLoader());
|
System.err.println("LOADED org.apache.jasper.xmlparser.ParserUtils from "+c.getClassLoader());
|
||||||
}
|
}
|
||||||
catch (Exception e) {e.printStackTrace();}
|
catch (Exception e) {e.printStackTrace();}
|
||||||
*/
|
*/
|
||||||
return webappClassLoader;
|
return webappClassLoader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -831,7 +831,7 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
File location = overrideBundleInstallLocation != null?new File(overrideBundleInstallLocation):BUNDLE_FILE_LOCATOR_HELPER
|
File location = overrideBundleInstallLocation != null?new File(overrideBundleInstallLocation):BUNDLE_FILE_LOCATOR_HELPER
|
||||||
.getBundleInstallLocation(bundle);
|
.getBundleInstallLocation(bundle);
|
||||||
properties.put("this.bundle.install",location.getCanonicalPath());
|
properties.put("this.bundle.install",location.getCanonicalPath());
|
||||||
properties.put("this.bundle.install.url",bundle.getEntry("/").toString());
|
properties.put("this.bundle.install.url",bundle.getEntry("/").toString());
|
||||||
}
|
}
|
||||||
|
@ -841,7 +841,7 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private String getPathsToRequiredBundles (ContextHandler context, String requireTldBundle) throws Exception
|
private String getPathsToRequiredBundles (ContextHandler context, String requireTldBundle) throws Exception
|
||||||
{
|
{
|
||||||
if (requireTldBundle == null)
|
if (requireTldBundle == null)
|
||||||
|
@ -851,7 +851,7 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
Bundle bundle = (Bundle)context.getAttribute(OSGiWebappConstants.JETTY_OSGI_BUNDLE);
|
Bundle bundle = (Bundle)context.getAttribute(OSGiWebappConstants.JETTY_OSGI_BUNDLE);
|
||||||
PackageAdmin packAdmin = getBundleAdmin();
|
PackageAdmin packAdmin = getBundleAdmin();
|
||||||
DefaultFileLocatorHelper fileLocatorHelper = new DefaultFileLocatorHelper();
|
DefaultFileLocatorHelper fileLocatorHelper = new DefaultFileLocatorHelper();
|
||||||
|
|
||||||
String[] symbNames = requireTldBundle.split(", ");
|
String[] symbNames = requireTldBundle.split(", ");
|
||||||
|
|
||||||
for (String symbName : symbNames)
|
for (String symbName : symbNames)
|
||||||
|
@ -866,11 +866,10 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
||||||
+ bundle.getSymbolicName());
|
+ bundle.getSymbolicName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
File f = fileLocatorHelper.getBundleInstallLocation(bs[0]);
|
File f = fileLocatorHelper.getBundleInstallLocation(bs[0]);
|
||||||
if (paths.length() > 0)
|
if (paths.length() > 0)
|
||||||
paths.append(", ");
|
paths.append(", ");
|
||||||
System.err.println("getPathsToRequiredBundles: bundle path="+bs[0].getLocation()+" uri="+f.toURI());
|
|
||||||
paths.append(f.toURI().toURL().toString());
|
paths.append(f.toURI().toURL().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,20 +3,20 @@ Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: Console
|
Bundle-Name: Console
|
||||||
Bundle-SymbolicName: org.eclipse.jetty.osgi.equinoxtools
|
Bundle-SymbolicName: org.eclipse.jetty.osgi.equinoxtools
|
||||||
Bundle-Description: Example application: equinox console accesssible on the web
|
Bundle-Description: Example application: equinox console accesssible on the web
|
||||||
Bundle-Version: 8.1.2.qualifier
|
Bundle-Version: 8.1.3.qualifier
|
||||||
Bundle-Activator: org.eclipse.jetty.osgi.equinoxtools.WebEquinoxToolsActivator
|
Bundle-Activator: org.eclipse.jetty.osgi.equinoxtools.WebEquinoxToolsActivator
|
||||||
Import-Package: javax.servlet;version="2.5.0",
|
Import-Package: javax.servlet;version="2.5.0",
|
||||||
javax.servlet.http;version="2.5.0",
|
javax.servlet.http;version="2.5.0",
|
||||||
org.eclipse.jetty.continuation;version="8.1.2",
|
org.eclipse.jetty.continuation;version="8.1.3",
|
||||||
org.eclipse.jetty.io;version="8.1.2",
|
org.eclipse.jetty.io;version="8.1.3",
|
||||||
org.eclipse.jetty.util;version="8.1.2",
|
org.eclipse.jetty.util;version="8.1.3",
|
||||||
org.eclipse.jetty.util.log;version="8.1.2",
|
org.eclipse.jetty.util.log;version="8.1.3",
|
||||||
org.eclipse.jetty.websocket;version="8.1.2",
|
org.eclipse.jetty.websocket;version="8.1.3",
|
||||||
org.eclipse.osgi.framework.console;version="1.1.0",
|
org.eclipse.osgi.framework.console;version="1.1.0",
|
||||||
org.osgi.framework;version="1.3.0",
|
org.osgi.framework;version="1.3.0",
|
||||||
org.osgi.service.http;version="1.2.0",
|
org.osgi.service.http;version="1.2.0",
|
||||||
org.osgi.util.tracker;version="1.3.0"
|
org.osgi.util.tracker;version="1.3.0"
|
||||||
Export-Package: org.eclipse.jetty.osgi.equinoxtools;x-internal:=true;version="8.1.2",
|
Export-Package: org.eclipse.jetty.osgi.equinoxtools;x-internal:=true;version="8.1.3",
|
||||||
org.eclipse.jetty.osgi.equinoxtools.console;x-internal:=true;version="8.1.2"
|
org.eclipse.jetty.osgi.equinoxtools.console;x-internal:=true;version="8.1.3"
|
||||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
Bundle-RequiredExecutionEnvironment: J2SE-1.6
|
||||||
|
|
||||||
|
|
|
@ -2,15 +2,15 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: OSGi HttpService provided by equinox HttpServiceServlet deployed on jetty
|
Bundle-Name: OSGi HttpService provided by equinox HttpServiceServlet deployed on jetty
|
||||||
Bundle-SymbolicName: org.eclipse.jetty.osgi.httpservice
|
Bundle-SymbolicName: org.eclipse.jetty.osgi.httpservice
|
||||||
Bundle-Version: 8.1.2.qualifier
|
Bundle-Version: 8.1.3.qualifier
|
||||||
Bundle-Vendor: Mort Bay Consulting
|
Bundle-Vendor: Mort Bay Consulting
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Jetty-ContextFilePath: contexts/httpservice.xml
|
Jetty-ContextFilePath: contexts/httpservice.xml
|
||||||
Import-Package: javax.servlet;version="2.6.0",
|
Import-Package: javax.servlet;version="2.6.0",
|
||||||
javax.servlet.http;version="2.6.0",
|
javax.servlet.http;version="2.6.0",
|
||||||
org.eclipse.equinox.http.servlet,
|
org.eclipse.equinox.http.servlet,
|
||||||
org.eclipse.jetty.server;version="8.1.2",
|
org.eclipse.jetty.server;version="8.1.3",
|
||||||
org.eclipse.jetty.server.handler;version="8.1.2",
|
org.eclipse.jetty.server.handler;version="8.1.3",
|
||||||
org.eclipse.jetty.servlet;version="8.1.2",
|
org.eclipse.jetty.servlet;version="8.1.3",
|
||||||
org.eclipse.jetty.util.component;version="8.1.2"
|
org.eclipse.jetty.util.component;version="8.1.3"
|
||||||
Export-Package: org.eclipse.jetty.osgi.httpservice;version="8.1.2"
|
Export-Package: org.eclipse.jetty.osgi.httpservice;version="8.1.3"
|
||||||
|
|
Loading…
Reference in New Issue