Logo
StartDownloadsDocumentationPublicationsContactCommunityDevelopers

JAsCo Tools Documentation

GENERAL HINTS

  • Java bin directory containing java and javac executables have to be in PATH environment variable! You can test this by executing “javac” on the shell.
  • Quotes are important in the following usages of the JAsCo tools! (e.g. -classpath and -outputdir flags!)

TRANSFORMBEAN

This tool transforms normal java classes in JAsCo enabled java classes. If you want to preprocess the classes to enable JAsCo interaction, then you have to use this tool. Alternative weaving options are HotSwap or the run-time weaver as explained here .

Usage: transformBean aClass “-classpath:classpath” “-outputdir:outputandinputdir”

  • aClass is a fully qualified class name with packages. For example: java.lang.String
  • classpath is the classpath where the JAsCo compiler has to find java classes used in the class at hand. Same syntax as normal java classpath: e.g. “-classpath:tools/tools.jar;.;Generated/temp”.
  • outputandinputdir is the directory where the java class has to be found in the correct subdirectory depending on package. For example: transformBean javax.swing.JButton “-outputdir:./Generated”. The class file of JButton has to reside in ./Generated/javax/swing/.
  • Important: Both the .class and .java file are overwritten, keep a backup of your files!

Alternative Usage: transformBean -l files.lst “-classpath:classpath” “-outputdir:outputandinputdir”

  • files.lst is a list of fully qualified class names delimited by newlines. For example: filelist.lst
  • classpath is the classpath where the JAsCo compiler has to find java classes used in the class at hand. Same syntax as normal java classpath: e.g. “-classpath:tools/tools.jar;.;Generated/temp”.
  • outputandinputdir is the directory where the java class has to be found in the correct subdirectory depending on package. For example: transformBean javax.swing.JButton “-outputdir:./Generated”. The class file of JButton has to reside in ./Generated/javax/swing/.
  • Important: Both the .class and .java file are overwritten, keep a backup of your files!

Alternative Usage: transformBean -D inputdir “-classpath:classpath” “-outputdir:outputdir”

  • transforms a complete directory, all classes in the input dir directory are transformed, make sure that all the classes are in the correct subdirectories wrt their packages. Example: transformBean -D inputclasses -classpath:classes -outputdir:Generated (introduced in version 0.3.3)
  • inputdir is the directory that is searched for classes by the JAsCo tools (since 0.8!). Before 0.8, inputdir is not supported and outputdir is used as input as well as output dir.
  • classpath is the classpath where the JAsCo compiler has to find java classes used in the classes at hand. Same syntax as normal java classpath: e.g. “-classpath:tools/tools.jar;.;Generated/temp”.
  • outputdir is the directory where the java classes are transformed. Both the .class and .java file are overwritten, keep a backup of your files!

Optional flag “-X:listofmethods” : Allows to specify a list of methods that cannot be trapped and as such no aspects can ever be applied on these methods. listofmethods is a list of method names delimited by “;” on windows or “:” on linux. (introduced in version 0.2.14) Note: when multiple methods match a supplied name (e.g. due to method overloading or in different beans with the -l option), they are all excluded.

Optional flag -A : Per default only public methods and events are trapped. When specifying the -A flag, all methods and events are trapped. (introduced in version 0.2.14)

Optional flag “-target:targetjdk” : Allows to specify the target virtual machine (targetjdk) to generate code to. Is equivalent to -target flag of javac. Default is the current VM. Example usage: -target:1.1 (since version 0.3.0)

Optional flag “-noevents” : Per default, fired events (part of the Java beans spec) are trapped by this tool. Specifying the noevents flag disables this. You might want to do this for stability or performance reasons. (since version 0.4.2)

COMPILEASPECT

Usage: compileAspect aFile “-classpath:classpath” “-outputdir:outputdir”

  • aFile is an absolute or relative reference to a file containing an aspect bean.
  • classpath is the classpath where the JAsCo compiler has to find java classes used in the aspect bean. Same syntax as normal java classpath: e.g. “-classpath:tools/tools.jar;.;Generated/temp”.
  • outputdir is the directory where the compiled java classes representing the aspect bean have to be generated. They are not placed directly in this director, but in a subdirectry as specified by the package declaration of the aspect bean. For example, the aspect bean declares the following package: test.basic and the outputdir is /generated, then the generated classes are placed in /generated/test/basic.

Optional flag -X : Adds traps to the aspect bean and hooks so that they are able to be subject for aspect application. (introduced in version 0.2.14)

Optional flag “-target:targetjdk” : Allows to specify the target virtual machine (targetjdk) to generate code to. Is equivalent to -target flag of javac. Default is the current VM. Example usage: -target:1.1 (since version 0.3.0)

COMPILECONNECTOR

Usage: compileConnector aFile “-classpath:classpath” “-outputdir:outputdir”

  • aFile is an absolute or relative reference to a file containing a connector.
  • classpath is the classpath where the JAsCo compiler has to find java classes and aspect beans used in the connector. Same syntax as normal java classpath: e.g. “-classpath:tools/tools.jar;.;Generated/temp”.
  • outputdir is the directory where the compiled java classes representing the connector are to be generated. They are not placed directly in this director, but in the subdirectory “connector”.

Optional flag -X : All java classes affected by the aspect beans instantiated in this connector are transformed using the transformBean tool. The java classes do have to reside in outputdir as with the transformBean tool. Ignores classnames containing wildcards!

Optional flag “-target:targetjdk” : Allows to specify the target virtual machine (targetjdk) to generate code to. Is equivalent to -target flag of javac. Default is the current VM. Example usage: -target:1.1 (since version 0.3.0)

COMPILETRAVERSAL

Usage: compileTraversal aFile “-classpath:classpath” “-outputdir:outputdir”

  • aFile is an absolute or relative reference to a file containing a traversal connector.
  • classpath is the classpath where the JAsCo compiler has to find java classes used in the traversal connector. Same syntax as normal java classpath: e.g. “-classpath:tools/tools.jar;.;Generated/temp”.
  • outputdir is the directory where the compiled java classes representing the traversal connector have to be generated. They are not placed directly in this directory, but in a subdirectry as specified by the package declaration of the traversal connector.

Optional flag “-target:targetjdk” : Allows to specify the target virtual machine (targetjdk) to generate code to. Is equivalent to -target flag of javac. Default is the current VM. Example usage: -target:1.1 (since version 0.3.0)

COMPILEREFINEMENT

(available since 0.8.5M2)

Usage: compileRefinement aFile “-classpath:classpath” “-outputdir:outputdir”

  • aFile is an absolute or relative reference to a file containing a refining class.
  • classpath is the classpath where the JAsCo compiler has to find java classes used in the refining class. Same syntax as normal java classpath: e.g. “-classpath:tools/tools.jar;.;Generated/temp”.
  • outputdir is the directory where the compiled java classes representing the refining class have to be generated. They are not placed directly in this directory, but in a subdirectry as specified by the package declaration of the traversal connector.

Optional flag “-target:targetjdk” : Allows to specify the target virtual machine (targetjdk) to generate code to. Is equivalent to -target flag of javac. Default is the current VM. Example usage: -target:1.1

INTROSPECT

Allows introspecting which connectors are loaded for a given classpath + change some properties of the connectors.

Usage: introspect “-classpath:classpath”

  • classpath is the classpath where the introspect tool searches for connectors. Same syntax as normal java classpath: e.g. “-classpath:tools/tools.jar;.;Generated/temp”.
documentation/tools.txt · Last modified: 10.06.2005 14:24
SiteMapRecent Content by SSEL ©2002-2005     Latest JAsCo Release: JAsCo 0.8.7 (revised 2005-11-25 16:29:02)