|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.wgen.op.http.filter.ParamTriggerFilter
An HttpFilter that evaluates the request parameters and triggers specific behavior. Param names in the filter's config that start with "initializer" should have values that are the fully-qualified java class names of classes that implement the TriggerInitializer interface. These objects, once instantiated and invoked, will register their ParamTriggers in this filter. When acting on HttpServletRequests, the filter evaluates the request parameter names and fires triggers that respond to the parameter names. ParamTriggerListeners that are registered with the ParamTriggers are then notified when the ParamTrigger fires in response to the presence of the parameter. Some ParamTriggers may also set values in the HttpSession.
| Field Summary | |
private javax.servlet.FilterConfig |
_filterConfig
|
private java.util.Map |
_triggers
|
private static org.apache.log4j.Logger |
LOG
|
| Constructor Summary | |
ParamTriggerFilter()
|
|
| Method Summary | |
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain filterChain)
Perform the filter by unpacking the request parameters, evaluating each, adding anything from the session, continuing with the filterChain, and then once back, telling the WebAppStats that the request is finished. |
javax.servlet.FilterConfig |
getFilterConfig()
The configuration available for usage by TraceTriggerInitializers. |
private void |
handleParam(java.lang.String paramName,
java.lang.String paramValue,
ParamTriggerState triggerState,
javax.servlet.http.HttpServletRequest request)
Check whether or not any of the listeners responds to the parameter name, and if a trigger does, fire it. |
void |
init(javax.servlet.FilterConfig filterConfig)
Check the filter's parameters for property names that start with "initializer" and try to instantiate and invoke those TriggerInitializer instances to register triggers in the filter. |
private void |
processTriggerStoredSessionValues(ParamTriggerState triggerState,
javax.servlet.http.HttpServletRequest request)
After processing each param, tell each trigger to fire any session-stored information it cares about. |
void |
registerTrigger(ParamTrigger trigger)
Add a trigger to the filter. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final org.apache.log4j.Logger LOG
private java.util.Map _triggers
private javax.servlet.FilterConfig _filterConfig
| Constructor Detail |
public ParamTriggerFilter()
| Method Detail |
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
init in interface javax.servlet.FilterfilterConfig -
javax.servlet.ServletException - if the initializer class cannot be instantiated, or if the object
instantiated does not implement the TriggerInitializer interfacepublic javax.servlet.FilterConfig getFilterConfig()
public void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain filterChain)
throws java.io.IOException,
javax.servlet.ServletException
doFilter in interface javax.servlet.Filterrequest - response - filterChain -
java.io.IOException
javax.servlet.ServletExceptionpublic void destroy()
destroy in interface javax.servlet.Filter
private void processTriggerStoredSessionValues(ParamTriggerState triggerState,
javax.servlet.http.HttpServletRequest request)
triggerState - request - ParamTrigger.fireSessionStoredAttribs(ParamTriggerState, javax.servlet.http.HttpServletRequest)
private void handleParam(java.lang.String paramName,
java.lang.String paramValue,
ParamTriggerState triggerState,
javax.servlet.http.HttpServletRequest request)
paramName - the parameter nameparamValue - the value of the parametertriggerState - the state object containing which triggers have fired and what options have been setrequest - the request being evaluated by the filterpublic void registerTrigger(ParamTrigger trigger)
trigger -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||