Hi
Ich habe folgenden Code:
Nun möchte ich den auskommentierten Code ausführen.Es kommt folgender Fehler:
wie kann ich innerhalb der Methoden auf die Annotation zugreifen ?
Ich habe folgenden Code:
Java:
import org.apache.commons.lang.ArrayUtils;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
@Aspect
public class SecurityAdvice
{
@Around("execution(@Deny * (@SafetyCritical *).*(..))")
public Object translateExceptionsDeny(ProceedingJoinPoint pjp /*,Deny deny*/ ) throws Throwable
{
Account account = (Account) pjp.getArgs()[0];
/*if (ArrayUtils.contains(deny.value(), account.getRole()))
{
throw new IllegalAccessException("");
}*/
return pjp.proceed();
}
@Around("execution(@Allow * (@SafetyCritical *).*(..))")
public Object translateExceptionsAllow(ProceedingJoinPoint pjp/*, Allow allow*/) throws Throwable
{
Account account = (Account) pjp.getArgs()[0];
/*if (!ArrayUtils.contains(allow.value(), account.getRole()))
{
throw new IllegalAccessException("");
}*/
return pjp.proceed();
}
}
Nun möchte ich den auskommentierten Code ausführen.Es kommt folgender Fehler:
Java:
error at ::0 formal unbound in pointcut
wie kann ich innerhalb der Methoden auf die Annotation zugreifen ?