org.springsource.loaded
Class SystemClassReflectionRewriter
java.lang.Object
org.springsource.loaded.SystemClassReflectionRewriter
public class SystemClassReflectionRewriter
- extends java.lang.Object
This is a special rewriter that should be used on system classes that are using reflection. These classes are loader above the
agent code and so cannot use the agent code directly (they can't see the classes). In these situations we will do some rewriting
that will only use other system types. How can that work? Well the affected types are modified to expose a static field (per
reflective API used), these static fields are set by springloaded during later startup and then are available for access from the
rewritten system class code.
There is a null check in the injected method for cases where everything runs even sooner than can be plugged by SpringLoaded.
The following are implemented so far:
Due to ReflectionNavigator:
- getDeclaredFields
- getDeclaredField
- getField
- getModifiers
- getDeclaredConstructor
- getDeclaredMethods
- getDeclaredMethod
Due to ProxyGenerator
This class modifiers the calls to the reflective APIs, adds the fields and helper methods. The wiring of the SpringLoaded
reflectiveinterceptor into types affected by this rewriter is currently done in SpringLoadedPreProcessor.
- Since:
- 0.7.3
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SystemClassReflectionRewriter
public SystemClassReflectionRewriter()
rewrite
public static SystemClassReflectionRewriter.RewriteResult rewrite(java.lang.String slashedClassName,
byte[] bytes)