<div dir="ltr">Ah yes, the good old &quot;why are my annotated interface method annotations not inherIted?&quot; 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">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 style>Hope this helps,</div><div style>~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&#39;m done with the security module, finally. But there is one last thing that is bothering me. Maybe someone has a solution I didn&#39;t think of.</div>
<div><br></div><div>Like I&#39;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 &#39;redirect&#39; 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,&#39;Liberation Mono&#39;,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> </div><div>
  <span>@RequireRoles</span><span style="font-weight:bold">(</span><span style="color:rgb(221,17,68)">&quot;admin&quot;</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,&#39;Liberation Mono&#39;,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> </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&#39;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">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>
&quot;Simpler is better.&quot;
</div>