+1 This provides more control.
We should also define a way of specifying the order of interceptor
execution.

If we are gonna promote lambda handlers we can provide something like:

new MSF4JRunner()
    .addInterceptor("/path/with/wild/cards/and/path/params", new
Interceptor())
    .deploy(lambdaHandlers)
    .start()



On Fri, Mar 11, 2016 at 2:29 PM, Afkham Azeez <[email protected]> wrote:

> It would be elegant to specify the interceptors as annotations rather than
> programatically adding them.
>
> e.g. 1
> Apply interceptors globally to all operations in a service
>
> @Path("/foo")
> @Interceptor(classes = {"org.wso2.msf4j.OAuthInterceptor",
> "org.wso2.msf4j.LogInterceptor"})
> public class FooService {
>
> }
>
> e.g.2
> Apply interceptors selectively to operations
>
> @Path("/foo")
> @Interceptor(classes = {"org.wso2.msf4j.LogInterceptor"})
> public class FooService {
>
>    @Path("secure")
>    @Interceptor(classes={"org.wso2.msf4j.OAuthInterceptor"})
>    public void secureOp(){}
>
>    @Path("unsecure")
>    public void unsecureOp{}
> }
>
> Thoughts welcome. This would simplify the programming model for users of
> MSF4J.
>
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * <http://www.apache.org/>*
> *email: **[email protected]* <[email protected]>
> * cell: +94 77 3320919 <%2B94%2077%203320919>blog: *
> *http://blog.afkham.org* <http://blog.afkham.org>
> *twitter: **http://twitter.com/afkham_azeez*
> <http://twitter.com/afkham_azeez>
> *linked-in: **http://lk.linkedin.com/in/afkhamazeez
> <http://lk.linkedin.com/in/afkhamazeez>*
>
> *Lean . Enterprise . Middleware*
>



-- 
Samiyuru Senarathne
*Software Engineer*
Mobile : +94 (0) 71 134 6087
[email protected]
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to