Add Instrumentation to the LibreOffice JVM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I would like to add the Java Instrumentation API to the extensions running under LibreOffice and written in Java.

After some testing, I manage to load the Instrumentation agent at JVM startup, having taken care to add the necessary startup option (ie: -javaagent:/home/prrvchr/github/jdbcDriverOOo/source/UnoAgent/dist/UnoAgent.jar) and put this archive in the classpath (ie: Tools -> Options -> LibreOffice -> Advanced -> Java Options).

UnoAgent.jar is an archive containing only one class which itself contains only two methods and this gives access to code injection and the possibility of modifying the search path of the system bootloader. This currently allows me to be able to deploy an SPI service type like System.LoggerFinder,  and to be able to be the provider for the System.Logger interface for all running applications on the JVM.

If we want to make this feature accessible to any extension written in Java, it is necessary to make three modifications: - Add the UnoAgent.jar archive to the SDK. - Add an entry in the LibreOffice configuration (ie: xcu file) to enable or disable instrumentation. - Load the JVM with the parameters needed for instrumentation depending on the configuration.

Please let me know what you think about this.

Pierre


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux