[jboss-cvs] JBossAS SVN: r79413 - in projects/aop/trunk/aop/docs/examples: arrayinterception and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Oct 13 12:43:31 EDT 2008
Author: kabir.khan at jboss.com
Date: 2008-10-13 12:43:31 -0400 (Mon, 13 Oct 2008)
New Revision: 79413
Added:
projects/aop/trunk/aop/docs/examples/arrayinterception/arrayinterception.html
Removed:
projects/aop/trunk/aop/docs/examples/arrayinterception/all.html
Modified:
projects/aop/trunk/aop/docs/examples/examples.html
Log:
[JBAOP-643] Tutorial for array interception
Deleted: projects/aop/trunk/aop/docs/examples/arrayinterception/all.html
===================================================================
--- projects/aop/trunk/aop/docs/examples/arrayinterception/all.html 2008-10-13 16:40:11 UTC (rev 79412)
+++ projects/aop/trunk/aop/docs/examples/arrayinterception/all.html 2008-10-13 16:43:31 UTC (rev 79413)
@@ -1,62 +0,0 @@
-<html>
-<body>
-<p>
-<h2>Array Element Interception</h2>
-
-</p><p>
-<h4>Array Element Interception</h4>
-
-<p>To intercept when elements of an array is matched we add the following to our jboss-aop.xml:</p>
-<pre>
- <arrayreplacement class="Woven"/>
- <prepare expr="field(* Woven->ints)"/>
-
- <arraybind type="READ_WRITE">
- <interceptor-ref name="ArrayInterceptor"/>
- </arraybind>
-
-</pre>
-This first <code>arrayreplacement</code> says that whenever an array is being acessed in the class
-<code>Woven</code> we should delegate those accesses on to JBoss AOP. Next we have a
-<code>prepare</prepare> statement that picks out an array field. Since that field belongs to a
-class picked out by <code>arrayreplacement</code>, that field gets registered for array element
-interception. Finally, we have a <code>arraybind</code> that says that whenever an array whose
-access has been woven and intercepted intercepted
-we should apply <code>ArrayInterceptor</code>.
-
-</p><p>
-<h4>Running</h4>
-
-<p>
-<b>THIS EXAMPLE REQUIRES JDK 5!! For other options, please look at the
-<a href="../valid_targets_not_annotated.html"/>non-annotated examples guide</a></b> To compile and run:</p>
-<pre>
- $ run.aopc.50
-</pre>
-<p>It will javac the files and then run the AOPC precompiler to manipulate the bytecode, then finally run the example. The output should be similar to this:</p>
-<pre>
-_run.aopc.50:
- [java] --- new Woven(); ---
- [java] Initialising array
- [java] --- woven.setInt(0, 100); ---
- [java] <<< Entering ArrayInterceptor type: org.jboss.aop.array.IntArrayElementWriteInvocation
- [java] <<< We have an array element write invocation of type: org.jboss.aop.array.IntArrayElementWriteInvocation
- [java] New value for index 0 of [I at d9e5ad is 100
- [java] Typed value is 100
- [java] >>> Leaving ArrayInterceptor
- [java] --- woven.getInt(0); ---
- [java] <<< Entering ArrayInterceptor type: org.jboss.aop.array.IntArrayElementReadInvocation
- [java] <<< We have an array element read invocation of type: org.jboss.aop.array.IntArrayElementReadInvocation
- [java] >>> Returned value was 100
- [java] >>> Leaving ArrayInterceptor
- [java] --- woven.getInt(0) was 100 ---
- [java] --- new NotWoven(); ---
- [java] Initialising array
- [java] --- notWoven.setInt(0, 100); ---
- [java] --- notWoven.getInt(0); ---
- [java] --- notWoven.getInt(0) was 100 ---
-</pre>
-</p><p>
-</p>
-</body>
-</html>
Copied: projects/aop/trunk/aop/docs/examples/arrayinterception/arrayinterception.html (from rev 79411, projects/aop/trunk/aop/docs/examples/arrayinterception/all.html)
===================================================================
--- projects/aop/trunk/aop/docs/examples/arrayinterception/arrayinterception.html (rev 0)
+++ projects/aop/trunk/aop/docs/examples/arrayinterception/arrayinterception.html 2008-10-13 16:43:31 UTC (rev 79413)
@@ -0,0 +1,62 @@
+<html>
+<body>
+<p>
+<h2>Array Element Interception</h2>
+
+</p><p>
+<h4>Array Element Interception</h4>
+
+<p>To intercept when elements of an array is matched we add the following to our jboss-aop.xml:</p>
+<pre>
+ <arrayreplacement class="Woven"/>
+ <prepare expr="field(* Woven->ints)"/>
+
+ <arraybind type="READ_WRITE">
+ <interceptor-ref name="ArrayInterceptor"/>
+ </arraybind>
+
+</pre>
+This first <code>arrayreplacement</code> says that whenever an array is being acessed in the class
+<code>Woven</code> we should delegate those accesses on to JBoss AOP. Next we have a
+<code>prepare</prepare> statement that picks out an array field. Since that field belongs to a
+class picked out by <code>arrayreplacement</code>, that field gets registered for array element
+interception. Finally, we have a <code>arraybind</code> that says that whenever an array whose
+access has been woven and intercepted intercepted
+we should apply <code>ArrayInterceptor</code>.
+
+</p><p>
+<h4>Running</h4>
+
+<p>
+<b>THIS EXAMPLE REQUIRES JDK 5!! For other options, please look at the
+<a href="../valid_targets_not_annotated.html"/>non-annotated examples guide</a></b> To compile and run:</p>
+<pre>
+ $ run.aopc.50
+</pre>
+<p>It will javac the files and then run the AOPC precompiler to manipulate the bytecode, then finally run the example. The output should be similar to this:</p>
+<pre>
+_run.aopc.50:
+ [java] --- new Woven(); ---
+ [java] Initialising array
+ [java] --- woven.setInt(0, 100); ---
+ [java] <<< Entering ArrayInterceptor type: org.jboss.aop.array.IntArrayElementWriteInvocation
+ [java] <<< We have an array element write invocation of type: org.jboss.aop.array.IntArrayElementWriteInvocation
+ [java] New value for index 0 of [I at d9e5ad is 100
+ [java] Typed value is 100
+ [java] >>> Leaving ArrayInterceptor
+ [java] --- woven.getInt(0); ---
+ [java] <<< Entering ArrayInterceptor type: org.jboss.aop.array.IntArrayElementReadInvocation
+ [java] <<< We have an array element read invocation of type: org.jboss.aop.array.IntArrayElementReadInvocation
+ [java] >>> Returned value was 100
+ [java] >>> Leaving ArrayInterceptor
+ [java] --- woven.getInt(0) was 100 ---
+ [java] --- new NotWoven(); ---
+ [java] Initialising array
+ [java] --- notWoven.setInt(0, 100); ---
+ [java] --- notWoven.getInt(0); ---
+ [java] --- notWoven.getInt(0) was 100 ---
+</pre>
+</p><p>
+</p>
+</body>
+</html>
Modified: projects/aop/trunk/aop/docs/examples/examples.html
===================================================================
--- projects/aop/trunk/aop/docs/examples/examples.html 2008-10-13 16:40:11 UTC (rev 79412)
+++ projects/aop/trunk/aop/docs/examples/examples.html 2008-10-13 16:43:31 UTC (rev 79413)
@@ -78,6 +78,7 @@
<li> <a href="dynamic-aop/dynamic.html">Dynamic AOP</a></li>
<li> <a href="beanstyleconf/config.html">JavaBean-style config of aspects</a></li>
<li> <a href="declare/declare.html">Declare error/warning</a></li>
+<li> <a href="arrayinterception/arrayinterception.html">Array element interception</a></li>
</ul>
</p><p>
<b>Packaging and Running</b>
More information about the jboss-cvs-commits
mailing list