diff --git a/apache-jsp/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration b/apache-jsp/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration deleted file mode 100644 index 5a52ca4a8ef..00000000000 --- a/apache-jsp/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration +++ /dev/null @@ -1 +0,0 @@ -org.eclipse.jetty.webapp.JspConfiguration diff --git a/jetty-jaas/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration b/jetty-jaas/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration deleted file mode 100644 index bcd8f3b50dc..00000000000 --- a/jetty-jaas/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration +++ /dev/null @@ -1 +0,0 @@ -org.eclipse.jetty.webapp.JaasConfiguration diff --git a/jetty-jndi/pom.xml b/jetty-jndi/pom.xml index de213dd80fb..ab90b181e80 100644 --- a/jetty-jndi/pom.xml +++ b/jetty-jndi/pom.xml @@ -31,13 +31,6 @@ - - org.codehaus.mojo - findbugs-maven-plugin - - org.eclipse.jetty.jndi.* - - diff --git a/jetty-jndi/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration b/jetty-jndi/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration deleted file mode 100644 index c77d2abdd26..00000000000 --- a/jetty-jndi/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration +++ /dev/null @@ -1 +0,0 @@ -org.eclipse.jetty.webapp.JndiConfiguration diff --git a/jetty-servlets/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration b/jetty-servlets/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration deleted file mode 100644 index 990aa4e2f8b..00000000000 --- a/jetty-servlets/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration +++ /dev/null @@ -1 +0,0 @@ -org.eclipse.jetty.webapp.ServletsConfiguration diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JaasConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JaasConfiguration.java index 85e7130fa71..8fbb3e4c3d2 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JaasConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JaasConfiguration.java @@ -20,6 +20,10 @@ package org.eclipse.jetty.webapp; import java.util.ServiceLoader; +import org.eclipse.jetty.util.Loader; +import org.eclipse.jetty.util.log.Log; +import org.eclipse.jetty.util.log.Logger; + /** *

JAAS Configuration

*

This configuration configures the WebAppContext server/system classes to @@ -32,10 +36,26 @@ import java.util.ServiceLoader; */ public class JaasConfiguration extends AbstractConfiguration { + private static final Logger LOG = Log.getLogger(JaasConfiguration.class); + public JaasConfiguration() { addDependencies(WebXmlConfiguration.class, MetaInfConfiguration.class, WebInfConfiguration.class, FragmentConfiguration.class); addDependents(WebAppConfiguration.class); protectAndExpose("org.eclipse.jetty.jaas."); } + + @Override + public boolean isAvailable() + { + try + { + return Loader.loadClass("org.eclipse.jetty.jaas.JAASLoginService")!=null; + } + catch (Throwable e) + { + LOG.ignore(e); + return false; + } + } } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JmxConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JmxConfiguration.java index c6d166d6146..76171590135 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JmxConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JmxConfiguration.java @@ -18,12 +18,12 @@ package org.eclipse.jetty.webapp; +import java.util.ServiceLoader; + import org.eclipse.jetty.util.Loader; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; -import java.util.ServiceLoader; - /** *

JMX Configuration

*

This configuration configures the WebAppContext server/system classes to @@ -55,7 +55,7 @@ public class JmxConfiguration extends AbstractConfiguration catch (Throwable e) { LOG.ignore(e); + return false; } - return false; } } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JndiConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JndiConfiguration.java index cb3c52d60db..ca726597402 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JndiConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JndiConfiguration.java @@ -20,6 +20,10 @@ package org.eclipse.jetty.webapp; import java.util.ServiceLoader; +import org.eclipse.jetty.util.Loader; +import org.eclipse.jetty.util.log.Log; +import org.eclipse.jetty.util.log.Logger; + /** *

JNDI Configuration

*

This configuration configures the WebAppContext system/server classes to @@ -32,10 +36,26 @@ import java.util.ServiceLoader; */ public class JndiConfiguration extends AbstractConfiguration { + private static final Logger LOG = Log.getLogger(JndiConfiguration.class); + public JndiConfiguration() { addDependencies(WebXmlConfiguration.class, MetaInfConfiguration.class, WebInfConfiguration.class, FragmentConfiguration.class); addDependents(WebAppConfiguration.class); protectAndExpose("org.eclipse.jetty.jndi."); } + + @Override + public boolean isAvailable() + { + try + { + return Loader.loadClass("org.eclipse.jetty.jndi.InitialContextFactory")!=null; + } + catch (Throwable e) + { + LOG.ignore(e); + return false; + } + } } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JspConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JspConfiguration.java index ea9827fdb9b..0e59f929ee8 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JspConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JspConfiguration.java @@ -20,6 +20,10 @@ package org.eclipse.jetty.webapp; import java.util.ServiceLoader; +import org.eclipse.jetty.util.Loader; +import org.eclipse.jetty.util.log.Log; +import org.eclipse.jetty.util.log.Logger; + /** *

JSP Configuration

*

This configuration configures the WebAppContext server/system classes to @@ -33,6 +37,8 @@ import java.util.ServiceLoader; */ public class JspConfiguration extends AbstractConfiguration { + private static final Logger LOG = Log.getLogger(JspConfiguration.class); + public JspConfiguration() { addDependencies(WebXmlConfiguration.class, MetaInfConfiguration.class, WebInfConfiguration.class, FragmentConfiguration.class); @@ -41,4 +47,18 @@ public class JspConfiguration extends AbstractConfiguration expose("org.eclipse.jetty.apache."); hide("org.eclipse.jdt."); } + + @Override + public boolean isAvailable() + { + try + { + return Loader.loadClass("org.eclipse.jetty.jsp.JettyJspServlet")!=null; + } + catch (Throwable e) + { + LOG.ignore(e); + return false; + } + } } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ServletsConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ServletsConfiguration.java index 2a6eb3961c0..3f4b6ac37f0 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ServletsConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/ServletsConfiguration.java @@ -18,6 +18,10 @@ package org.eclipse.jetty.webapp; +import org.eclipse.jetty.util.Loader; +import org.eclipse.jetty.util.log.Log; +import org.eclipse.jetty.util.log.Logger; + /** *

Jetty Servlets Configuration

*

This configuration configures the WebAppContext server/system classes to @@ -27,6 +31,8 @@ package org.eclipse.jetty.webapp; */ public class ServletsConfiguration extends AbstractConfiguration { + private static final Logger LOG = Log.getLogger(ServletsConfiguration.class); + public ServletsConfiguration() { addDependencies(WebXmlConfiguration.class, MetaInfConfiguration.class, WebInfConfiguration.class, WebAppConfiguration.class); @@ -37,4 +43,18 @@ public class ServletsConfiguration extends AbstractConfiguration ); expose("org.eclipse.jetty.servlets."); // don't hide jetty servlets } + + @Override + public boolean isAvailable() + { + try + { + return Loader.loadClass("org.eclipse.jetty.servlets.PushCacheFilter")!=null; + } + catch (Throwable e) + { + LOG.ignore(e); + return false; + } + } } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebSocketConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebSocketConfiguration.java index 7f6c343dca9..5a5b2852575 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebSocketConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebSocketConfiguration.java @@ -20,6 +20,10 @@ package org.eclipse.jetty.webapp; import java.util.ServiceLoader; +import org.eclipse.jetty.util.Loader; +import org.eclipse.jetty.util.log.Log; +import org.eclipse.jetty.util.log.Logger; + /** *

Websocket Configuration

*

This configuration configures the WebAppContext server/system classes to @@ -32,10 +36,26 @@ import java.util.ServiceLoader; */ public class WebSocketConfiguration extends AbstractConfiguration { + private static final Logger LOG = Log.getLogger(WebSocketConfiguration.class); + public WebSocketConfiguration() { addDependencies(WebXmlConfiguration.class, MetaInfConfiguration.class, WebInfConfiguration.class, FragmentConfiguration.class); addDependents("org.eclipse.jetty.annotations.AnnotationConfiguration", WebAppConfiguration.class.getName()); protectAndExpose("org.eclipse.jetty.websocket."); } + + @Override + public boolean isAvailable() + { + try + { + return Loader.loadClass("org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter")!=null; + } + catch (Throwable e) + { + LOG.ignore(e); + return false; + } + } } diff --git a/jetty-webapp/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration b/jetty-webapp/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration index 377ae88c198..b4e19283421 100644 --- a/jetty-webapp/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration +++ b/jetty-webapp/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration @@ -1,7 +1,12 @@ org.eclipse.jetty.webapp.FragmentConfiguration org.eclipse.jetty.webapp.JettyWebXmlConfiguration -org.eclipse.jetty.webapp.MetaInfConfiguration -org.eclipse.jetty.webapp.WebInfConfiguration -org.eclipse.jetty.webapp.WebXmlConfiguration -org.eclipse.jetty.webapp.WebAppConfiguration +org.eclipse.jetty.webapp.JaasConfiguration org.eclipse.jetty.webapp.JmxConfiguration +org.eclipse.jetty.webapp.JndiConfiguration +org.eclipse.jetty.webapp.JspConfiguration +org.eclipse.jetty.webapp.MetaInfConfiguration +org.eclipse.jetty.webapp.ServletsConfiguration +org.eclipse.jetty.webapp.WebAppConfiguration +org.eclipse.jetty.webapp.WebInfConfiguration +org.eclipse.jetty.webapp.WebSocketConfiguration +org.eclipse.jetty.webapp.WebXmlConfiguration diff --git a/jetty-websocket/websocket-server/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration b/jetty-websocket/websocket-server/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration deleted file mode 100644 index e1e4eb72b96..00000000000 --- a/jetty-websocket/websocket-server/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration +++ /dev/null @@ -1 +0,0 @@ -org.eclipse.jetty.webapp.WebSocketConfiguration