]> source.dussan.org Git - aspectj.git/commitdiff
deleted the section about declaring a pertypewithin aspect with a type variable....
authoracolyer <acolyer>
Wed, 17 Aug 2005 16:35:01 +0000 (16:35 +0000)
committeracolyer <acolyer>
Wed, 17 Aug 2005 16:35:01 +0000 (16:35 +0000)
docs/adk15ProgGuideDB/pertypewithin.xml

index 1b062535cf99a1858e86b2eba93cd04beb77f929..8bab12b5de3461d1d57441524bd0a47e8019a8bc 100644 (file)
            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 
            <literal>InstanceTracking.aspectOf(org.xyz.SomeType.class).getInstances()</literal>.
        </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&lt;T&gt;</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