According to the new Interceptor support in msf4j-2.3.0-m2
AFAIU,
We can bind interceptors for a given microservice as below.
InterceptorService is the micro service that is going to be
intercepted by RequestInterceptors and Responseinterceptors annotated
by
@RequestInterceptor and @ResponseInterceptor
@Component(
> name = "InterceptorService",
> service = Microservice.class,
> immediate = true
> )@Path("/interceptor-service")public class InterceptorService implements
> Microservice {
>
>
> private static final Logger log =
> LoggerFactory.getLogger(InterceptorService.class);
>
>
> /** * Method for getting the micro-service name. * * @return
> name of the micro-service. */
> @GET
> @Path("/service-name")
> @RequestInterceptor(HTTPRequestLogger.class)
> @ResponseInterceptor(HTTPResponseLogger.class)
> public String getServiceName() {
> log.info("HTTP Method Execution - getServiceName()");
> return "WSO2 Service";
> }
> }
>
> 1. Can we use @RequestInterceptor and @ResponseInterceptor annotations to
the class level so that it will apply for every resource invocation?
2. Can we plug a custom request/response interceptors?
Can it be supported something similar to below.
We have a class called ABCRequestInterceptor which implements
RequestInterceptor
and there can be classes that extends
ABCRequestInterceptor
But , we bind the interceptor as
@RequestInterceptor(ABCRequestInterceptor.class)
Will this bind extended Interceptors too to the InterceptorService?
Thanks & Regards,
Ishara Cooray
Senior Software Engineer
Mobile : +9477 262 9512
WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev