net.sf.sasl.aop.monitoring.execution.time
Class MethodExecutionTimeThresholdBean

java.lang.Object
  extended by net.sf.sasl.aop.monitoring.execution.time.TimeUnitsBean
      extended by net.sf.sasl.aop.monitoring.execution.time.MethodExecutionTimeThresholdBean

public class MethodExecutionTimeThresholdBean
extends TimeUnitsBean

The bean could be used to configure individual execution time threshold values for the execution of a (targetObject, targetMethod, targetArguments) triple.

Since:
0.0.1 (sasl-common-aspect-library)
Author:
Philipp Förmer

Constructor Summary
MethodExecutionTimeThresholdBean()
           
 
Method Summary
 org.springframework.aop.MethodMatcher getMethodMatcher()
           
 int getWaitTimeBeforeNewWarnMessageSeconds()
           
 boolean matches(Object targetObject, Method targetMethod, Object[] targetArguments)
          Returns true, if the method matcher matches the given triple.
 void setMethodMatcher(org.springframework.aop.MethodMatcher methodMatcher)
          Sets the method matcher will be used to decide if this threshold configuration should be used for the execution of a (targetObject, targetMethod, targetArguments) triple.
 void setWaitTimeBeforeNewWarnMessageSeconds(int waitTimeBeforeNewWarnMessageSeconds)
          If at time t1 a warn message was raised because a method execution was slow and at time t2 a warn message could be also raised because a method execution is again slow, than the wait time defines the minimum time that must have been gone after t1 before a new warn message could be raised.
 
Methods inherited from class net.sf.sasl.aop.monitoring.execution.time.TimeUnitsBean
convertToMilliseconds, getDays, getHours, getMilliseconds, getMinutes, getSeconds, setDays, setHours, setMilliseconds, setMinutes, setSeconds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodExecutionTimeThresholdBean

public MethodExecutionTimeThresholdBean()
Method Detail

getWaitTimeBeforeNewWarnMessageSeconds

public int getWaitTimeBeforeNewWarnMessageSeconds()
Returns:
positive integer value.
Since:
0.0.1 (sasl-common-aspect-library)
See Also:
setWaitTimeBeforeNewWarnMessageSeconds(int)

setWaitTimeBeforeNewWarnMessageSeconds

public void setWaitTimeBeforeNewWarnMessageSeconds(int waitTimeBeforeNewWarnMessageSeconds)
                                            throws IllegalArgumentException
If at time t1 a warn message was raised because a method execution was slow and at time t2 a warn message could be also raised because a method execution is again slow, than the wait time defines the minimum time that must have been gone after t1 before a new warn message could be raised.
So if t2 <= t1 + wait time, than no warn message will be raised.
If t2 > t1 + wait time, than a warn message will be raised at t2.
The wait time should reduce warn message flooding.

Parameters:
waitTimeBeforeNewWarnMessageSeconds - positive integer value.
Throws:
IllegalArgumentException
Since:
0.0.1 (sasl-common-aspect-library)

getMethodMatcher

public org.springframework.aop.MethodMatcher getMethodMatcher()
Returns:
null or non null
Since:
0.0.1 (sasl-common-aspect-library)
See Also:
setMethodMatcher(MethodMatcher)

setMethodMatcher

public void setMethodMatcher(org.springframework.aop.MethodMatcher methodMatcher)
Sets the method matcher will be used to decide if this threshold configuration should be used for the execution of a (targetObject, targetMethod, targetArguments) triple.

Parameters:
methodMatcher - null or non null
Since:
0.0.1 (sasl-common-aspect-library)

matches

public boolean matches(Object targetObject,
                       Method targetMethod,
                       Object[] targetArguments)
                throws IllegalArgumentException
Returns true, if the method matcher matches the given triple. False else. If true, than this threshold configuration should be used for the execution of the target mehod.

Parameters:
targetObject - non null
targetMethod - non null
targetArguments - non null
Returns:
Throws:
IllegalArgumentException - if targetObject or targetMethod or targetArguments is null.
Since:
0.0.1 (sasl-common-aspect-library)
See Also:
MethodMatcher


Copyright © 2010. All Rights Reserved.