Java Simon 3.5.0

org.javasimon.javaee
Class SimonServletFilterUtils

java.lang.Object
  extended by org.javasimon.javaee.SimonServletFilterUtils

public class SimonServletFilterUtils
extends Object

Various supporting utility methods for SimonServletFilter.

Author:
virgo47@gmail.com

Constructor Summary
SimonServletFilterUtils()
           
 
Method Summary
static String getSimonName(String uri, Replacer unallowedCharacterReplacer)
          Returns Simon name for the specified request (local name without any configured prefix).
static RequestReporter initRequestReporter(javax.servlet.FilterConfig filterConfig)
          Returns RequestReporter for the class specified for context parameter SimonServletFilter.INIT_PARAM_REQUEST_REPORTER_CLASS.
protected static StopwatchSource<javax.servlet.http.HttpServletRequest> initStopwatchSource(javax.servlet.FilterConfig filterConfig, Manager manager)
          Create and initialize the stopwatch source depending on the filter init parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimonServletFilterUtils

public SimonServletFilterUtils()
Method Detail

getSimonName

public static String getSimonName(String uri,
                                  Replacer unallowedCharacterReplacer)
Returns Simon name for the specified request (local name without any configured prefix). By default dots and all non-simon-name compliant characters are removed first, then all slashes are switched to dots (repeating slashes make one dot).

Parameters:
uri - request URI
unallowedCharacterReplacer - replacer for characters that are not allowed in Simon name
Returns:
local part of the Simon name for the request URI (without prefix)

initStopwatchSource

protected static StopwatchSource<javax.servlet.http.HttpServletRequest> initStopwatchSource(javax.servlet.FilterConfig filterConfig,
                                                                                            Manager manager)
Create and initialize the stopwatch source depending on the filter init parameters. Both monitor source class (SimonServletFilter.INIT_PARAM_STOPWATCH_SOURCE_CLASS and whether to cache results (SimonServletFilter.INIT_PARAM_STOPWATCH_SOURCE_CACHE) can be adjusted.

Parameters:
filterConfig - Filter configuration
Returns:
Stopwatch source

initRequestReporter

public static RequestReporter initRequestReporter(javax.servlet.FilterConfig filterConfig)
Returns RequestReporter for the class specified for context parameter SimonServletFilter.INIT_PARAM_REQUEST_REPORTER_CLASS.


Java Simon 3.5.0

Copyright © 2014. All rights reserved.