summaryrefslogtreecommitdiffstats
path: root/docs/sandbox/common/tracing/TraceJoinPointsBase.java
diff options
context:
space:
mode:
authorwisberg <wisberg>2003-08-06 02:08:40 +0000
committerwisberg <wisberg>2003-08-06 02:08:40 +0000
commita63bc04fb1cb6e8d6d0bc2a509ab9658e3d78c43 (patch)
treecd4e827c60136df7bf9850591b0c64baff549d20 /docs/sandbox/common/tracing/TraceJoinPointsBase.java
parentb0d37c4b51a344bee94bb7f7cc1ecef1a233e3ab (diff)
downloadaspectj-a63bc04fb1cb6e8d6d0bc2a509ab9658e3d78c43.tar.gz
aspectj-a63bc04fb1cb6e8d6d0bc2a509ab9658e3d78c43.zip
initial checkin of the sandbox.
The basic structure and examples of each type are there, but I have more examples and the ones there are not altogether validated. I'll make a few more changes before emailing dev and users about usage, etc.
Diffstat (limited to 'docs/sandbox/common/tracing/TraceJoinPointsBase.java')
-rw-r--r--docs/sandbox/common/tracing/TraceJoinPointsBase.java53
1 files changed, 53 insertions, 0 deletions
diff --git a/docs/sandbox/common/tracing/TraceJoinPointsBase.java b/docs/sandbox/common/tracing/TraceJoinPointsBase.java
new file mode 100644
index 000000000..d06423001
--- /dev/null
+++ b/docs/sandbox/common/tracing/TraceJoinPointsBase.java
@@ -0,0 +1,53 @@
+
+// START-SAMPLE tracing-traceJoinPoints Trace join points executed
+/* TraceJoinPointsBase.java */
+
+package tracing;
+
+import org.aspectj.lang.JoinPoint;
+
+/**
+ * Trace join points being executed in context.
+ * To use this, define the abstract members in a subaspect.
+ * <b>Warning</b>: this does not trace join points that do not
+ * support after advice.
+ * @author Jim Hugunin, Wes Isberg
+ */
+abstract aspect TraceJoinPointsBase {
+ // this line is for AspectJ 1.1
+ // for Aspectj 1.0, use "TraceJoinPointsBase dominates * {"
+ declare precedence : TraceJoinPointsBase, *;
+
+ abstract protected pointcut entry();
+
+ protected pointcut exit(): call(* java..*.*(..));
+
+ final pointcut start(): entry() && !cflowbelow(entry());
+
+ final pointcut trace(): cflow(entry())
+ && !cflowbelow(exit()) && !within(TraceJoinPointsBase+);
+
+ private pointcut supportsAfterAdvice() : !handler(*)
+ && !preinitialization(new(..));
+
+ before(): start() { startLog(); }
+
+ before(): trace() && supportsAfterAdvice(){
+ logEnter(thisJoinPointStaticPart);
+ }
+
+ after(): trace() && supportsAfterAdvice() {
+ logExit(thisJoinPointStaticPart);
+ }
+
+ after(): start() { completeLog(); }
+
+ abstract protected void logEnter(JoinPoint.StaticPart jp);
+ abstract protected void logExit(JoinPoint.StaticPart jp);
+ abstract protected void startLog();
+ abstract protected void completeLog();
+}
+
+// END-SAMPLE tracing-traceJoinPoints
+
+ \ No newline at end of file