I'm still don't see the need for two apis? I think we have a congnitive dissonance?
Let's take the authorization interceptor as an example. There are a number of possible implementations (pseudo code): // Per join point | public class AuthenticationInterceptor extends AbstractInterceptor | implements JoinPointAware | { | private SecurityDomain domain; | private String[] roles; | private JoinPoint joinPoint; | public void setJoinPoint(JoinPoint joinPoint) | { | this.joinPoint = joinPoint; | domain = (SecurityDomain) joinPoint.getMetaData("Security", "Domain"); | roles = (String[]) joinPoint.getMetaData("Security", "Roles"); | } | | public Object invocation(Invocation invocation) throws Throwable | { | Principal principal = invocation.getMetaData("Security", "Principal"); | if (domain.authorize(principal, roles) == false) | throw new SecurityException(principal + " not authorized for " + joinPoint.toHumanReadableString()); | return invocation.invokeNext(); | } | } | // Shared | public class AuthenticationInterceptor extends AbstractInterceptor | { | public Object invocation(Invocation invocation) throws Throwable | { | Principal principal = invocation.getMetaData("Security", "Principal"); | domain = (SecurityDomain) invocation.getMetaData("Security", "Domain"); | roles = (String[]) invocation.getMetaData("Security", "Roles"); | if (domain.authorize(principal, roles) == false) | throw new SecurityException(principal + " not authorized for " + invocation.toHumanReadableString()); | return invocation.invokeNext(); | } | } | Note: obviously joinPoint.getMetaData() will cascade through instance, class, vm and invocation through invocation, transaction, joinPoint, class, vm or whatever levels of metadata are defined. The problem with the latter implementations is that we know an invocation should not override the domain. So why not have an extra parameter where we can limit the contexts, e.g. | domain = (SecurityDomain) invocation.getMetaData("Security", "Domain", Scope.JOIN_POINT); | | with: | | public Object getMetaData(String context, String id, Scope startScope); | View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3861215#3861215 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3861215 ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ JBoss-Development mailing list JBoss-Development@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-development