|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.norther.tammi.core.base.Adaptee org.norther.tammi.spray.filter.DefaultFilter org.norther.tammi.spray.filter.DefaultPipe
public class DefaultPipe
A default implementation of Pipe invoking a series of filters that have been configured to be called in order.
Field Summary |
---|
Fields inherited from class org.norther.tammi.core.base.Adaptee |
---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
Constructor Summary | |
---|---|
DefaultPipe()
Constructs a new pipe. |
Method Summary | ||
---|---|---|
void |
addFilterName(int index,
ObjectName name)
Adds a new filter to the given location. |
|
void |
addFilterName(ObjectName name)
Adds a new filter to the end of the pipe. |
|
void |
clearFilterNames()
Clears all filters from the pipe. |
|
boolean |
containsFilterName(ObjectName filter)
Checks whether the specified filter is in the pipe. |
|
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
Causes the specified request and response to be processed by the filters associated with this pipe, until one of these filters causes the response to be created and returned. |
|
ObjectName |
getFilterName(int index)
Gets the indexed filter in the pipe. |
|
List<ObjectName> |
getFilterNames()
Gets filters in the pipe. |
|
FilterReference.FilterState |
getFilterState(ObjectName filter)
Gets the state of the named filter. |
|
FilterReference.FilterState |
getFilterState(ObjectName filter,
int index)
Gets the state of the indexed filter. |
|
Filter |
getFirstFilter()
Gets the first registered filter in the pipe. |
|
|
getFirstFilter(Class<F> clazz)
Gets the first registered filter of the specified class in the pipe. |
|
Filter |
getLastFilter()
Gets the last registered filter in the pipe. |
|
|
getLastFilter(Class<F> clazz)
Gets the last registered filter of the specified class in the pipe. |
|
Filter |
getNextFilter(int index)
Gets the next registered filter following the given location. |
|
|
getNextFilter(int index,
Class<F> clazz)
Gets the next registered filter of the specified class following the given location. |
|
Filter |
getPreviousFilter(int index)
Gets the previous registered filter preceding the given location. |
|
|
getPreviousFilter(int index,
Class<F> clazz)
Gets the previous registered filter of the specified class preceding the given location. |
|
protected int |
locate(ObjectName filter,
FilterHandle<?>[] list,
int start)
Locates the specified filter in the filter list from the given location. |
|
|
locateFilter(Class<F> clazz)
Locates the first registered filter of the specified class in the pipe. |
|
|
locateFilter(int index,
Class<F> clazz)
Locates the next registered filter of the specified class following the given location. |
|
int |
locateNamedFilter(ObjectName filter)
Locates the named filter in the pipe. |
|
int |
locateNamedFilter(ObjectName filter,
int index)
Locates the named filter in the pipe from the given location. |
|
Filter |
queryFilter(String pattern)
Queries for a specified filter in the pipe. |
|
void |
removeFilterName(int index)
Removes the indexed filter from the pipe. |
|
void |
removeFilterName(ObjectName name)
Removes the first filter with the specified name from the pipe. |
|
void |
setFilterName(int index,
ObjectName name)
Sets the indexed filter in the pipe. |
|
void |
setFilterNames(List<ObjectName> names)
Sets filters in the pipe. |
|
void |
setFilterState(ObjectName filter,
FilterReference.FilterState state)
Sets the state of the named filter. |
|
void |
setFilterState(ObjectName filter,
int index,
FilterReference.FilterState state)
Sets the state of the indexed filter. |
Methods inherited from class org.norther.tammi.spray.filter.DefaultFilter |
---|
destroy, getFilterConfig, getRequestMap, getSessionMap, init |
Methods inherited from class org.norther.tammi.core.base.Adaptee |
---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, postmanaged, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unmanaged, unregister |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.Filter |
---|
destroy, init |
Constructor Detail |
---|
public DefaultPipe()
Method Detail |
---|
public List<ObjectName> getFilterNames()
Pipe
getFilterNames
in interface Pipe
public void setFilterNames(List<ObjectName> names)
Pipe
setFilterNames
in interface Pipe
names
- a list of object names of filters.public boolean containsFilterName(ObjectName filter)
Pipe
containsFilterName
in interface Pipe
filter
- the object name of the filter.
public ObjectName getFilterName(int index)
Pipe
getFilterName
in interface Pipe
index
- the index of the location.
public void setFilterName(int index, ObjectName name)
Pipe
setFilterName
in interface Pipe
index
- the index of the location.name
- the object name of the filter.public void addFilterName(ObjectName name)
Pipe
addFilterName
in interface Pipe
name
- the object name of the new filter.public void addFilterName(int index, ObjectName name)
Pipe
addFilterName
in interface Pipe
index
- the index of the location.name
- the object name of the new filter.public void removeFilterName(ObjectName name)
Pipe
removeFilterName
in interface Pipe
name
- the object name of the filter.public void removeFilterName(int index)
Pipe
removeFilterName
in interface Pipe
index
- the index of the location.public void clearFilterNames()
Pipe
clearFilterNames
in interface Pipe
public int locateNamedFilter(ObjectName filter)
Pipe
locateNamedFilter
in interface Pipe
filter
- the object name of the filter.
public int locateNamedFilter(ObjectName filter, int index)
Pipe
locateNamedFilter
in interface Pipe
filter
- the object name of the filter.index
- the start index of the location.
public <F extends Filter> int locateFilter(Class<F> clazz)
Pipe
locateFilter
in interface Pipe
F
- the filter type.clazz
- the class or interface.
public <F extends Filter> int locateFilter(int index, Class<F> clazz)
Pipe
locateFilter
in interface Pipe
F
- the filter type.index
- the start index of the location.clazz
- the class or interface.
public Filter queryFilter(String pattern)
Pipe
queryFilter
in interface Pipe
pattern
- the name pattern.
public Filter getFirstFilter()
Pipe
getFirstFilter
in interface Pipe
public Filter getLastFilter()
Pipe
getLastFilter
in interface Pipe
public Filter getNextFilter(int index)
Pipe
getNextFilter
in interface Pipe
index
- the index of the location.
public Filter getPreviousFilter(int index)
Pipe
getPreviousFilter
in interface Pipe
index
- the index the location.
public <F extends Filter> F getFirstFilter(Class<F> clazz)
Pipe
getFirstFilter
in interface Pipe
F
- the filter type.clazz
- the class or interface.
public <F extends Filter> F getLastFilter(Class<F> clazz)
Pipe
getLastFilter
in interface Pipe
F
- the filter type.clazz
- the class or interface.
public <F extends Filter> F getNextFilter(int index, Class<F> clazz)
Pipe
getNextFilter
in interface Pipe
F
- the filter type.index
- the index of the location.clazz
- the class or interface.
public <F extends Filter> F getPreviousFilter(int index, Class<F> clazz)
Pipe
getPreviousFilter
in interface Pipe
F
- the filter type.index
- the index of the location.clazz
- the class or interface.
public FilterReference.FilterState getFilterState(ObjectName filter)
Pipe
getFilterState
in interface Pipe
filter
- the object name of the filter.
public void setFilterState(ObjectName filter, FilterReference.FilterState state)
Pipe
setFilterState
in interface Pipe
filter
- the object name of the filter.state
- the state of the filter.public FilterReference.FilterState getFilterState(ObjectName filter, int index)
Pipe
getFilterState
in interface Pipe
filter
- the object name of the filter.index
- the start index of the location.
public void setFilterState(ObjectName filter, int index, FilterReference.FilterState state)
Pipe
setFilterState
in interface Pipe
filter
- the object name of the filter.index
- the start index of the location.state
- the state of the filter.public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException
Pipe
Note that changes to the list of filters in the pipe during one request will be effective only for forthcoming requests.
doFilter
in interface Filter
doFilter
in interface Pipe
doFilter
in class DefaultFilter
request
- the request to process.response
- the response to return.chain
- the filter chain from preceding pipes.
ServletException
- for servlet errors.
IOException
- for general errors.protected int locate(ObjectName filter, FilterHandle<?>[] list, int start)
filter
- the object name of the filter.list
- the list of filter references.start
- the start index of the location.
IndexOutOfBoundsException
- for an incorrect index.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |