Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Only before advice is supported on handler join points (compiler limitation)

Hello all,
Newbie here trying to use AspectJ in a project after trying out some
examples.
I get the following warnings when I build my project and could not figure
out what it meant.
"Only before advice is supported on handler join points (compiler
limitation)"

I have a simple tracing aspect(code listed below). I have a whole bunch of
classes and get several pages of the same warning on multiple classes.
However when I run the application I do see before and after messages.

Thanks,
Arun N

-----
Several lines of the same warining are output

[iajc] C:\WorkSpace\LifeCycleTool\src\com\lct\dao\ProjectDao.java:530 Only
before advice is supported on handler join points (compiler limitation)
        [iajc] C:\WorkSpace\LifeCycleTool\src\com\lct\TraceAspect.java:25
Only before advice is supported on handler join points (compiler limitation)
        [iajc]
C:\WorkSpace\LifeCycleTool\src\com\lct\dao\ProjectDao.java:538 Only before
advice is supported on handler join points (compiler limitation)
        [iajc] C:\WorkSpace\LifeCycleTool\src\com\lct\TraceAspect.java:25
Only before advice is supported on handler join points (compiler limitation)
        [iajc]
C:\WorkSpace\LifeCycleTool\src\com\lct\design\LinkSchemaAction.java:85 Only
before advice is supported on handler join points (compiler limitation)
-----


TracingAspect.java

public aspect TraceAspect {
private int _callDepth = -1;

pointcut tracePoints() : !within(TraceAspect);

before() :tracePoints() {
	_callDepth++;
	print("+++ Before", thisJoinPoint);
}

after() :tracePoints() {
	print("+++ After", thisJoinPoint);
	_callDepth--;
}

private void print(String prefix, Object message) {
	for(int i=0,spaces = _callDepth*2; i <spaces; i++) {
		System.out.print(" ");
	}
	System.out.println(prefix + ":" + message);
}
}



Back to the top