Top Description Inners Fields Constructors Methods
org.eclipse.jgit.http.server.glue

pack-priv abstract Class UrlPipeline

extends Object
Class Inheritance
Known Direct Subclasses
org.eclipse.jgit.http.server.glue.RegexPipeline, org.eclipse.jgit.http.server.glue.SuffixPipeline
Imports
java.io.IOException, java.util.Enumeration, .NoSuchElementException, .Set, jakarta.servlet.Filter, .FilterChain, .ServletConfig, .ServletContext, .ServletException, .ServletRequest, .ServletResponse, jakarta.servlet.http.HttpServlet, .HttpServletRequest, .HttpServletResponse

Encapsulates the entire serving stack for a single URL.

Subclasses provide the implementation of match(HttpServletRequest), which is called by MetaServlet in registration order to determine the pipeline that will be used to handle a request.

The very bottom of each pipeline is a single HttpServlet that will handle producing the response for this pipeline's URL. Filters may also be registered and applied around the servlet's processing, to manage request attributes, set standard response headers, or completely override the response generation.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final Filter[]
filters

Filters to apply around servlet; may be empty but never null.

private final HttpServlet
servlet

Instance that must generate the response; never null.

Constructor Summary

AccessConstructor and Description
pack-priv
UrlPipeline(Filter[] filters, HttpServlet servlet)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
destroy(Set<Object>
(input/output) the set of filters and servlets which have already been destroyed within the container context. If those same instances appear in this pipeline they are not destroyed a second time. Filters and servlets that are first destroyed by this pipeline will be added to this set.
destroyed
)

Destroy all contained filters and servlets.

private static void
destroyFilter(Filter ref, Set<Object> destroyed)

private static void
pack-priv void
init(ServletContext
the servlet container context our MetaServlet is running within.
context
,
Set<Object>
(input/output) the set of filters and servlets which have already been initialized within the container context. If those same instances appear in this pipeline they are not initialized a second time. Filters and servlets that are first initialized by this pipeline will be added to this set.
inited
)

Initialize all contained filters and servlets.

private static void
initFilter(final Filter ref, final ServletContext context, final Set<Object> inited)

private static void
initServlet(final HttpServlet ref, final ServletContext context, final Set<Object> inited)

pack-priv abstract boolean

Returns:

true if this pipeline is configured to handle the request; false otherwise.
match
(HttpServletRequest
current HTTP request being considered by MetaServlet.
req
)

Determine if this pipeline handles the request's URL.

pack-priv void
service(HttpServletRequest
current HTTP request.
req
,
HttpServletResponse
current HTTP response.
rsp
)

Execute the filters and the servlet on the request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

filtersback to summary
private final Filter[] filters

Filters to apply around servlet; may be empty but never null.

servletback to summary
private final HttpServlet servlet

Instance that must generate the response; never null.

Constructor Detail

UrlPipelineback to summary
pack-priv UrlPipeline(Filter[] filters, HttpServlet servlet)

Method Detail

destroyback to summary
pack-priv void destroy(Set<Object> destroyed)

Destroy all contained filters and servlets.

Parameters
destroyed:Set<Object>

(input/output) the set of filters and servlets which have already been destroyed within the container context. If those same instances appear in this pipeline they are not destroyed a second time. Filters and servlets that are first destroyed by this pipeline will be added to this set.

destroyFilterback to summary
private static void destroyFilter(Filter ref, Set<Object> destroyed)
destroyServletback to summary
private static void destroyServlet(HttpServlet ref, Set<Object> destroyed)
initback to summary
pack-priv void init(ServletContext context, Set<Object> inited) throws ServletException

Initialize all contained filters and servlets.

Parameters
context:ServletContext

the servlet container context our MetaServlet is running within.

inited:Set<Object>

(input/output) the set of filters and servlets which have already been initialized within the container context. If those same instances appear in this pipeline they are not initialized a second time. Filters and servlets that are first initialized by this pipeline will be added to this set.

Exceptions
ServletException:
a filter or servlet is unable to initialize.
initFilterback to summary
private static void initFilter(final Filter ref, final ServletContext context, final Set<Object> inited) throws ServletException
initServletback to summary
private static void initServlet(final HttpServlet ref, final ServletContext context, final Set<Object> inited) throws ServletException
matchback to summary
pack-priv abstract boolean match(HttpServletRequest req)

Determine if this pipeline handles the request's URL.

This method should match on the request's getPathInfo() method, as MetaServlet passes the request along as-is to each pipeline's match method.

Parameters
req:HttpServletRequest

current HTTP request being considered by MetaServlet.

Returns:boolean

true if this pipeline is configured to handle the request; false otherwise.

serviceback to summary
pack-priv void service(HttpServletRequest req, HttpServletResponse rsp) throws ServletException, IOException

Execute the filters and the servlet on the request.

Invoked by MetaServlet once match(HttpServletRequest) has determined this pipeline is the correct pipeline to handle the current request.

Parameters
req:HttpServletRequest

current HTTP request.

rsp:HttpServletResponse

current HTTP response.

Exceptions
ServletException:
request cannot be completed.
IOException:
IO error prevents the request from being completed.
org.eclipse.jgit.http.server.glue back to summary

private Class UrlPipeline.Chain

extends Object
implements FilterChain
Class Inheritance
All Implemented Interfaces
jakarta.servlet.FilterChain

Field Summary

Modifier and TypeField and Description
private int
private final Filter[]
private final HttpServlet

Constructor Summary

AccessConstructor and Description
pack-priv
Chain(Filter[] filters, HttpServlet servlet)

Method Summary

Modifier and TypeMethod and Description
public void
doFilter(ServletRequest
the request to pass along the chain.
req
,
ServletResponse
the response to pass along the chain.
rsp
)

Implements jakarta.servlet.FilterChain.doFilter.

Causes the next filter in the chain to be invoked, or if the calling filter is the last filter in the chain, causes the resource at the end of the chain to be invoked.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

filterIdxback to summary
private int filterIdx
filtersback to summary
private final Filter[] filters
servletback to summary
private final HttpServlet servlet

Constructor Detail

Chainback to summary
pack-priv Chain(Filter[] filters, HttpServlet servlet)

Method Detail

doFilterback to summary
public void doFilter(ServletRequest req, ServletResponse rsp) throws IOException, ServletException

Implements jakarta.servlet.FilterChain.doFilter.

Doc from jakarta.servlet.FilterChain.doFilter.

Causes the next filter in the chain to be invoked, or if the calling filter is the last filter in the chain, causes the resource at the end of the chain to be invoked.

Parameters
req:ServletRequest

the request to pass along the chain.

rsp:ServletResponse

the response to pass along the chain.

Annotations
@Override
Exceptions
IOException:
if an I/O related error has occurred during the processing
ServletException:
if an exception has occurred that interferes with the filterChain's normal operation