aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authoravasseur <avasseur>2005-05-19 13:39:20 +0000
committeravasseur <avasseur>2005-05-19 13:39:20 +0000
commit49c3978146a3e1d303a5d7f520c906acbfebe9bd (patch)
tree184a715348f37a002d348429e4488ea5213fe3e0 /docs
parent92dfe7b7e91b78da65a3ad69f36a285ed47efd4e (diff)
downloadaspectj-49c3978146a3e1d303a5d7f520c906acbfebe9bd.tar.gz
aspectj-49c3978146a3e1d303a5d7f520c906acbfebe9bd.zip
deow @AJ + @AfterXX annotation warnings + test + JDWP sample for LTW tests + some AJ5 doc fix
Diffstat (limited to 'docs')
-rw-r--r--docs/adk15ProgGuideDB/ataspectj.xml94
-rw-r--r--docs/adk15ProgGuideDB/ltw.xml23
2 files changed, 59 insertions, 58 deletions
diff --git a/docs/adk15ProgGuideDB/ataspectj.xml b/docs/adk15ProgGuideDB/ataspectj.xml
index 080199054..b3986ef90 100644
--- a/docs/adk15ProgGuideDB/ataspectj.xml
+++ b/docs/adk15ProgGuideDB/ataspectj.xml
@@ -51,8 +51,8 @@
public aspect Foo {}
]]></programlisting>
- <para>Privileged aspects are declared as:</para>
-
+ <para>Privileged aspects are not supported by the annotation style</para>
+ <!--
<programlisting><![CDATA[
@Aspect(isPrivileged=true)
public class Foo {}
@@ -61,48 +61,19 @@
public privileged aspect Foo {}
]]></programlisting>
-
+ -->
<para>To specify an aspect an aspect instantiation model (the default is
- singleton), use the <literal>instantionModel</literal> and
- <literal>perClausePattern</literal> attributes. For example:</para>
+ singleton), provide the perclause as the <literal>@Aspect</literal> value.
+ For example:</para>
<programlisting><![CDATA[
- @Aspect(instantiationModel=AspectInstantiationModel.PERTHIS,
- perClausePattern="execution(* abc..*(..))")
+ @Aspect("perthis(execution(* abc..*(..)))")
public class Foo {}
is equivalent to...
public aspect Foo perthis(execution(* abc..*(..))) {}
]]></programlisting>
-
- <para>The full definitions of the Aspect annotation type and the
- AspectInstantiationModel enumerated type are:</para>
-
- <programlisting><![CDATA[
- /**
- * Use to indicate that a class should be treated as an aspect by
- * AspectJ's weaver.
- */
- @Target({ElementType.TYPE})
- public @interface Aspect {
- AspectInstantiationModel instantiationModel() default AspectInstantiationModel.SINGLETON;
- String perClausePattern() default "";
- boolean isPrivileged() default false;
- }
-
- /**
- * The different aspect instantiation models supported by AspectJ
- */
- public enum AspectInstantiationModel {
- SINGLETON,
- PERTHIS,
- PERTARGET,
- PERCFLOW,
- PERCFLOWBELOW,
- PERTYPEWITHIN
- }
- ]]></programlisting>
</sect1>
@@ -286,9 +257,9 @@
<literal>thisJoinPointStaticPart</literal>,
<literal>thisEnclosingJoinPointStaticPart</literal> then these need to
be declared as additional method parameters when using the annotation
- style. In AspectJ 1.5.0 we require that these parameters be declared
+ style. <!-- TODO AV - not any more -- In AspectJ 1.5.0 we require that these parameters be declared
first in the parameter list, in later releases we may relax this
- requirement.</para>
+ requirement.--></para>
<programlisting><![CDATA[
@AdviceName("callFromFoo")
@@ -384,7 +355,7 @@
<programlisting><![CDATA[
public interface ProceedingJoinPoint extends JoinPoint {
- public Object proceed(Object... args);
+ public Object proceed(Object[] args);
}
]]></programlisting>
@@ -402,26 +373,28 @@
<programlisting><![CDATA[
public aspect ProceedAspect {
pointcut setAge(int i): call(* setAge(..)) && args(i);
-
+
Object around(int i): setAge(i) {
return proceed(i*2);
}
}
-
+
can be written as...
-
+
@Aspect
public class ProceedAspect {
-
+
@Pointcut("call(* setAge(..)) && args(i)")
void setAge(int i) {}
-
+
@Around("setAge(i)")
public Object twiceAsOld(ProceedingJoinPoint thisJoinPoint, int i) {
- return thisJoinPoint.proceed(i*2);
+ return thisJoinPoint.proceed(new Object[]{i*2}); //using Java 5 autoboxing
}
-
- }
+
+ }
+
+ Note that the ProceedingJoinPoint does not need to be passed as the proceed(..) arguments.
]]></programlisting>
</sect2>
@@ -587,22 +560,32 @@
(This is the same behaviour as when using declare warning or error with the
code style). Declare warning and error declarations are made by annotating
a string constant whose value is the message to be issued.</para>
-
+
+ <para>Note that the String must be a constant and not the result of the invocation
+ of a static method for example.</para>
+
<programlisting><![CDATA[
declare warning : call(* javax.sql..*(..)) && !within(org.xyz.daos..*)
: "Only DAOs should be calling JDBC.";
-
+
declare error : execution(* IFoo+.*(..)) && !within(org.foo..*)
: "Only foo types can implement IFoo";
-
+
can be written as...
-
+
@DeclareWarning("call(* javax.sql..*(..)) && !within(org.xyz.daos..*)")
static final String aMessage = "Only DAOs should be calling JDBC.";
-
+
@DeclareError("execution(* IFoo+.*(..)) && !within(org.foo..*)")
static final String badIFooImplementors = "Only foo types can implement IFoo";
-
+
+ // the following is not valid since the message is not a String constant
+ @DeclareError("execution(* IFoo+.*(..)) && !within(org.foo..*)")
+ static final String badIFooImplementorsCorrupted = getMessage();
+ static String getMessage() {
+ return "Only foo types can implement IFoo " + System.currentTimeMillis();
+ }
+
]]></programlisting>
@@ -646,10 +629,13 @@
public static boolean hasAspect(Object anAspect, Class forType) {...}
}
]]></programlisting>
-
+
+ <!-- TODO AV - stuff below is not done -->
+ <!--
<para>When the AspectJ weaver sees calls to these methods, it will convert
them into the most efficient form possible (to get performance equivalent
- to a direct <literal>MyAspect.aspectOf()</literal> call).</para>
+ to a direct <literal>MyAspect.aspectOf()</literal> call).</para>
+ -->
</sect1>
</chapter>
diff --git a/docs/adk15ProgGuideDB/ltw.xml b/docs/adk15ProgGuideDB/ltw.xml
index 1f0bb9d8a..8b6f027bb 100644
--- a/docs/adk15ProgGuideDB/ltw.xml
+++ b/docs/adk15ProgGuideDB/ltw.xml
@@ -38,6 +38,8 @@
need to specify the <literal>-Xreweavable</literal> compiler option when building
them. This causes AspectJ to save additional state in the class files that is used
to support subsequent reweaving. </para>
+ <para><!-- FIXME AV -->As per AspectJ 1.5.0 M3 aspects (code style or annotation style) are
+ reweavable by default, and weaved classes may be as well in 1.5.0 final.</para>
</sect2>
</sect1>
@@ -92,6 +94,7 @@
<varlistentry>
<term>Command line</term>
<listitem>
+ <!-- FIXME AV - wondering what is the status of this one as per aop.xml etc.. -->
<para> AspectJ includes a script "aj" that allows programs executed at
the command line to take advantage of load-time weaving.
The script is customized when AspectJ is installed depending on the chosen
@@ -207,6 +210,7 @@
found on the search path (regular <literal>getResourceAsStream</literal> lookup)
according to the following rules: </para>
<itemizedlist>
+ <!-- FIXME AV - looks like we can refine conf in a child CL - not good -->
<listitem> The set of available aspects is the set of all
declared and defined aspects (<literal>aspect</literal> and
<literal>concrete-aspect</literal> elements of the <literal>aspects</literal>
@@ -286,6 +290,12 @@
</row>
<row>
<entry>
+ <literal>-Xlint, -Xlint:ignore, ...</literal>
+ </entry>
+ <entry>Configure lint messages</entry><!--FIXME AV - default to blabla, see link X -->
+ </row>
+ <row>
+ <entry>
<literal>-nowarn, -warn:none</literal>
</entry>
<entry>Suppress warning messages</entry>
@@ -311,7 +321,7 @@
</row>
<row>
<entry>
- <literal>-Xnoinline</literal>
+ <literal>-XnoInline</literal>
</entry>
<entry>Don't inline around advice.</entry>
</row>
@@ -323,9 +333,14 @@
</row>
<row>
<entry>
- <literal>-XmessageHolderClass</literal>
+ <literal>-XmessageHolderClass:...</literal>
</entry>
- <entry>Provide alternative output destination to stderr for all weaver messages</entry>
+ <entry>Provide alternative output destination to stdout/stderr for all weaver messages.
+ The given value must be the full qualified class name of a class that implements
+ <literal>org.aspectj.weaver.loadtime</literal>
+ and that is visible from where the <literal>aop.xml</literal> is packed.
+ If more than one such options are used,
+ the first occurence only is taken into account.</entry>
</row>
</tbody>
</tgroup>
@@ -345,7 +360,7 @@
<sect2>
<title>JVMTI</title>
<para> When using JDK 1.5 the JVMTI agent can be used by starting the JVM with the
- following option: </para>
+ following option (adapt according to the path to aspectjweaver.jar): </para>
<programlisting><![CDATA[
-javaagent=aspectjweaver.jar
]]></programlisting>