<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">That is a wonderful solution, I'll try that<div><br><div><div>On May 23, 2013, at 3:55 PM, "Lincoln Baxter, III" &lt;<a href="mailto:lincolnbaxter@gmail.com">lincolnbaxter@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">If you are going down that route, just use a CDI extension scan the hierarchy for annotations, then add those annotations to the implementation bean, something like this:&nbsp;<div><br></div><div><a href="https://github.com/forge/core/blob/2.0/container/src/main/java/org/jboss/forge/furnace/impl/ContainerServiceExtension.java#L56">https://github.com/forge/core/blob/2.0/container/src/main/java/org/jboss/forge/furnace/impl/ContainerServiceExtension.java#L56</a><br>
</div><div><br></div><div style="">Then CDI will behave as if your implementations were actually annotated with that annotation. You'll have to modify/wrap the AnnotatedType in this observer method so that the appropriate annotations are returned.</div>
<div style=""><br></div><div style="">CDI is wonderful.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 23, 2013 at 9:50 AM, Erik Jan de Wit <span dir="ltr">&lt;<a href="mailto:edewit@redhat.com" target="_blank">edewit@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Right what I should have added is that on the server side the interceptors are cdi interceptors and I cannot just change the way cdi will look for annotations. The other way around only have them on the implementation also doesn't work because the client side code will not be able to access the implementation. So possible solution would be to recreate the cdi interceptor concept our self.&nbsp;</div>
<div><div class="h5"><br><div><div>On May 23, 2013, at 3:40 PM, "Lincoln Baxter, III" &lt;<a href="mailto:lincolnbaxter@gmail.com" target="_blank">lincolnbaxter@gmail.com</a>&gt; wrote:</div><br><blockquote type="cite">
<div dir="ltr">Ah yes, the good old "why are my annotated interface method annotations not inherIted?" question. This all depends on how you are scanning for the annotation. Typically annotation scanning only looks at the base level class, but you generally have to walk up the type hierarchy to find the real answer :) like so:<div>

<br></div><div><a href="https://github.com/forge/core/blob/2.0/container-api/src/main/java/org/jboss/forge/furnace/util/Annotations.java#L189" target="_blank">https://github.com/forge/core/blob/2.0/container-api/src/main/java/org/jboss/forge/furnace/util/Annotations.java#L189</a><br>

</div><div><br></div><div>Hope this helps,</div><div>~Lincoln</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 23, 2013 at 6:02 AM, Erik Jan de Wit <span dir="ltr">&lt;<a href="mailto:edewit@redhat.com" target="_blank">edewit@redhat.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div>Good news I think I'm done with the security module, finally. But there is one last thing that is bothering me. Maybe someone has a solution I didn't think of.</div>

<div><br></div><div>Like I've explained before I have a 2 SecurityInterceptors one on the client and one on the server. With the client security interceptor I check the servers state and 'redirect' the user to the login page if he is not logged in. Because the client can be manipulated there is also a server side interceptor that will throw a exception if the user is not logged in.</div>

<div><br></div><div>This is all very nice and all a user will have to do is annotate the methods. I use the same annotation for both the client and the server side interceptor, but I have to annotate the remote interface and the service implementation e.g.</div>

<div><br></div><div><pre style="line-height:16px;width:744px;font-size:12px;margin-bottom:0px;font-family:Consolas,'Liberation Mono',Courier,monospace;margin-top:0px;word-wrap:break-word;padding:0px"><div><span>@Remote</span></div>

<div><span style="font-weight:bold">public</span> <span style="font-weight:bold">interface</span> <span style="color:rgb(68,85,136);font-weight:bold">MessageService</span> <span style="font-weight:bold">{</span></div><div>

  <span>@RequireAuthentication</span></div><div>  <span style="color:rgb(51,51,51)">String</span> <span style="color:rgb(153,0,0);font-weight:bold">hello</span><span style="font-weight:bold">();</span></div><div>&nbsp;</div><div>

  <span>@RequireRoles</span><span style="font-weight:bold">(</span><span style="color:rgb(221,17,68)">"admin"</span><span style="font-weight:bold">)</span></div><div>  <span style="color:rgb(51,51,51)">String</span> <span style="color:rgb(153,0,0);font-weight:bold">ping</span><span style="font-weight:bold">();</span></div>

<div><span style="font-weight:bold">}</span></div></pre><div><br></div></div><div><pre style="line-height:16px;width:744px;font-size:12px;margin-bottom:0px;font-family:Consolas,'Liberation Mono',Courier,monospace;margin-top:0px;word-wrap:break-word;padding:0px"><div><span>@Service</span></div><div><span style="font-weight:bold">public</span> <span style="font-weight:bold">class</span> <span style="color:rgb(68,85,136);font-weight:bold">MessageServiceImpl</span> <span style="font-weight:bold">implements</span> <span style="color:rgb(51,51,51)">MessageService</span> <span style="font-weight:bold">{</span></div>

<div>  <span>@Inject</span></div><div>  <span style="color:rgb(51,51,51)">AuthenticationService</span> <span style="color:rgb(51,51,51)">authenticationService</span><span style="font-weight:bold">;</span></div><div>&nbsp;</div>

<div>  <span>@Override</span></div><div>  <span>@RequireAuthentication</span></div><div>  <span style="font-weight:bold">public</span> <span style="color:rgb(51,51,51)">String</span> <span style="color:rgb(153,0,0);font-weight:bold">hello</span><span style="font-weight:bold">()</span> <span style="font-weight:bold">{</span></div>

</pre><div><br></div></div><div><br></div><div>What I don't like is that the user will need to keep these to in sync, do you guys have an idea to have only one of these but still have both of the interceptors triggered?</div>

<div><br></div><div>Cheers,</div><div><span style="white-space:pre-wrap">        </span>Erik Jan</div><div><br></div></div><br>_______________________________________________<br>
errai-dev mailing list<br>
<a href="mailto:errai-dev@lists.jboss.org" target="_blank">errai-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/errai-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/errai-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.org/" target="_blank">http://ocpsoft.org</a><br>

"Simpler is better."
</div>
_______________________________________________<br>errai-dev mailing list<br><a href="mailto:errai-dev@lists.jboss.org" target="_blank">errai-dev@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/errai-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/errai-dev</a></blockquote>
</div><br></div></div></div><br>_______________________________________________<br>
errai-dev mailing list<br>
<a href="mailto:errai-dev@lists.jboss.org">errai-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/errai-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/errai-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.org/" target="_blank">http://ocpsoft.org</a><br>
"Simpler is better."
</div>
_______________________________________________<br>errai-dev mailing list<br><a href="mailto:errai-dev@lists.jboss.org">errai-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/errai-dev</blockquote></div><br></div></body></html>