Registration method for supporting bytecode modification
AssigneeSap SE
InventorsNikolai G. Nikolov, Mario Kabadiyski
Life of this patent
Estimating the term…
Abstract
A method is described that comprises receiving from a classfile registration information. The registration information comprises a class name and a different method name for each of the class's methods. Each of the methods are modified with at least one additional byte code instruction to cause, for its respective method, a plug-in module's handler method to provide output function treatment for the respective method. Also, a plug-in pattern is referred to in order to determine which of a plurality of plug-in modules are appropriate for each of the class's methods. The plug-in pattern lists for each of the plug-in modules those of the methods that are to be handled with its corresponding output function treatment.
Claims15
A method, comprising:
- modifying methods of a class file to include additional byte code instructions at said methods' respective entry and/or exit points;
- modifying said class file to include a registration method information structure;
- registering said class file with a dispatcher, said registering of said class file occurring after said additional byte code instructions and said registration method information structure have been added to said class file, said registering including passing said class file's name, said methods' names and said methods' argument types to said dispatcher from said registration method information structure;
- said dispatcher performing the following in response to said registering of said class file:
- identifying a user defined plug-in pattern for said class file that lists one or more plug-ins for each one of said class file's methods;
- updating a dictionary maintained by said dispatcher with said plug-in pattern;
- passing an identifier to said class file that uniquely identifies said class file;
- executing said class file's methods in a run-time environment, said additional byte code instructions invoking said dispatcher upon reaching said methods' respective entry and/or exit points, each invocation passing to said dispatcher:
- a) said identifier, b) an identity of the invoking method, and, c) the invoking method's arguments;
- said dispatcher, for each invocation, using a), b) and c) above to look-up an appropriate plug-in from said dictionary and passing an identity of said appropriate plug-in to an invoking method so that said invoking method can receive appropriate handler treatment from said appropriate plug-in.
A computing system comprising one or more processors coupled to memory, said memory storing program code, said one or more processors to process said program code to perform a method, said method comprising:
- modifying methods of a class file to include additional byte code instructions at said methods' respective entry and/or exit points;
- modifying said class file to include a registration method information structure;
- registering said class file with a dispatcher, said registering of said class file occurring after said additional byte code instructions and said registration method information structure have been added to said class file, said registering including passing said class file's name, said methods' names and said methods' argument types to said dispatcher from said registration method information structure;
- said dispatcher performing the following in response to said registering of said class file:
- identifying a user defined plug-in pattern for said class file that lists one or more plug-ins for each one of said class file's methods;
- updating a dictionary maintained by said dispatcher with said plug-in pattern;
- passing an identifier to said class file that uniquely identifies said class file;
- executing said class file's methods in a run-time environment, said additional byte code instructions invoking said dispatcher upon reaching said methods' respective entry and/or exit points, each invocation passing to said dispatcher:
- a) said identifier, b) an identity of the invoking method, and, c) the invoking method's arguments;
- said dispatcher, for each invocation, using a), b) and c) above to look-up an appropriate plug-in from said dictionary and passing an identity of said appropriate plug-in to an invoking method so that said invoking method can receive appropriate handler treatment from said appropriate plug-in.
A machine readable tangible storage medium containing program code to be executed by one or more processors of a computing system to perform a method, said method comprising:
- modifying methods of a class file to include additional byte code instructions at said methods' respective entry and/or exit points;
- modifying said class file to include a registration method information structure;
- registering said class file with a dispatcher, said registering of said class file occurring after said additional byte code instructions and said registration method information structure have been added to said class file, said registering including passing said class file's name, said methods' names and said methods' argument types to said dispatcher from said registration method information structure;
- said dispatcher performing the following in response to said registering of said class file:
- identifying a user defined plug-in pattern for said class file that lists one or more plug-ins for each one of said class file's methods;
- updating a dictionary maintained by said dispatcher with said plug-in pattern;
- passing an identifier to said class file that uniquely identifies said class file;
- executing said class file's methods in a run-time environment, said additional byte code instructions invoking said dispatcher upon reaching said methods' respective entry and/or exit points, each invocation passing to said dispatcher:
- a) said identifier, b) an identity of the invoking method, and, c) the invoking method's arguments;
- said dispatcher, for each invocation, using a), b) and c) above to look-up an appropriate plug-in from said dictionary and passing an identity of said appropriate plug-in to an invoking method so that said invoking method can receive appropriate handler treatment from said appropriate plug-in.
Dependencies are inferred from the claim text.