[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [aspectj-users] Logging JNI calls with AspectJ
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> public aspect LogNativeAspect {
>
> private static boolean isNative(JoinPoint.StaticPart jpsp) {
> return Modifier.isNative(jpsp.getSignature().getModifiers());
> }
>
> pointcut nativeMethodCall() : call( * *(..)) &&
> if(isNative(thisJoinPointStaticPart));
>
> before() : nativeMethodCall() && !within(LogNativeAspect) {
> Logger.debug("Calling " +
> thisJoinPointStaticPart.getSignature().toLongString());
> }
>
> }
Interesting... does one really have to use reflection to solve this?
What would be wrong with a pointcut as call(native * *(..))? I mean
in the structural sense "native" is to a call pointcut not more than
a usual modifier (such as e.g. "static"), is it?
Eric
- --
Eric Bodden
Chair I2 for Programming Languages and Program Analysis
RWTH Aachen University
-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.3
iQA/AwUBQm5P8MwiFCm7RlWCEQJ0IgCff+hVaI57wxcq7bHf3gOhQdQ722EAn26u
E6hyajt8sJXfqH1tL8M9b1zm
=yrQV
-----END PGP SIGNATURE-----