You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Sian January (JIRA)" <ji...@apache.org> on 2006/11/15 12:07:37 UTC

[jira] Created: (HARMONY-2195) How to use aspects for tracing

How to use aspects for tracing
------------------------------

                 Key: HARMONY-2195
                 URL: http://issues.apache.org/jira/browse/HARMONY-2195
             Project: Harmony
          Issue Type: Improvement
          Components: Classlib
            Reporter: Sian January
            Priority: Trivial
         Attachments: buildxmlpatch.txt

I'm creating this JIRA to store information and related files for how to use AspectJ for tracing in the class libraries.  Instructions below for adding tracing to the math module:

1. Download AspectJ from http://www.eclipse.org/aspectj/downloads.php

2. Copy aspectjrt.jar to /depends/jars/aspectj/

3. Copy aspectjtools.jar and aspectjrt.jar to ANT_HOME/lib and if using Eclipse add both of these to your ant runtime configuration (Window > Preferences > Ant > Runtime > Add...)

4. Edit build file to use iajc* instead of javac and include aspect class files (or apply the buildxmlpatch.txt to build.xml in the math module)

5. Write a tracing aspect (or copy the one attached to modules\math\src\main\java\org\apache\harmony\tracing)

6. Re-build the module

7. Make sure to add aspectjrt.jar to the runtime classpath of whatever program you are running.

* - iajc isn't incremental like javac in ant, it will always do a total rebuild.  Also if you switch from using iajc back to javac you will need to do a clean before you do a rebuild. 

Please also note that it's not possible to use this kind of tracing for any classes that are depended on by the AspectJ runtime or there will be errors initializing the classes because of circular dependencies.  However I think most modules apart from luni should be safe.  Also it's important to not trace methods that are called (directly or indirectly) by your tracing methods otherwise you will end up in an endless loop.  


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-2195) How to use aspects for tracing

Posted by "Sian January (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2195?page=all ]

Sian January updated HARMONY-2195:
----------------------------------

    Attachment: Tracing.aj

Aspect attached

> How to use aspects for tracing
> ------------------------------
>
>                 Key: HARMONY-2195
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2195
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Sian January
>            Priority: Trivial
>         Attachments: buildxmlpatch.txt, Tracing.aj
>
>
> I'm creating this JIRA to store information and related files for how to use AspectJ for tracing in the class libraries.  Instructions below for adding tracing to the math module:
> 1. Download AspectJ from http://www.eclipse.org/aspectj/downloads.php
> 2. Copy aspectjrt.jar to /depends/jars/aspectj/
> 3. Copy aspectjtools.jar and aspectjrt.jar to ANT_HOME/lib and if using Eclipse add both of these to your ant runtime configuration (Window > Preferences > Ant > Runtime > Add...)
> 4. Edit build file to use iajc* instead of javac and include aspect class files (or apply the buildxmlpatch.txt to build.xml in the math module)
> 5. Write a tracing aspect (or copy the one attached to modules\math\src\main\java\org\apache\harmony\tracing)
> 6. Re-build the module
> 7. Make sure to add aspectjrt.jar to the runtime classpath of whatever program you are running.
> * - iajc isn't incremental like javac in ant, it will always do a total rebuild.  Also if you switch from using iajc back to javac you will need to do a clean before you do a rebuild. 
> Please also note that it's not possible to use this kind of tracing for any classes that are depended on by the AspectJ runtime or there will be errors initializing the classes because of circular dependencies.  However I think most modules apart from luni should be safe.  Also it's important to not trace methods that are called (directly or indirectly) by your tracing methods otherwise you will end up in an endless loop.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-2195) How to use aspects for tracing

Posted by "Sian January (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2195?page=all ]

Sian January updated HARMONY-2195:
----------------------------------

    Attachment: buildxmlpatch.txt

Patch attached for build.xml in the math module

> How to use aspects for tracing
> ------------------------------
>
>                 Key: HARMONY-2195
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2195
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Sian January
>            Priority: Trivial
>         Attachments: buildxmlpatch.txt
>
>
> I'm creating this JIRA to store information and related files for how to use AspectJ for tracing in the class libraries.  Instructions below for adding tracing to the math module:
> 1. Download AspectJ from http://www.eclipse.org/aspectj/downloads.php
> 2. Copy aspectjrt.jar to /depends/jars/aspectj/
> 3. Copy aspectjtools.jar and aspectjrt.jar to ANT_HOME/lib and if using Eclipse add both of these to your ant runtime configuration (Window > Preferences > Ant > Runtime > Add...)
> 4. Edit build file to use iajc* instead of javac and include aspect class files (or apply the buildxmlpatch.txt to build.xml in the math module)
> 5. Write a tracing aspect (or copy the one attached to modules\math\src\main\java\org\apache\harmony\tracing)
> 6. Re-build the module
> 7. Make sure to add aspectjrt.jar to the runtime classpath of whatever program you are running.
> * - iajc isn't incremental like javac in ant, it will always do a total rebuild.  Also if you switch from using iajc back to javac you will need to do a clean before you do a rebuild. 
> Please also note that it's not possible to use this kind of tracing for any classes that are depended on by the AspectJ runtime or there will be errors initializing the classes because of circular dependencies.  However I think most modules apart from luni should be safe.  Also it's important to not trace methods that are called (directly or indirectly) by your tracing methods otherwise you will end up in an endless loop.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira