diff options
author | acolyer <acolyer> | 2005-08-17 16:35:01 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-08-17 16:35:01 +0000 |
commit | c82127f4e6f2a77f9f1e4c1a287cb73de0fb94de (patch) | |
tree | bcc517fee4c363b87ab42258122d35eaf65b6004 /docs | |
parent | 154fd6e59d48eaaebe834a49e859b91b320dd430 (diff) | |
download | aspectj-c82127f4e6f2a77f9f1e4c1a287cb73de0fb94de.tar.gz aspectj-c82127f4e6f2a77f9f1e4c1a287cb73de0fb94de.zip |
deleted the section about declaring a pertypewithin aspect with a type variable. We could consider supporting this beyond AspectJ 1.5.0 perhaps, but not before.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/adk15ProgGuideDB/pertypewithin.xml | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/docs/adk15ProgGuideDB/pertypewithin.xml b/docs/adk15ProgGuideDB/pertypewithin.xml index 1b062535c..8bab12b5d 100644 --- a/docs/adk15ProgGuideDB/pertypewithin.xml +++ b/docs/adk15ProgGuideDB/pertypewithin.xml @@ -75,7 +75,7 @@ Then one aspect instance will be created for each type within <literal>org.xyz..*</literal>. For each aspect instance, the after returning advice will match only the execution of constructors - in the type that the aspect is an instance of. The net result is that + within the matched per-type-within type. The net result is that the aspect tracks all known instances of each type within <literal>org.xyz..*</literal>. To get access to the instances, a programmer can simply write @@ -83,31 +83,6 @@ </para> <para> - A <literal>pertypewithin</literal> aspect may optionally be declared - with a single generic type parameter. In this case, for each type - <literal>T</literal> matched by the type pattern, the aspect instance - created will be of type <literal>PerTypeWithinAspect<T></literal>. - So the previous example could also be written as: - </para> - - <programlisting><![CDATA[ - public aspect InstanceTracking<T> pertypewithin(org.xyz..*) { - - // use WeakHashMap for auto-garbage collection of keys - private Map<T, Boolean> instances = new WeakHashMap<T, Boolean>(); - - after(T t) returning : execution(new(..)) && this(t) { - instances.put(t, true); - } - - public Set<T> getInstances() { - return instances.keySet(); - } - - } - ]]></programlisting> - - <para> The <literal>pertypewithin</literal> aspect instantiation model should be used when the implementation of a crosscutting concern requires that some state be maintained for each type in a set of types. To maintain |