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 3320919blog: **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*
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to