| java.lang.Object com.sleepycat.persist.model.ClassEnhancer
Constructor Summary | |
public | ClassEnhancer() Creates a class enhancer that searches all packages. | public | ClassEnhancer(Set<String> packageNames) Creates a class enhancer that searches a given set of packages.
Parameters: packageNames - a set of packages to search for persistentclasses. |
Method Summary | |
public byte[] | enhance(String className, byte[] classBytes) Enhances the given class bytes if the class is annotated with
Entity or
Persistent .
Parameters: className - the class name in binary format; for example,"my.package.MyClass$Name", or null if no filtering by class nameshould be performed. Parameters: classBytes - are the class file bytes to be enhanced. | int | enhanceFile(File file) | public boolean | getVerbose() Gets verbose mode. | public static void | main(String[] args) Enhances classes in the directories specified. | public static void | premain(String args, Instrumentation inst) Enhances classes as specified by a JVM -javaagent argument. | public void | setVerbose(boolean verbose) Sets verbose mode.
True may be specified to print the name of each class file that is
enhanced. | public byte[] | transform(ClassLoader loader, String className, Class> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) |
ClassEnhancer | public ClassEnhancer()(Code) | | Creates a class enhancer that searches all packages.
|
ClassEnhancer | public ClassEnhancer(Set<String> packageNames)(Code) | | Creates a class enhancer that searches a given set of packages.
Parameters: packageNames - a set of packages to search for persistentclasses. Sub-packages of these packages are also searched. If empty ornull, all packages known to the current classloader are searched. |
enhance | public byte[] enhance(String className, byte[] classBytes)(Code) | | Enhances the given class bytes if the class is annotated with
Entity or
Persistent .
Parameters: className - the class name in binary format; for example,"my.package.MyClass$Name", or null if no filtering by class nameshould be performed. Parameters: classBytes - are the class file bytes to be enhanced. the enhanced bytes, or null if no enhancement was performed. |
main | public static void main(String[] args) throws Exception(Code) | | Enhances classes in the directories specified. The class files are
replaced when they are enhanced, without changing the file modification
date. For example:
java -cp je-<version>.jar com.sleepycat.persist.model.ClassEnhancer ./classes
The "-v" argument may be specified to print the name of each class
file that is enhanced. The total number of class files enhanced will
always be printed.
Parameters: args - one or more directories containing classes to be enhanced.Subdirectories of these directories will also be searched. Optionally,-v may be included to print the name of every class file enhanced. |
premain | public static void premain(String args, Instrumentation inst)(Code) | | Enhances classes as specified by a JVM -javaagent argument.
See Also: java.lang.instrument |
setVerbose | public void setVerbose(boolean verbose)(Code) | | Sets verbose mode.
True may be specified to print the name of each class file that is
enhanced. This property is false by default.
|
|
|