Package org.jrd.agent
Class InstrumentationProvider
java.lang.Object
org.jrd.agent.InstrumentationProvider
This class stores instrumentation and transformer objects and handles the
transformation, retrieval of bytecode and class names.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private final Instrumentation
private final Transformer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
cleanOverrides
(String pattern) private Class
byte[]
findClassBody
(String className) Finds class object corresponding to the class name and returns its bytecode.private byte[]
getClassBody
(Class clazz) void
getClasses
(BlockingQueue<String> queue, Boolean abort, boolean doGetInfo) Inserts names of classes into queue.void
getOverrides
(BlockingQueue<String> queue) void
setClassBody
(String cname, byte[] nwBody)
-
Field Details
-
transformer
-
instrumentation
-
INFO_DELIMITER
- See Also:
-
-
Constructor Details
-
InstrumentationProvider
InstrumentationProvider(Instrumentation inst, Transformer transformer)
-
-
Method Details
-
setClassBody
- Throws:
UnmodifiableClassException
-
getClassBody
- Throws:
UnmodifiableClassException
-
findClassBody
Finds class object corresponding to the class name and returns its bytecode.- Parameters:
className
- name of class we want to get- Returns:
- bytecode of given class
- Throws:
UnmodifiableClassException
- if the class can not be re-transformed
-
findClass
-
getClasses
public void getClasses(BlockingQueue<String> queue, Boolean abort, boolean doGetInfo) throws InterruptedException Inserts names of classes into queue. Stops execution when it receives abort signal.- Parameters:
queue
- output queueabort
- abort signal- Throws:
InterruptedException
- interrupted exception
-
getOverrides
- Throws:
InterruptedException
-
cleanOverrides
-