org.norther.tammi.spray.filter.chain
Interface HttpFilterChain

All Superinterfaces:
FilterChain
All Known Implementing Classes:
ChainTool, DefaultFilterChain

public interface HttpFilterChain
extends FilterChain

HttpFilterChain extends javax.servlet.FilterChain by providing more information about the chain of filters invoked for a filtered request of a resource.

Author:
Ilkka Priha

Method Summary
 void clearErrors()
          Clears throwables from the error stack of this chain.
 boolean containsErrors()
          Checks whether this chain contains errors.
 void doFilter(ServletRequest request, ServletResponse response)
          Passes the request and response to the next filter.
 void doFilter(ServletRequest request, ServletResponse response, Filter filter)
          Invokes the specified filter.
 void doFilter(ServletRequest request, ServletResponse response, FilterMBeanReference[] filters)
          Invokes the first filter in a list of filter handles and continues with the rest as long as the preceding filter passes the request forward.
 Filter getCurrentFilter()
          Gets the current filter of this chain.
 Pipe getCurrentPipe()
          Gets the current pipe of this chain.
 Throwable getError()
          Gets the last throwable from the error stack of this chain.
 List getErrors()
          Gets a list of all throwables in the error stack of this chain.
 MBeanServer getMBeanServer()
          Gets the MBean server.
 Filter getNearestFilter(Class clazz)
          Gets the nearest registered filter of the specified class from the filter stack of this chain.
 Filter getNextFilter(Class clazz)
          Gets the next registered filter of the specified class in the current pipe to be activated after the current one.
 Filter getPreviousFilter(Class clazz)
          Gets the previous registered filter of the specified class activated before the current one from the filter stack of this chain.
 List getPreviousFilters()
          Gets a list of all filters activated before the current one from the filter stack of this chain.
 ServletRequest getRequest()
          Gets the active request.
 ServletResponse getResponse()
          Gets the active response.
 boolean isInvalidatedSession()
          Checks whether the the active session is invalidated.
 Throwable popError()
          Pops a throwable from the error stack.
 void pushError(Throwable error)
          Pushes a throwable to the error stack without throwing one.
 void setInvalidatedSession(boolean flag)
          Sets whether the the active session is invalidated.
 void terminate()
          Terminates the filter chain.
 

Method Detail

getRequest

ServletRequest getRequest()
Gets the active request.

Returns:
the request or null.

getResponse

ServletResponse getResponse()
Gets the active response.

Returns:
the response or null.

isInvalidatedSession

boolean isInvalidatedSession()
Checks whether the the active session is invalidated.

Returns:
true if invalidated, false otherwise.

setInvalidatedSession

void setInvalidatedSession(boolean flag)
Sets whether the the active session is invalidated.

Parameters:
flag - true if invalidated, false otherwise.

getCurrentPipe

Pipe getCurrentPipe()
Gets the current pipe of this chain.

Returns:
the current pipe or null.

getCurrentFilter

Filter getCurrentFilter()
Gets the current filter of this chain.

Returns:
the current filter or null.

getPreviousFilter

Filter getPreviousFilter(Class clazz)
Gets the previous registered filter of the specified class activated before the current one from the filter stack of this chain. The current filter is included in the search.

Parameters:
clazz - the class or interface of the filter or null for any.
Returns:
the previous filter or null.

getPreviousFilters

List getPreviousFilters()
Gets a list of all filters activated before the current one from the filter stack of this chain. The current filter is included in the list.

Returns:
an unmodiafiable list of activated filters.

getNextFilter

Filter getNextFilter(Class clazz)
Gets the next registered filter of the specified class in the current pipe to be activated after the current one. The current filter is not included in the search.

Parameters:
clazz - the class or interface of the filter or null for any.
Returns:
the next filter or null.

getNearestFilter

Filter getNearestFilter(Class clazz)
Gets the nearest registered filter of the specified class from the filter stack of this chain. The non-activated filters in the current pipe are included in the search if the filter is not in the filter stack.

Parameters:
clazz - the class or interface of the filter or null for any.
Returns:
the nearest filter or null.

getMBeanServer

MBeanServer getMBeanServer()
Gets the MBean server.

Returns:
the MBean server or null.

getError

Throwable getError()
Gets the last throwable from the error stack of this chain.

Returns:
the throwable or null.

getErrors

List getErrors()
Gets a list of all throwables in the error stack of this chain.

Returns:
an unmodifiable list of throwables.

pushError

void pushError(Throwable error)
Pushes a throwable to the error stack without throwing one.

Parameters:
error - the reason throwable.

popError

Throwable popError()
Pops a throwable from the error stack.

Returns:
the thowable or null.

containsErrors

boolean containsErrors()
Checks whether this chain contains errors.

Returns:
true if the error stack is not empty.

clearErrors

void clearErrors()
Clears throwables from the error stack of this chain.


doFilter

void doFilter(ServletRequest request,
              ServletResponse response)
              throws ServletException,
                     IOException
Passes the request and response to the next filter.

Specified by:
doFilter in interface FilterChain
Parameters:
request - the request to pass along in the chain.
response - the response to pass along in the chain.
Throws:
ServletException - for servlet errors.
IOException - for general errors.

doFilter

void doFilter(ServletRequest request,
              ServletResponse response,
              Filter filter)
              throws ServletException,
                     IOException
Invokes the specified filter.

Parameters:
request - the request to pass along in the chain.
response - the response to pass along in the chain.
filter - the filter to invoke.
Throws:
ServletException - for servlet errors.
IOException - for general errors.

doFilter

void doFilter(ServletRequest request,
              ServletResponse response,
              FilterMBeanReference[] filters)
              throws ServletException,
                     IOException
Invokes the first filter in a list of filter handles and continues with the rest as long as the preceding filter passes the request forward.

Parameters:
request - the request to pass along in the chain.
response - the response to pass along in the chain.
filters - an array of filter references.
Throws:
ServletException - for servlet errors.
IOException - for general errors.

terminate

void terminate()
Terminates the filter chain.



Copyright © 2004 The Norther Organization. All rights reserved.