diff --git a/jetty-core/jetty-ee/src/main/java/org/eclipse/jetty/ee/WebAppClassLoading.java b/jetty-core/jetty-ee/src/main/java/org/eclipse/jetty/ee/WebAppClassLoading.java
index eaf13e52a64a..dcdac85af037 100644
--- a/jetty-core/jetty-ee/src/main/java/org/eclipse/jetty/ee/WebAppClassLoading.java
+++ b/jetty-core/jetty-ee/src/main/java/org/eclipse/jetty/ee/WebAppClassLoading.java
@@ -169,8 +169,9 @@ public static void addHiddenClasses(String... patterns)
* Add a hidden (server) Class pattern to use for all WebAppContexts of a given {@link Server}.
* @param attributes The {@link Attributes} instance to add classes to
* @param patterns the patterns to use
+ * @deprecated use {@link #addHiddenClasses(Server, String...)} instead
*/
- @Deprecated (forRemoval = true)
+ @Deprecated (since = "12.0.9", forRemoval = true)
public static void addHiddenClasses(Attributes attributes, String... patterns)
{
if (patterns != null && patterns.length > 0)
diff --git a/jetty-ee10/jetty-ee10-cdi/src/main/java/org/eclipse/jetty/ee10/cdi/CdiConfiguration.java b/jetty-ee10/jetty-ee10-cdi/src/main/java/org/eclipse/jetty/ee10/cdi/CdiConfiguration.java
index 07370998d8d1..32ed6ef47c4f 100644
--- a/jetty-ee10/jetty-ee10-cdi/src/main/java/org/eclipse/jetty/ee10/cdi/CdiConfiguration.java
+++ b/jetty-ee10/jetty-ee10-cdi/src/main/java/org/eclipse/jetty/ee10/cdi/CdiConfiguration.java
@@ -13,8 +13,6 @@
package org.eclipse.jetty.ee10.cdi;
-import java.util.function.Predicate;
-
import org.eclipse.jetty.ee10.annotations.AnnotationConfiguration;
import org.eclipse.jetty.ee10.plus.webapp.PlusConfiguration;
import org.eclipse.jetty.ee10.webapp.AbstractConfiguration;
@@ -33,11 +31,11 @@ public CdiConfiguration()
{
super(new Builder()
.protectAndExpose("org.eclipse.jetty.ee10.cdi.CdiServletContainerInitializer")
- .hide(getHiddenClasses())
+ .hide(getCdiHiddenClasses())
.addDependents(AnnotationConfiguration.class, PlusConfiguration.class));
}
- private static String[] getHiddenClasses()
+ private static String[] getCdiHiddenClasses()
{
//Only hide the cdi api classes if there is not also an impl on the
//environment classpath - vital for embedded uses.
@@ -45,4 +43,4 @@ private static String[] getHiddenClasses()
return new String[]{"jakarta.enterprise.", "jakarta.decorator."};
return new String[0];
}
-}
\ No newline at end of file
+}
diff --git a/jetty-ee10/jetty-ee10-webapp/src/main/java/org/eclipse/jetty/ee10/webapp/AbstractConfiguration.java b/jetty-ee10/jetty-ee10-webapp/src/main/java/org/eclipse/jetty/ee10/webapp/AbstractConfiguration.java
index 2db4056c8bd9..5929ce18aa1e 100644
--- a/jetty-ee10/jetty-ee10-webapp/src/main/java/org/eclipse/jetty/ee10/webapp/AbstractConfiguration.java
+++ b/jetty-ee10/jetty-ee10-webapp/src/main/java/org/eclipse/jetty/ee10/webapp/AbstractConfiguration.java
@@ -19,13 +19,15 @@
import java.util.Collections;
import java.util.List;
+import org.eclipse.jetty.util.ClassMatcher;
+
public class AbstractConfiguration implements Configuration
{
private final boolean _enabledByDefault;
private final List
Also since Jetty-9.4, Configurations are responsible for providing {@link #getServerClasses()} and - * {@link #getSystemClasses()} to configure the {@link WebAppClassLoader} for each context. + *
Also since Jetty-9.4, Configurations are responsible for providing {@link #getHiddenClasses()} and + * {@link #getHiddenClasses()} to configure the {@link WebAppClassLoader} for each context. *
*/ public interface Configuration @@ -93,25 +94,43 @@ default Collection
diff --git a/jetty-ee10/jetty-ee10-webapp/src/main/java/org/eclipse/jetty/ee10/webapp/WebAppClassLoader.java b/jetty-ee10/jetty-ee10-webapp/src/main/java/org/eclipse/jetty/ee10/webapp/WebAppClassLoader.java
index a1ad3d32d9af..82e14887a483 100644
--- a/jetty-ee10/jetty-ee10-webapp/src/main/java/org/eclipse/jetty/ee10/webapp/WebAppClassLoader.java
+++ b/jetty-ee10/jetty-ee10-webapp/src/main/java/org/eclipse/jetty/ee10/webapp/WebAppClassLoader.java
@@ -20,28 +20,24 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
-import java.nio.file.Files;
import java.nio.file.Path;
import java.security.CodeSource;
import java.security.PermissionCollection;
import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Comparator;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.stream.Stream;
import org.eclipse.jetty.util.ClassVisibilityChecker;
import org.eclipse.jetty.util.FileID;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.TypeUtil;
-import org.eclipse.jetty.util.URIUtil;
import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.util.resource.ResourceCollators;
import org.eclipse.jetty.util.resource.ResourceFactory;
@@ -115,9 +111,33 @@ public interface Context extends ClassVisibilityChecker
List
- * These classes/packages are used to implement the server and are hiddenClasses
+ * These classes/packages are used to implement the server and are hidden
* from the context. If the context needs to load these classes, it must have its
* own copy of them in WEB-INF/lib or WEB-INF/classes.
*
@@ -635,7 +635,7 @@ public void setHiddenClassMatcher(ClassMatcher hiddenClasses)
}
/**
- * Set the protected (aka system) classes patterns.
+ * Set the protected (system) classes patterns.
*
* These classes/packages are provided by the JVM and
* cannot be replaced by classes of the same name from WEB-INF,
@@ -680,7 +680,7 @@ public ClassMatcher getProtectedClassMatcher()
}
/**
- * @return The ClassMatcher used to match Server (hiddenClasses) classes
+ * @return The ClassMatcher used to match Server (hidden) classes
*/
public ClassMatcher getHiddenClassMatcher()
{
@@ -693,7 +693,7 @@ public String[] getProtectedClasses()
return _protectedClasses.getPatterns();
}
- @ManagedAttribute(value = "classes and packages hiddenClasses by the context classloader", readonly = true)
+ @ManagedAttribute(value = "classes and packages hidden by the context classloader", readonly = true)
public String[] getHiddenClasses()
{
return _hiddenClasses.getPatterns();
@@ -727,56 +727,54 @@ public boolean isProtectedResource(String name, URL url)
* @deprecated use {@link #setHiddenClassMatcher(ClassMatcher)}
*/
@Deprecated(since = "12.0.8", forRemoval = true)
- public void setServerClassMatcher(ClassMatcher serverClasses)
+ public void setServerClassMatcher(org.eclipse.jetty.ee10.webapp.ClassMatcher serverClasses)
{
- _hiddenClasses.clear();
- _hiddenClasses.add(serverClasses.getPatterns());
+ setHiddenClassMatcher(serverClasses);
}
/**
* @deprecated use {@link #setProtectedClassMatcher(ClassMatcher)}
*/
@Deprecated(since = "12.0.8", forRemoval = true)
- public void setSystemClassMatcher(ClassMatcher systemClasses)
+ public void setSystemClassMatcher(org.eclipse.jetty.ee10.webapp.ClassMatcher systemClasses)
{
- _protectedClasses.clear();
- _protectedClasses.add(systemClasses.getPatterns());
+ setProtectedClassMatcher(systemClasses);
}
/**
* @deprecated use {@link #addHiddenClassMatcher(ClassMatcher)}
*/
@Deprecated(since = "12.0.8", forRemoval = true)
- public void addServerClassMatcher(ClassMatcher serverClasses)
+ public void addServerClassMatcher(org.eclipse.jetty.ee10.webapp.ClassMatcher serverClasses)
{
- _hiddenClasses.add(serverClasses.getPatterns());
+ addHiddenClassMatcher(serverClasses);
}
/**
* @deprecated use {@link #addProtectedClassMatcher(ClassMatcher)}
*/
@Deprecated(since = "12.0.8", forRemoval = true)
- public void addSystemClassMatcher(ClassMatcher systemClasses)
+ public void addSystemClassMatcher(org.eclipse.jetty.ee10.webapp.ClassMatcher systemClasses)
{
- _protectedClasses.add(systemClasses.getPatterns());
+ addProtectedClassMatcher(systemClasses);
}
/**
* @deprecated use {@link #getProtectedClassMatcher()}
*/
@Deprecated(since = "12.0.8", forRemoval = true)
- public ClassMatcher getSystemClassMatcher()
+ public org.eclipse.jetty.ee10.webapp.ClassMatcher getSystemClassMatcher()
{
- return _protectedClasses;
+ return new org.eclipse.jetty.ee10.webapp.ClassMatcher(getProtectedClassMatcher());
}
/**
* @deprecated use {@link #getHiddenClassMatcher()}
*/
@Deprecated(since = "12.0.8", forRemoval = true)
- public ClassMatcher getServerClassMatcher()
+ public org.eclipse.jetty.ee10.webapp.ClassMatcher getServerClassMatcher()
{
- return _hiddenClasses;
+ return new org.eclipse.jetty.ee10.webapp.ClassMatcher(getHiddenClassMatcher());
}
/**
@@ -785,7 +783,7 @@ public ClassMatcher getServerClassMatcher()
@Deprecated(since = "12.0.8", forRemoval = true)
public String[] getSystemClasses()
{
- return _protectedClasses.getPatterns();
+ return getProtectedClasses();
}
/**
@@ -794,7 +792,7 @@ public String[] getSystemClasses()
@Deprecated(since = "12.0.8", forRemoval = true)
public String[] getServerClasses()
{
- return _hiddenClasses.getPatterns();
+ return getHiddenClasses();
}
/**
@@ -803,7 +801,7 @@ public String[] getServerClasses()
@Deprecated(since = "12.0.8", forRemoval = true)
public boolean isServerClass(Class> clazz)
{
- return _hiddenClasses.match(clazz);
+ return isHiddenClass(clazz);
}
/**
@@ -812,25 +810,7 @@ public boolean isServerClass(Class> clazz)
@Deprecated(since = "12.0.8", forRemoval = true)
public boolean isSystemClass(Class> clazz)
{
- return _protectedClasses.match(clazz);
- }
-
- /**
- * @deprecated use {@link #isHiddenResource(String, URL)}
- */
- @Deprecated(since = "12.0.8", forRemoval = true)
- public boolean isServerResource(String name, URL url)
- {
- return _hiddenClasses.match(name, url);
- }
-
- /**
- * @deprecated use {@link #isProtectedResource(String, URL)}
- */
- @Deprecated(since = "12.0.8", forRemoval = true)
- public boolean isSystemResource(String name, URL url)
- {
- return _protectedClasses.match(name, url);
+ return isProtectedClass(clazz);
}
@Override
diff --git a/jetty-ee9/jetty-ee9-demos/jetty-ee9-demo-proxy-webapp/src/test/java/org/eclipse/jetty/ee9/demos/ProxyWebAppTest.java b/jetty-ee9/jetty-ee9-demos/jetty-ee9-demo-proxy-webapp/src/test/java/org/eclipse/jetty/ee9/demos/ProxyWebAppTest.java
index 78ec5592f3b9..0848380e77b1 100644
--- a/jetty-ee9/jetty-ee9-demos/jetty-ee9-demo-proxy-webapp/src/test/java/org/eclipse/jetty/ee9/demos/ProxyWebAppTest.java
+++ b/jetty-ee9/jetty-ee9-demos/jetty-ee9-demo-proxy-webapp/src/test/java/org/eclipse/jetty/ee9/demos/ProxyWebAppTest.java
@@ -57,7 +57,7 @@ public void setup() throws Exception
// This is a pieced together WebApp.
// We don't have a valid WEB-INF/lib to rely on at this point.
// So, open up server classes here, for purposes of this testcase.
- webapp.getServerClassMatcher().add("-org.eclipse.jetty.ee9.proxy.");
+ webapp.getHiddenClassMatcher().add("-org.eclipse.jetty.ee9.proxy.");
// Default location (EE9)
Path webappDir = MavenTestingUtils.getBasePath().resolve("src/main/webapp");
if (!Files.exists(webappDir))
diff --git a/jetty-ee9/jetty-ee9-plus/src/test/java/org/eclipse/jetty/ee9/plus/webapp/PlusDescriptorProcessorTest.java b/jetty-ee9/jetty-ee9-plus/src/test/java/org/eclipse/jetty/ee9/plus/webapp/PlusDescriptorProcessorTest.java
index 4a84332199da..6892cbc29f0b 100644
--- a/jetty-ee9/jetty-ee9-plus/src/test/java/org/eclipse/jetty/ee9/plus/webapp/PlusDescriptorProcessorTest.java
+++ b/jetty-ee9/jetty-ee9-plus/src/test/java/org/eclipse/jetty/ee9/plus/webapp/PlusDescriptorProcessorTest.java
@@ -129,7 +129,7 @@ public void setUp() throws Exception
context.setConfigurations(new Configuration[]{new PlusConfiguration(), new EnvConfiguration()});
context.preConfigure();
context.setClassLoader(new WebAppClassLoader(Thread.currentThread().getContextClassLoader(), context));
- context.getServerClassMatcher().exclude("org.eclipse.jetty.ee9.plus.webapp."); //need visbility of the TestInjections class
+ context.getHiddenClassMatcher().exclude("org.eclipse.jetty.ee9.plus.webapp."); //need visbility of the TestInjections class
ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(context.getClassLoader());
Context icontext = new InitialContext();
diff --git a/jetty-ee9/jetty-ee9-quickstart/src/test/java/org/eclipse/jetty/ee9/quickstart/TestQuickStart.java b/jetty-ee9/jetty-ee9-quickstart/src/test/java/org/eclipse/jetty/ee9/quickstart/TestQuickStart.java
index 1040160a5ebf..4a58dc4e3acd 100644
--- a/jetty-ee9/jetty-ee9-quickstart/src/test/java/org/eclipse/jetty/ee9/quickstart/TestQuickStart.java
+++ b/jetty-ee9/jetty-ee9-quickstart/src/test/java/org/eclipse/jetty/ee9/quickstart/TestQuickStart.java
@@ -89,7 +89,7 @@ public void testProgrammaticOverrideOfDefaultServletMapping() throws Exception
WebAppContext webapp = new WebAppContext();
webapp.setResourceBase(testDir.getAbsolutePath());
webapp.addConfiguration(new QuickStartConfiguration());
- webapp.getServerClassMatcher().exclude("org.eclipse.jetty.ee9.quickstart.");
+ webapp.getHiddenClassMatcher().exclude("org.eclipse.jetty.ee9.quickstart.");
webapp.setAttribute(QuickStartConfiguration.MODE, QuickStartConfiguration.Mode.QUICKSTART);
//add in the servlet
webapp.getServletHandler().addServlet(fooHolder);
@@ -139,7 +139,7 @@ public void testDefaultContextPath() throws Exception
webapp.addConfiguration(new QuickStartConfiguration());
webapp.setAttribute(QuickStartConfiguration.MODE, QuickStartConfiguration.Mode.QUICKSTART);
webapp.setResourceBase(testDir.getAbsolutePath());
- webapp.getServerClassMatcher().exclude("org.eclipse.jetty.ee9.quickstart.");
+ webapp.getHiddenClassMatcher().exclude("org.eclipse.jetty.ee9.quickstart.");
server.setHandler(webapp);
server.setDryRun(false);
@@ -180,7 +180,7 @@ public void testDefaultRequestAndResponseEncodings() throws Exception
webapp.addConfiguration(new QuickStartConfiguration());
webapp.setAttribute(QuickStartConfiguration.MODE, QuickStartConfiguration.Mode.QUICKSTART);
webapp.setResourceBase(testDir.getAbsolutePath());
- webapp.getServerClassMatcher().exclude("org.eclipse.jetty.ee9.quickstart.");
+ webapp.getHiddenClassMatcher().exclude("org.eclipse.jetty.ee9.quickstart.");
server.setHandler(webapp);
server.setDryRun(false);
@@ -255,7 +255,7 @@ public void testDuplicateGenerationFromContextXml() throws Exception
//a freshly applied context xml
quickstart = new WebAppContext();
//need visibility of FooServlet, FooFilter, FooContextListener when we quickstart
- quickstart.getServerClassMatcher().exclude("org.eclipse.jetty.ee9.quickstart.");
+ quickstart.getHiddenClassMatcher().exclude("org.eclipse.jetty.ee9.quickstart.");
quickstart.addConfiguration(new QuickStartConfiguration());
quickstart.setWar(testDir.toURI().toURL().toExternalForm());
quickstart.setDescriptor(MavenTestingUtils.getTargetFile("test-classes/web.xml").getAbsolutePath());
diff --git a/jetty-ee9/jetty-ee9-tests/jetty-ee9-test-cdi/src/test/java/org/eclipse/jetty/ee9/cdi/tests/EmbeddedWeldTest.java b/jetty-ee9/jetty-ee9-tests/jetty-ee9-test-cdi/src/test/java/org/eclipse/jetty/ee9/cdi/tests/EmbeddedWeldTest.java
index c9978cbec67d..b5e8c07b852e 100644
--- a/jetty-ee9/jetty-ee9-tests/jetty-ee9-test-cdi/src/test/java/org/eclipse/jetty/ee9/cdi/tests/EmbeddedWeldTest.java
+++ b/jetty-ee9/jetty-ee9-tests/jetty-ee9-test-cdi/src/test/java/org/eclipse/jetty/ee9/cdi/tests/EmbeddedWeldTest.java
@@ -202,8 +202,8 @@ public void testWebappContext() throws Exception
webapp.addBean(new ServletContextHandler.Initializer(webapp, new org.jboss.weld.environment.servlet.EnhancedListener()));
String pkg = EmbeddedWeldTest.class.getPackage().getName();
- webapp.getServerClassMatcher().add("-" + pkg + ".");
- webapp.getSystemClassMatcher().add(pkg + ".");
+ webapp.getHiddenClassMatcher().add("-" + pkg + ".");
+ webapp.getProtectedClassMatcher().add(pkg + ".");
webapp.addServlet(GreetingsServlet.class, "/greet");
webapp.addFilter(MyFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
@@ -238,8 +238,8 @@ public void testWebappContextDiscovered() throws Exception
// This is ugly but needed for maven for testing in a overlaid war pom
String pkg = EmbeddedWeldTest.class.getPackage().getName();
- webapp.getServerClassMatcher().add("-" + pkg + ".");
- webapp.getSystemClassMatcher().add(pkg + ".");
+ webapp.getHiddenClassMatcher().add("-" + pkg + ".");
+ webapp.getProtectedClassMatcher().add(pkg + ".");
webapp.getServletHandler().addListener(new ListenerHolder(MyContextListener.class));
webapp.addFilter(MyFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
diff --git a/jetty-ee9/jetty-ee9-webapp/src/main/java/org/eclipse/jetty/ee9/webapp/AbstractConfiguration.java b/jetty-ee9/jetty-ee9-webapp/src/main/java/org/eclipse/jetty/ee9/webapp/AbstractConfiguration.java
index 2d5db6c60989..d49b379fe05c 100644
--- a/jetty-ee9/jetty-ee9-webapp/src/main/java/org/eclipse/jetty/ee9/webapp/AbstractConfiguration.java
+++ b/jetty-ee9/jetty-ee9-webapp/src/main/java/org/eclipse/jetty/ee9/webapp/AbstractConfiguration.java
@@ -19,13 +19,15 @@
import java.util.List;
import java.util.stream.Collectors;
+import org.eclipse.jetty.util.ClassMatcher;
+
public class AbstractConfiguration implements Configuration
{
private final boolean _enabledByDefault;
private final List Also since Jetty-9.4, Configurations are responsible for providing {@link #getServerClasses()} and
- * {@link #getSystemClasses()} to configure the {@link WebAppClassLoader} for each context.
+ * Also since Jetty-9.4, Configurations are responsible for providing {@link #getHiddenClasses()} and
+ * {@link #getHiddenClasses()} to configure the {@link WebAppClassLoader} for each context.
*
diff --git a/jetty-ee9/jetty-ee9-webapp/src/main/java/org/eclipse/jetty/ee9/webapp/WebAppClassLoader.java b/jetty-ee9/jetty-ee9-webapp/src/main/java/org/eclipse/jetty/ee9/webapp/WebAppClassLoader.java
index f474fa96ceda..4bcdfdb926ee 100644
--- a/jetty-ee9/jetty-ee9-webapp/src/main/java/org/eclipse/jetty/ee9/webapp/WebAppClassLoader.java
+++ b/jetty-ee9/jetty-ee9-webapp/src/main/java/org/eclipse/jetty/ee9/webapp/WebAppClassLoader.java
@@ -20,28 +20,24 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
-import java.nio.file.Files;
import java.nio.file.Path;
import java.security.CodeSource;
import java.security.PermissionCollection;
import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Comparator;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.stream.Stream;
import org.eclipse.jetty.util.ClassVisibilityChecker;
import org.eclipse.jetty.util.FileID;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.TypeUtil;
-import org.eclipse.jetty.util.URIUtil;
import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.util.resource.ResourceCollators;
import org.eclipse.jetty.util.resource.ResourceFactory;
@@ -115,9 +111,33 @@ public interface Context extends ClassVisibilityChecker
List
- * Server classes/packages are classes used to implement the server and are hidden
+ * These classes/packages are used to implement the server and are hidden
* from the context. If the context needs to load these classes, it must have its
* own copy of them in WEB-INF/lib or WEB-INF/classes.
*
- * @param serverClasses the server classes pattern
+ * @param hiddenClasses the server classes pattern
*/
- public void setServerClassMatcher(ClassMatcher serverClasses)
+ public void setHiddenClassMatcher(ClassMatcher hiddenClasses)
{
- _serverClasses.clear();
- _serverClasses.add(serverClasses.getPatterns());
+ _hiddenClasses.clear();
+ _hiddenClasses.add(hiddenClasses.getPatterns());
}
/**
- * Set the system classes patterns.
+ * Set the protected (system) classes patterns.
*
- * System classes/packages are classes provided by the JVM and that
+ * These classes/packages are provided by the JVM and
* cannot be replaced by classes of the same name from WEB-INF,
* regardless of the value of {@link #setParentLoaderPriority(boolean)}.
*
- * @param systemClasses the system classes pattern
+ * @param protectedClasses the system classes pattern
*/
- public void setSystemClassMatcher(ClassMatcher systemClasses)
+ public void setProtectedClassMatcher(ClassMatcher protectedClasses)
{
- _systemClasses.clear();
- _systemClasses.add(systemClasses.getPatterns());
+ _protectedClasses.clear();
+ _protectedClasses.add(protectedClasses.getPatterns());
}
/**
- * Add a ClassMatcher for server classes by combining with
+ * Add a ClassMatcher for hidden (server) classes by combining with
* any existing matcher.
*
- * @param serverClasses The class matcher of patterns to add to the server ClassMatcher
+ * @param hiddenClasses The class matcher of patterns to add to the server ClassMatcher
*/
- public void addServerClassMatcher(ClassMatcher serverClasses)
+ public void addHiddenClassMatcher(ClassMatcher hiddenClasses)
{
- _serverClasses.add(serverClasses.getPatterns());
+ _hiddenClasses.add(hiddenClasses.getPatterns());
}
/**
- * Add a ClassMatcher for system classes by combining with
+ * Add a ClassMatcher for protected (system) classes by combining with
* any existing matcher.
*
- * @param systemClasses The class matcher of patterns to add to the system ClassMatcher
+ * @param protectedClasses The class matcher of patterns to add to the system ClassMatcher
*/
- public void addSystemClassMatcher(ClassMatcher systemClasses)
+ public void addProtectedClassMatcher(ClassMatcher protectedClasses)
{
- _systemClasses.add(systemClasses.getPatterns());
+ _protectedClasses.add(protectedClasses.getPatterns());
}
/**
* @return The ClassMatcher used to match System (protected) classes
*/
- public ClassMatcher getSystemClassMatcher()
+ public ClassMatcher getProtectedClassMatcher()
{
- return _systemClasses;
+ return _protectedClasses;
}
/**
* @return The ClassMatcher used to match Server (hidden) classes
*/
- public ClassMatcher getServerClassMatcher()
+ public ClassMatcher getHiddenClassMatcher()
{
- return _serverClasses;
+ return _hiddenClasses;
}
@ManagedAttribute(value = "classes and packages protected by context classloader", readonly = true)
- public String[] getSystemClasses()
+ public String[] getProtectedClasses()
{
- return _systemClasses.getPatterns();
+ return _protectedClasses.getPatterns();
}
@ManagedAttribute(value = "classes and packages hidden by the context classloader", readonly = true)
- public String[] getServerClasses()
+ public String[] getHiddenClasses()
{
- return _serverClasses.getPatterns();
+ return _hiddenClasses.getPatterns();
}
@Override
public boolean isHiddenClass(Class> clazz)
{
- return _serverClasses.match(clazz);
+ return _hiddenClasses.match(clazz);
}
@Override
public boolean isProtectedClass(Class> clazz)
{
- return _systemClasses.match(clazz);
+ return _protectedClasses.match(clazz);
}
@Override
- public boolean isServerResource(String name, URL url)
+ public boolean isHiddenResource(String name, URL url)
{
- return _serverClasses.match(name, url);
+ return _hiddenClasses.match(name, url);
}
@Override
- public boolean isSystemResource(String name, URL url)
+ public boolean isProtectedResource(String name, URL url)
+ {
+ return _protectedClasses.match(name, url);
+ }
+
+ /**
+ * @deprecated use {@link #setHiddenClassMatcher(ClassMatcher)}
+ */
+ @Deprecated(since = "12.0.8", forRemoval = true)
+ public void setServerClassMatcher(org.eclipse.jetty.ee9.webapp.ClassMatcher serverClasses)
+ {
+ setHiddenClassMatcher(serverClasses);
+ }
+
+ /**
+ * @deprecated use {@link #setProtectedClassMatcher(ClassMatcher)}
+ */
+ @Deprecated(since = "12.0.8", forRemoval = true)
+ public void setSystemClassMatcher(org.eclipse.jetty.ee9.webapp.ClassMatcher systemClasses)
+ {
+ setProtectedClassMatcher(systemClasses);
+ }
+
+ /**
+ * @deprecated use {@link #addHiddenClassMatcher(ClassMatcher)}
+ */
+ @Deprecated(since = "12.0.8", forRemoval = true)
+ public void addServerClassMatcher(org.eclipse.jetty.ee9.webapp.ClassMatcher serverClasses)
+ {
+ addHiddenClassMatcher(serverClasses);
+ }
+
+ /**
+ * @deprecated use {@link #addProtectedClassMatcher(ClassMatcher)}
+ */
+ @Deprecated(since = "12.0.8", forRemoval = true)
+ public void addSystemClassMatcher(org.eclipse.jetty.ee9.webapp.ClassMatcher systemClasses)
+ {
+ addProtectedClassMatcher(systemClasses);
+ }
+
+ /**
+ * @deprecated use {@link #getProtectedClassMatcher()}
+ */
+ @Deprecated(since = "12.0.8", forRemoval = true)
+ public org.eclipse.jetty.ee9.webapp.ClassMatcher getSystemClassMatcher()
+ {
+ return new org.eclipse.jetty.ee9.webapp.ClassMatcher(getProtectedClassMatcher());
+ }
+
+ /**
+ * @deprecated use {@link #getHiddenClassMatcher()}
+ */
+ @Deprecated(since = "12.0.8", forRemoval = true)
+ public org.eclipse.jetty.ee9.webapp.ClassMatcher getServerClassMatcher()
+ {
+ return new org.eclipse.jetty.ee9.webapp.ClassMatcher(getHiddenClassMatcher());
+ }
+
+ /**
+ * @deprecated use {@link #getProtectedClasses()}
+ */
+ @Deprecated(since = "12.0.8", forRemoval = true)
+ public String[] getSystemClasses()
+ {
+ return getProtectedClasses();
+ }
+
+ /**
+ * @deprecated use {@link #getHiddenClasses()}
+ */
+ @Deprecated(since = "12.0.8", forRemoval = true)
+ public String[] getServerClasses()
+ {
+ return getHiddenClasses();
+ }
+
+ /**
+ * @deprecated use {@link #isHiddenClass(Class)}
+ */
+ @Deprecated(since = "12.0.8", forRemoval = true)
+ public boolean isServerClass(Class> clazz)
+ {
+ return isHiddenClass(clazz);
+ }
+
+ /**
+ * @deprecated use {@link #isProtectedClass(Class)}
+ */
+ @Deprecated(since = "12.0.8", forRemoval = true)
+ public boolean isSystemClass(Class> clazz)
{
- return _systemClasses.match(name, url);
+ return isProtectedClass(clazz);
}
@Override
@@ -780,8 +870,8 @@ public void setServer(Server server)
super.setServer(server);
if (server != null)
{
- _systemClasses.add(WebAppClassLoading.getProtectedClasses(server).getPatterns());
- _serverClasses.add(WebAppClassLoading.getHiddenClasses(server).getPatterns());
+ _protectedClasses.add(WebAppClassLoading.getProtectedClasses(server).getPatterns());
+ _hiddenClasses.add(WebAppClassLoading.getHiddenClasses(server).getPatterns());
}
}
@@ -893,16 +983,16 @@ public String toString()
public void dump(Appendable out, String indent) throws IOException
{
List