Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Cflow/StackOverflow Problem that drives me crazy

	Hi,

	I have a problem that is driving me crazy.

I want to secure the calls to getters for my class "Location_base" using acegy and AspectJ.

	So i wrote an around advice :

	private AspectJSecurityInterceptor securityInterceptor;
	
public pointcut locationReadOperations():(execution(public * org.taktik.digiscreen.Location_base+.get*()));
	
	
Object around():(locationReadOperations() && !cflow(execution(public * org.taktik.digiscreen.security.*.*(..)))) {
		if (this.securityInterceptor != null) {
			System.out.println("In around : " + thisJoinPoint.getSignature());
			AspectJCallback callback = new AspectJCallback() {
				public Object proceedWithObject() {
					try {
						return proceed();
					} catch (Throwable e) {
						e.printStackTrace();
					}
					return null;
				}
			};
			return securityInterceptor.invoke(thisJoinPoint, callback);
		} else {
			return proceed();
		}
	}



I get a stack Overflow because the code that is executed by the securityInterceptor calls Location_base.get* and gets intercepted. But this code is in the package org.taktik.digiscreen.security and should not be intercepted because of the " !cflow(execution(public * org.taktik.digiscreen.security.*.*(..)))" part of the pointCut.

Am I missing something? Please help me

Antoine




Back to the top