diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/tracing-aspectj/src/main/java/org/apache')
4 files changed, 26 insertions, 12 deletions
diff --git a/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/LoggingAspect.java b/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/LoggingAspect.java index 630bcb285b..2836e90e19 100644 --- a/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/LoggingAspect.java +++ b/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/LoggingAspect.java @@ -22,11 +22,8 @@ package org.apache.tuscany.sca.aspectj; import java.util.Arrays; import org.aspectj.lang.JoinPoint; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.After; import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.AfterThrowing; -import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut; diff --git a/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/SimpleTracingAspect.java b/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/SimpleTracingAspect.java index 965cfa5b5d..83a06a771e 100644 --- a/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/SimpleTracingAspect.java +++ b/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/SimpleTracingAspect.java @@ -19,8 +19,6 @@ package org.apache.tuscany.sca.aspectj; -import java.util.Arrays; - import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; diff --git a/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/TimingAspect.java b/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/TimingAspect.java index 262742e867..8bde1d4f91 100644 --- a/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/TimingAspect.java +++ b/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/TimingAspect.java @@ -19,16 +19,9 @@ package org.apache.tuscany.sca.aspectj; -import java.util.Arrays; - -import org.aspectj.lang.JoinPoint; import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.After; -import org.aspectj.lang.annotation.AfterReturning; -import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut; /** diff --git a/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/UserTimingAspect.java b/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/UserTimingAspect.java new file mode 100644 index 0000000000..6bad09093d --- /dev/null +++ b/sca-java-2.x/trunk/modules/tracing-aspectj/src/main/java/org/apache/tuscany/sca/aspectj/UserTimingAspect.java @@ -0,0 +1,26 @@ +package org.apache.tuscany.sca.aspectj; + +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +@Aspect +public class UserTimingAspect { + @Pointcut + public void timedCall() { + + } + + @Around("timedCall()") + public Object timedSection(ProceedingJoinPoint jp) throws Throwable { + System.out.println("Timing Around timedSection jp=" + jp); + long start = System.currentTimeMillis(); + try { + return jp.proceed(); + } finally { + long end = System.currentTimeMillis(); + System.out.println("Timing Around timedSection Roundtrip is " + (end - start) + "ms for jp.getSignature=" + jp.getSignature()); + } + } +} |