Hello All,
I have an idea to create reusable annotations for tapestry using
AspectJ.
Here is the example:
ANNOTATION:
@Target( { ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface Intercept {
String value();
}
ASPECT:
public aspect InterceptWorker {
pointcut operation() : execution(@Intercept * *(..));
void around() : operation() {
IPage page = (IPage) thisJoinPoint.getThis();
// GET INTERCEPTOR FROM REGISTRY AND APPLY IT
proceed();
}
}
USAGE:
public abstract MyPage extends BasePage {
@Intercept("service:research.MyInterceptor")
public void doSomething() {
}
}
Problem:
We cannot use injections in this case.
Is it possible to get object from hivemind registry in page class?
--
Thank you,
Alex
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]