<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Re: The reuse&&JBoss AOP
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/flavia.rainone%40jboss.com">Flavia Rainone</a> in <i>JBoss AOP</i> - <a href="http://community.jboss.org/message/583686#583686">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><blockquote class="jive-quote"><p>loupi loupi wrote:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><strong><span style="visibility: visible;">Question N=&#176;1 </span><span id="result_box" lang="en"><span class="hps" title="Cliquer ici pour voir d'autres traductions">how</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">JBoss</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">AOP</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">defines</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">an</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">abstract aspect</span><span title="Cliquer ici pour voir d'autres traductions">?</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">and how</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">it</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">makes</span> the <span class="hps" title="Cliquer ici pour voir d'autres traductions">reuse?(</span></span><span id="result_box" lang="en"><span class="hps" title="Cliquer ici pour voir d'autres traductions">example</span> in AspectJ <span class="hps" title="Cliquer ici pour voir d'autres traductions">we</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">find</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions"> </span><span class="hps" title="Cliquer ici pour voir d'autres traductions">Abstarct aspect)</span></span></strong><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></blockquote><p>JBoss AOP does not define an abstract aspect, you can however write an abstract class that will be the superclass of your aspect,&#160; or define a common interface to more than one aspects in your system. The reason for this is that JBoss AOP, differently from AspectJ, is not an AOP language, it is an AOP tool. It will weave code that has been previously compiled with javac.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><blockquote class="jive-quote"><p>loupi loupi wrote:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><strong><span lang="en"><span class="hps" title="Cliquer ici pour voir d'autres traductions">Question N=&#176;2 </span></span><span id="result_box" lang="en"><span class="hps" title="Cliquer ici pour voir d'autres traductions">how</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">can</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">we</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">access</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">to</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">variable with</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">the</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">mixin</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">mechanism?</span></span><span id="result_box" lang="en"><span class="hps" title="Cliquer ici pour voir d'autres traductions">because</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">I</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">followed</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">your</span> <span class="hps" title="Cliquer ici pour voir d'autres traductions">example</span></span></strong></blockquote><p>See the previous paragraph. As JBoss AOP is a Java tool, your code needs to compile first, using a plain Java compiler.</p><p>Still, what you want to do can be achieved. There is a very good example in our dist, in the examples dir. The <a class="jive-link-external-small" href="http://http://docs.jboss.org/jbossaop/docs/2.0.0.GA/docs/aspect-framework/examples/introductions/introductions.html">introductions</a> example contains the POJO2ExternalizableMixin, that acquires access to the class it is applied to, POJO2, in its constructor. You would have to do the same, i.e., FooMixin will receive Foo in its constructor, initialize a private field with foo, and use that to get access to fooMethod2 value:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java"><font color="navy"><b>public</b></font> clas FooMixin <font color="navy"><b>implements</b></font> FooInt <font color="navy">{</font>
&#160;
&#160;&#160;&#160;&#160; <font color="navy"><b>private</b></font> Foo target;
&#160;
&#160;&#160;&#160;&#160; <font color="navy"><b>public</b></font> FooMixin (Foo foo) <font color="navy">{</font>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; target = foo;
&#160;&#160;&#160;&#160; <font color="navy">}</font>
&#160;
&#160;&#160;&#160;&#160; <font color="navy"><b>public</b></font> String fooMethod2 (<font color="navy"><b>int</b></font> i) <font color="navy">{</font>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="navy"><b>return</b></font> Integer.toString (target.fooField - i); 
&#160;&#160;&#160;&#160; <font color="navy">}</font>
<font color="navy">}</font>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Check out introductions example code to see the details (it is in the docs/aspect-framework/examples/introductions path of your JBoss AOP installation dir).</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/583686#583686">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss AOP at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2027">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>