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, org.eclipse.jetty.util.Attributes, org.eclipse.jetty.util.Decorator
Enclosing class:
ContextHandler

public class ContextHandler.ScopedContext extends org.eclipse.jetty.util.Attributes.Layer implements Context
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Attributes

    org.eclipse.jetty.util.Attributes.Layer, org.eclipse.jetty.util.Attributes.Lazy, org.eclipse.jetty.util.Attributes.Mapped, org.eclipse.jetty.util.Attributes.Synthetic, org.eclipse.jetty.util.Attributes.Wrapper
  • Field Summary

    Fields inherited from interface org.eclipse.jetty.util.Attributes

    NULL
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(Consumer<Throwable> consumer, Throwable t, Request request)
     
    void
    call(org.eclipse.jetty.util.thread.Invocable.Callable callable, Request request)
     
    <T> T
    decorate(T o)
     
    void
     
    void
    execute(Runnable runnable)
    Executes the given task in a thread scoped to this Context.
    org.eclipse.jetty.util.resource.Resource
     
     
    <H extends ContextHandler>
    H
     
     
    protected org.eclipse.jetty.util.DecoratedObjectFactory
     
     
    org.eclipse.jetty.http.MimeTypes
     
    getPathInContext(String canonicallyEncodedPath)
    Returns the URI path scoped to this Context.
     
     
    void
    run(Runnable runnable)
    Runs the given task in the current thread scoped to this Context.
    void
    run(Runnable runnable, Request request)
    Runs the given task in the current thread scoped to this Context and the given Request.
    <T> boolean
    test(Predicate<T> predicate, T t, Request request)
     
     

    Methods inherited from class org.eclipse.jetty.util.Attributes.Layer

    clearAttributes, getAttribute, getAttributeNameSet, getPersistentAttributes, removeAttribute, setAttribute

    Methods inherited from class org.eclipse.jetty.util.Attributes.Wrapper

    equals, getWrapped, hashCode

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.jetty.util.Attributes

    asAttributeMap, clearAttributes, equals, getAttribute, getAttributeNameSet, hashCode, removeAttribute, setAttribute
  • 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 org.eclipse.jetty.http.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 org.eclipse.jetty.util.resource.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(org.eclipse.jetty.util.thread.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:
    • getDecoratedObjectFactory

      protected org.eclipse.jetty.util.DecoratedObjectFactory getDecoratedObjectFactory()
    • decorate

      public <T> T decorate(T o)
      Specified by:
      decorate in interface org.eclipse.jetty.util.Decorator
    • destroy

      public void destroy(Object o)
      Specified by:
      destroy in interface org.eclipse.jetty.util.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: