@InterceptorBinding @Target({ ElementType.METHOD, ElementType.TYPE }) @Retention(RetentionPolicy.RUNTIME)
/** * An interceptor that is called after the FT interceptor * in the chain and count the invocation. * @author carlosdlr */ @Interceptor @InterceptLate public class LateFtInterceptor { @Inject private OrderQueueProducer orderFactory; /** * Interceptor binding for {@link LateFtInterceptor} */ @Retention(RUNTIME) @Target({ TYPE, METHOD }) @InterceptorBinding public @interface InterceptLate {} @AroundInvoke public Object intercept(InvocationContext ctx) throws Exception { orderFactory.getOrderQueue().add("LateOrderFtInterceptor"); return ctx.proceed(); } }
/** * An interceptor that is called after the FT interceptor * in the chain and count the invocation. * @author carlosdlr */ @Interceptor @InterceptLate @Priority(Interceptor.Priority.PLATFORM_AFTER+100) public class LateFtInterceptor { @Inject private OrderQueueProducer orderFactory; /** * Interceptor binding for {@link LateFtInterceptor} */ @Retention(RUNTIME) @Target({ TYPE, METHOD }) @InterceptorBinding public @interface InterceptLate {} @AroundInvoke public Object intercept(InvocationContext ctx) throws Exception { orderFactory.getOrderQueue().add("LateOrderFtInterceptor"); return ctx.proceed(); } }
/** * An interceptor that is called before the FT interceptor * in the chain and count the invocation. * @author carlosdlr */ @Interceptor @InterceptEarly public class EarlyFtInterceptor { @Inject private OrderQueueProducer orderFactory; /** * Interceptor binding for {@link EarlyFtInterceptor} */ @Retention(RUNTIME) @Target({ TYPE, METHOD }) @InterceptorBinding public @interface InterceptEarly {} @AroundInvoke public Object intercept(InvocationContext ctx) throws Exception { orderFactory.getOrderQueue().add("EarlyOrderFtInterceptor"); return ctx.proceed(); } }
/** * An interceptor that is called after the FT interceptor * in the chain and count the invocation. * @author carlosdlr */ @Interceptor @InterceptLate @Priority(Interceptor.Priority.PLATFORM_AFTER - 100) public class LateFtInterceptor { @Inject private OrderQueueProducer orderFactory; /** * Interceptor binding for {@link LateFtInterceptor} */ @Retention(RUNTIME) @Target({ TYPE, METHOD }) @InterceptorBinding public @interface InterceptLate {} @AroundInvoke public Object intercept(InvocationContext ctx) throws Exception { orderFactory.getOrderQueue().add("LateOrderFtInterceptor"); return ctx.proceed(); } }
/** * An interceptor that is called before the FT interceptor * in the chain and count the invocation. * @author carlosdlr */ @Interceptor @InterceptEarly @Priority(Interceptor.Priority.PLATFORM_AFTER - 200) public class EarlyFtInterceptor { @Inject private OrderQueueProducer orderFactory; /** * Interceptor binding for {@link EarlyFtInterceptor} */ @Retention(RUNTIME) @Target({ TYPE, METHOD }) @InterceptorBinding public @interface InterceptEarly {} @AroundInvoke public Object intercept(InvocationContext ctx) throws Exception { orderFactory.getOrderQueue().add("EarlyOrderFtInterceptor"); return ctx.proceed(); } }
/** * An interceptor that is called before the FT interceptor * in the chain and count the invocation. * @author carlosdlr */ @Interceptor @InterceptEarly @Priority(Interceptor.Priority.PLATFORM_AFTER) // Before FT Interceptor public class EarlyFtInterceptor { @Inject private OrderQueueProducer orderFactory; /** * Interceptor binding for {@link EarlyFtInterceptor} */ @Retention(RUNTIME) @Target({ TYPE, METHOD }) @InterceptorBinding public @interface InterceptEarly {} @AroundInvoke public Object intercept(InvocationContext ctx) throws Exception { orderFactory.getOrderQueue().add("EarlyOrderFtInterceptor"); return ctx.proceed(); } }
@InterceptorBinding public @interface Binding { Annotation INSTANCE = new EmptyAnnotationLiteral<Binding>() {
@InterceptorBinding public @interface Binding { Annotation INSTANCE = new EmptyAnnotationLiteral<Binding>() {