jodd.madvoc.interceptor
Class EchoInterceptor

java.lang.Object
  extended by jodd.madvoc.interceptor.ActionInterceptor
      extended by jodd.madvoc.interceptor.EchoInterceptor
Direct Known Subclasses:
LogEchoInterceptor

public class EchoInterceptor
extends ActionInterceptor

Simple interceptor that measures time and prints out information about invoked actions. User may inherit it and change the way message is printed.


Field Summary
 
Fields inherited from class jodd.madvoc.interceptor.ActionInterceptor
initialized
 
Constructor Summary
EchoInterceptor()
           
 
Method Summary
 java.lang.Object intercept(ActionRequest actionRequest)
          Measure action invocation time.
protected  void out(java.lang.String message)
          Outputs info message.
protected  void printAfter(ActionRequest request, long executionTime, java.lang.Object result)
          Prints out the message.
protected  void printBefore(ActionRequest request)
          Prints out the message.
 
Methods inherited from class jodd.madvoc.interceptor.ActionInterceptor
init, initialized, isInitialized, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EchoInterceptor

public EchoInterceptor()
Method Detail

intercept

public java.lang.Object intercept(ActionRequest actionRequest)
                           throws java.lang.Exception
Measure action invocation time.

Specified by:
intercept in class ActionInterceptor
Throws:
java.lang.Exception

printBefore

protected void printBefore(ActionRequest request)
Prints out the message. User can override this method and modify the way the message is printed.


printAfter

protected void printAfter(ActionRequest request,
                          long executionTime,
                          java.lang.Object result)
Prints out the message. User can override this method and modify the way the message is printed.


out

protected void out(java.lang.String message)
Outputs info message. By default, it outputs it to console.



Copyright © 2003-2010 Jodd Team