发明名称 Dynamic bytecode modification of classes and class hierarchies
摘要 Various systems and methods for dynamic bytecode modification of classes and class hierarchies are described herein. In various embodiments, a Java® agent is received at a launch of a Java® Virtual Machine (JVM®), the agent implementing a premain method, the premain method accepting a reference to an instrumentation instance. The instrumentation reference is then stored, a deployment container is initialized, and, within the deployment container, an instance of an application is created. The instrumentation reference is then provided to the application instance. A class transformer is then retrieved from a persistence provider, and the class transformer is wrapped by an O.R. Persistence Container Class Transformer, which is then registered with the instrumentation instance. A class to be transformed is passed to the class transformer, which dynamically modifies the bytecode of the class before the class is loaded by the JVM®.
申请公布号 US9378034(B2) 申请公布日期 2016.06.28
申请号 US201314137858 申请日期 2013.12.20
申请人 SAP SE 发明人 Matov Peter K.;Ivanova Alexandrina
分类号 G06F9/45;G06F9/455 主分类号 G06F9/45
代理机构 Schwegman Lundberg & Woessner, P.A. 代理人 Schwegman Lundberg & Woessner, P.A.
主权项 1. A method comprising: receiving an agent at a launch of a Java® Virtual Machine (JVM®), the agent including a field for storing a reference to an instrumentation instance and implementing a premain method, the premain method accepting the reference to the instrumentation instance; storing the instrumentation reference; initializing a deployment container; creating an instance of an application within the deployment container; providing the instrumentation reference to the application instance; retrieving a class transformer from a persistence provider; registering the class transformer with the instrumentation instance; passing bytecode of a class to be transformed to the class transformer; dynamically modifying, using the class transformer, the bytecode of the class before the class is loaded by the JVM® when the class is to be loaded by a class loader other than a regular class loader of the application, wherein the modified class, after being loaded by the JVM®, is arranged to execute according to its modified bytecode.
地址 Walldorf DE