public interface MyInterface {
String someMethod();
}
@Decorator
@Priority(Interceptor.Priority.APPLICATION)
public class OuterDecorator implements MyInterface {
@Inject @Delegate MyInterface delegate;
@Inject @Decorated Bean<MyInterface> beanMetaData;
@Override
public String someMethod() {
System.out.println("Outer,bean="+beanMetaData.getBeanClass().getName());
return delegate.someMethod();
}
}
@Decorator
@Priority(Interceptor.Priority.APPLICATION+1)
public class InnerDecorator implements MyInterface {
@Inject @Delegate
MyInterface delegate;
@Inject @Decorated
Bean<MyInterface> beanMetaData;
@Override
public String someMethod() {
System.out.println("Inner,bean="+beanMetaData.getBeanClass().getName());
return delegate.someMethod();
}
}