Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Excluding Particular Joinpoints

Hello All,

 

I am using AspectJ in a project to log all handled exceptions.  In general this is what I want, but in a small number of cases such exceptions are “expected” and I do not wish to log them.  My pointcut definition is currently very simple; it matches all exception handlers except those that handle SocketTimeoutExceptions:

 

  pointcut exceptionHandlers(Throwable t) : handler(Throwable+) && (args(t)

      && !args(java.net.SocketTimeoutException));

 

However, now I need to exclude matching of particular exception handlers that are not distinguishable by type.  I tried creating a custom annotation with target type LOCAL_VARIABLE and using this annotation to decorate the exception, but unfortunately annotations of this type are not retained for runtime (and are therefore inaccessible).  Does anyone have any suggestions?

 

Thanks in advance,

Tobias

 


Back to the top