feedback / send your comments
mail to luc peuvrier
chat channel
joafip users mailing list
forums

BACK TO INDEX
BACK TO JOAFIP PERSISTENT POJO

RETOUR A L'INDEX
RETOUR A POJO PERSISTANT

Java Agent "anti persistence constraints"

Java agent is use to transform byte code to cancel object persistence constraints.

Run your application using java agent

jvm arguments:

with all options off by default

-javaagent: <dir>joafip-java-agent.jar

with option setting

-javaagent: <dir>joafip-java-agent.jar=options

where:

<dir> is the directory location of  joafip-java-agent.jar
options separated by semicolumn are:

itrans

make transformer working at start of application else need to call JoafipJavaAgent.installTransformer, uninstallTransformer also usable

logbc

write byte code transformed in <home dir>/logs/classes (helpful for transformation debugging)

joafip_intrumentation.properties file to limit number of class impacted by byte code transformation

By default only classes in package net.sf.joafip and not marked NotStorable are transformed.

The java agent look for a propertie file intrumentation.properties, if exist it will be read to enable code transformation of classes of package and/or classes according to its contents.

The properties file lines have the form:

xx.xx=storable (or xx.xx="on")

Have no effect for all classes annotated @NotStorableClass
JOAFIP core classes are annotated not storable, but not the JOAFIP collections.

or

xx.xx=access

To be transform because access directly to persisted instace's field

Where "xx.xx" is a package or full class name (example: form "java.lang.Locale" for "Locale" class in package "java.lang")

Utilities

the class net.sf.joafip.service.JoafipJavaAgent have the following methods
 

installed

to know if java agent installed

isTransformerInstalled

to know if byte code transformer is installed

isInterceptFieldAccess

to know if java agent add putField and getField instruction interception (add force load of object before access to field)

installTransformer

to install byte code transformer

uninstallTransformer

to uninstall byte code transformer

Tune byte code transformation

The java agent "itrans" options

If  option is present the byte code transformer is installed at start of application before the main of the application is call. This means that all classes load by the JVM are byte code transformed.

Rules for joafip_instrumentation.properties creation

case which for the byte code transformation must be activated:


feedback / send your comments
mail to luc peuvrier
chat channel
joafip users mailing list
forums

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.
© 2007-2012, joafip