Class ContextHandler.ScopedContext

java.lang.Object
org.eclipse.jetty.util.Attributes.Wrapper
org.eclipse.jetty.util.Attributes.Layer
org.eclipse.jetty.server.handler.ContextHandler.ScopedContext
All Implemented Interfaces:
Executor, Context, Attributes, Decorator
Direct Known Subclasses:
ServletContextHandler.ServletScopedContext
Enclosing class:
ContextHandler

public class ContextHandler.ScopedContext extends Attributes.Layer implements Context
  • Constructor Details

    • ScopedContext

      public ScopedContext()
  • Method Details

    • getContextHandler

      public <H extends ContextHandler> H getContextHandler()
    • getErrorHandler

      public Request.Handler getErrorHandler()
      Specified by:
      getErrorHandler in interface Context
      Returns:
      the error Request.Handler associated with this Context
    • getContextPath

      public String getContextPath()
      Specified by:
      getContextPath in interface Context
      Returns:
      the encoded context path of this Context or null
    • getMimeTypes

      public MimeTypes getMimeTypes()
      Specified by:
      getMimeTypes in interface Context
      Returns:
      the mime types associated with this Context
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getClassLoader

      public ClassLoader getClassLoader()
      Specified by:
      getClassLoader in interface Context
      Returns:
      the ClassLoader associated with this Context
    • getBaseResource

      public Resource getBaseResource()
      Specified by:
      getBaseResource in interface Context
      Returns:
      the base resource used to lookup other resources specified by the request URI path
    • getTempDirectory

      public File getTempDirectory()
      Specified by:
      getTempDirectory in interface Context
      Returns:
      a non-null temporary directory, configured either for the context, the server or the JVM
    • getVirtualHosts

      public List<String> getVirtualHosts()
      Specified by:
      getVirtualHosts in interface Context
      Returns:
      a list of virtual host names associated with this Context
    • call

      public void call(Invocable.Callable callable, Request request) throws Exception
      Throws:
      Exception
    • test

      public <T> boolean test(Predicate<T> predicate, T t, Request request)
    • accept

      public void accept(Consumer<Throwable> consumer, Throwable t, Request request)
    • run

      public void run(Runnable runnable)
      Description copied from interface: Context

      Runs the given task in the current thread scoped to this Context.

      Specified by:
      run in interface Context
      Parameters:
      runnable - the task to run
      See Also:
    • run

      public void run(Runnable runnable, Request request)
      Description copied from interface: Context

      Runs the given task in the current thread scoped to this Context and the given Request.

      Specified by:
      run in interface Context
      Parameters:
      runnable - the task to run
      request - the HTTP request to use in the scope
    • execute

      public void execute(Runnable runnable)
      Description copied from interface: Context

      Executes the given task in a thread scoped to this Context.

      Specified by:
      execute in interface Context
      Specified by:
      execute in interface Executor
      Parameters:
      runnable - the task to run
      See Also:
    • execute

      public void execute(Runnable runnable, Request request)
    • getDecoratedObjectFactory

      protected DecoratedObjectFactory getDecoratedObjectFactory()
    • decorate

      public <T> T decorate(T o)
      Specified by:
      decorate in interface Decorator
    • destroy

      public void destroy(Object o)
      Specified by:
      destroy in interface Decorator
    • getPathInContext

      public String getPathInContext(String canonicallyEncodedPath)
      Description copied from interface: Context

      Returns the URI path scoped to this Context.

      Specified by:
      getPathInContext in interface Context
      Parameters:
      canonicallyEncodedPath - a full URI path that should be canonically encoded as per URIUtil.canonicalPath(String)
      Returns:
      the URI path scoped to this Context, or null if the full path does not match this Context. The empty string is returned if the full path is exactly the context path.
      See Also:
    • isCrossContextDispatch

      public boolean isCrossContextDispatch(Request request)
      Description copied from interface: Context
      Check cross context dispatch status
      Specified by:
      isCrossContextDispatch in interface Context
      Parameters:
      request - The request to check
      Returns:
      True IFF this context supports cross context and the passed request is a cross context request.
    • getCrossContextDispatchType

      public String getCrossContextDispatchType(Request request)
      Description copied from interface: Context
      Get any cross context dispatch type
      Specified by:
      getCrossContextDispatchType in interface Context
      Parameters:
      request - The request to get the type for
      Returns:
      A String representation of a dispatcher type iff this context supports cross context and the passed request is a cross context request, otherwise null.