List of usage examples for org.springframework.aop.interceptor CustomizableTraceInterceptor CustomizableTraceInterceptor
CustomizableTraceInterceptor
From source file:com.capgemini.boot.trace.TraceLoggerConfigurationUtils.java
/** * Creates a trace interceptor for logging entry into and exit from methods. * @param settings the settings//from w ww . j a va 2s . c om * @return The created trace interceptor */ public static AbstractTraceInterceptor createTraceInterceptor(TraceLoggerSettings settings) { CustomizableTraceInterceptor customizableTraceInterceptor = new CustomizableTraceInterceptor(); customizableTraceInterceptor.setUseDynamicLogger(true); customizableTraceInterceptor.setEnterMessage(settings.getMessage().getEnter()); customizableTraceInterceptor.setExitMessage(settings.getMessage().getExit()); customizableTraceInterceptor.setExceptionMessage(settings.getMessage().getException()); return customizableTraceInterceptor; }
From source file:pl.java.scalatech.config.AopPerformanceLogConfig.java
@Bean public CustomizableTraceInterceptor interceptor() { CustomizableTraceInterceptor interceptor = new CustomizableTraceInterceptor(); interceptor.setEnterMessage("Entering => $[methodName]($[arguments])."); interceptor.setExitMessage(/*from w w w . j a va 2 s. c o m*/ "Leaving => $[methodName](..) with return value $[returnValue], took $[invocationTime]ms."); return interceptor; }
From source file:example.springdata.jpa.interceptors.ApplicationConfiguration.java
public @Bean CustomizableTraceInterceptor interceptor() { CustomizableTraceInterceptor interceptor = new CustomizableTraceInterceptor(); interceptor.setEnterMessage("Entering $[methodName]($[arguments])."); interceptor.setExitMessage(/* ww w.jav a 2 s .c o m*/ "Leaving $[methodName](..) with return value $[returnValue], took $[invocationTime]ms."); return interceptor; }
From source file:org.spring.data.jpa.sample.interceptors.ApplicationConfiguration.java
@Bean public CustomizableTraceInterceptor interceptor() { CustomizableTraceInterceptor interceptor = new CustomizableTraceInterceptor(); interceptor.setEnterMessage("Entering $[methodName]($[arguments])."); interceptor.setExitMessage(/* ww w. j ava2 s . c o m*/ "Leaving $[methodName](..) with return value $[returnValue], took $[invocationTime]ms."); return interceptor; }
From source file:fr.univlorraine.mondossierweb.config.DebugConfig.java
/** * Interceptor permettant de logger les appels aux mthodes * @return/*from w w w . jav a2 s .c o m*/ */ @Bean public CustomizableTraceInterceptor customizableTraceInterceptor() { CustomizableTraceInterceptor customizableTraceInterceptor = new CustomizableTraceInterceptor(); customizableTraceInterceptor.setUseDynamicLogger(true); customizableTraceInterceptor.setEnterMessage("Entering $[methodName]($[arguments])"); customizableTraceInterceptor.setExitMessage("Leaving $[methodName](), returned $[returnValue]"); return customizableTraceInterceptor; }
From source file:br.com.teste.spring.security.config.AppConfig.java
@Bean public CustomizableTraceInterceptor interceptor() { CustomizableTraceInterceptor interceptor = new CustomizableTraceInterceptor(); interceptor.setEnterMessage(ENTER_METHOD_MESSAGE); interceptor.setExceptionMessage(EXCEPTION_MESSAGE); interceptor.setExitMessage(EXIT_METHOD_MESSAGE); return interceptor; }
From source file:org.springframework.aop.interceptor.CustomizableTraceInterceptorTests.java
@Test(expected = IllegalArgumentException.class) public void testSetEmptyEnterMessage() { // Must not be able to set empty enter message new CustomizableTraceInterceptor().setEnterMessage(""); }
From source file:org.springframework.aop.interceptor.CustomizableTraceInterceptorTests.java
@Test(expected = IllegalArgumentException.class) public void testSetEnterMessageWithReturnValuePlaceholder() { // Must not be able to set enter message with return value placeholder new CustomizableTraceInterceptor().setEnterMessage(CustomizableTraceInterceptor.PLACEHOLDER_RETURN_VALUE); }
From source file:org.springframework.aop.interceptor.CustomizableTraceInterceptorTests.java
@Test(expected = IllegalArgumentException.class) public void testSetEnterMessageWithExceptionPlaceholder() { // Must not be able to set enter message with exception placeholder new CustomizableTraceInterceptor().setEnterMessage(CustomizableTraceInterceptor.PLACEHOLDER_EXCEPTION); }
From source file:org.springframework.aop.interceptor.CustomizableTraceInterceptorTests.java
@Test(expected = IllegalArgumentException.class) public void testSetEnterMessageWithInvocationTimePlaceholder() { // Must not be able to set enter message with invocation time placeholder new CustomizableTraceInterceptor() .setEnterMessage(CustomizableTraceInterceptor.PLACEHOLDER_INVOCATION_TIME); }