Skip to content

Commit

Permalink
merged ee10 to ee11
Browse files Browse the repository at this point in the history
  • Loading branch information
gregw committed May 23, 2024
1 parent 7272937 commit 0e5bc9d
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 238 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import org.eclipse.jetty.http.HttpURI;
import org.eclipse.jetty.util.ExceptionUtil;
import org.eclipse.jetty.util.thread.Scheduler;

public class AsyncContextEvent extends AsyncEvent implements Runnable
Expand Down Expand Up @@ -149,9 +150,6 @@ public void run()

public void addThrowable(Throwable e)
{
if (_throwable == null)
_throwable = e;
else if (e != _throwable)
_throwable.addSuppressed(e);
_throwable = ExceptionUtil.combine(_throwable, e);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> _after;
private final List<String> _before;
private final ClassMatcher _system;
private final ClassMatcher _server;
private final ClassMatcher _protected;
private final ClassMatcher _hidden;

public static class Builder
{
Expand Down Expand Up @@ -88,7 +90,7 @@ public Builder addDependents(Class<?>... classes)

/**
* Protect classes from modification by the web application by adding them
* to the {@link WebAppConfiguration#getSystemClasses()}
* to the {@link WebAppConfiguration#getProtectedClasses()}
*
* @param classes classname or package pattern
*/
Expand All @@ -100,7 +102,7 @@ public Builder protect(String... classes)

/**
* Hide classes from the web application by adding them
* to the {@link WebAppConfiguration#getServerClasses()}
* to the {@link WebAppConfiguration#getHiddenClasses()}
*
* @param classes classname or package pattern
*/
Expand All @@ -112,7 +114,7 @@ public Builder hide(String... classes)

/**
* Expose classes to the web application by adding them
* as exclusions to the {@link WebAppConfiguration#getServerClasses()}
* as exclusions to the {@link WebAppConfiguration#getHiddenClasses()}
*
* @param classes classname or package pattern
*/
Expand All @@ -129,9 +131,9 @@ public Builder expose(String... classes)

/**
* Protect classes from modification by the web application by adding them
* to the {@link WebAppConfiguration#getSystemClasses()} and
* to the {@link WebAppConfiguration#getProtectedClasses()} and
* expose them to the web application by adding them
* as exclusions to the {@link WebAppConfiguration#getServerClasses()}
* as exclusions to the {@link WebAppConfiguration#getHiddenClasses()}
*
* @param classes classname or package pattern
*/
Expand All @@ -154,8 +156,8 @@ protected AbstractConfiguration(Builder builder)
_enabledByDefault = builder._enabledByDefault;
_after = List.copyOf(builder._after);
_before = List.copyOf(builder._before);
_system = new ClassMatcher(builder._system).asImmutable();
_server = new ClassMatcher(builder._server).asImmutable();
_protected = new ClassMatcher(builder._system).asImmutable();
_hidden = new ClassMatcher(builder._server).asImmutable();
}

@Override
Expand All @@ -171,15 +173,15 @@ public Collection<String> getDependencies()
}

@Override
public ClassMatcher getSystemClasses()
public ClassMatcher getProtectedClasses()
{
return _system;
return _protected;
}

@Override
public ClassMatcher getServerClasses()
public ClassMatcher getHiddenClasses()
{
return _server;
return _hidden;
}

@Override
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.Collections;
import java.util.ServiceLoader;

import org.eclipse.jetty.util.ClassMatcher;
import org.eclipse.jetty.util.TopologicalSort;

/**
Expand All @@ -43,8 +44,8 @@
* (eg {@link JndiConfiguration}, {@link JaasConfiguration}} etc.) can be added or removed without concern
* for ordering.
* </p>
* <p>Also since Jetty-9.4, Configurations are responsible for providing {@link #getServerClasses()} and
* {@link #getSystemClasses()} to configure the {@link WebAppClassLoader} for each context.
* <p>Also since Jetty-9.4, Configurations are responsible for providing {@link #getHiddenClasses()} and
* {@link #getProtectedClasses()} to configure the {@link WebAppClassLoader} for each context.
* </p>
*/
public interface Configuration
Expand Down Expand Up @@ -93,21 +94,21 @@ default Collection<String> getDependents()
}

/**
* Get the system classes associated with this Configuration.
* Get the system (protected) classes associated with this Configuration.
*
* @return ClassMatcher of system classes.
*/
default ClassMatcher getSystemClasses()
default ClassMatcher getProtectedClasses()
{
return new ClassMatcher();
}

/**
* Get the system classes associated with this Configuration.
* Get the server (hidden) classes associated with this Configuration.
*
* @return ClassMatcher of server classes.
*/
default ClassMatcher getServerClasses()
default ClassMatcher getHiddenClasses()
{
return new ClassMatcher();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,6 @@ protected Class<?> loadAsResource(final String name, boolean checkSystemResource

if (webappUrl != null && (!checkSystemResource || !_context.isProtectedResource(name, webappUrl)))
{

webappClass = this.foundClass(name, webappUrl);
resolveClass(webappClass);
if (LOG.isDebugEnabled())
Expand Down
Loading

0 comments on commit 0e5bc9d

Please sign in to comment.