Top Description Inners Fields Constructors Methods
sun.instrument

public Class TransformerManager

extends Object
Class Inheritance
Imports
java.lang.instrument.Instrumentation, .ClassFileTransformer, java.security.ProtectionDomain

Support class for the InstrumentationImpl. Manages the list of registered transformers. Keeps everything in the right order, deals with sync of the list, and actually does the calling of the transformers.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private boolean
mIsRetransformable

Is this TransformerManager for transformers capable of retransformation?

private TransformerManager.TransformerInfo[]
mTransformerList

a given instance of this list is treated as immutable to simplify sync; we pay copying overhead whenever the list is changed rather than every time the list is referenced.

Constructor Summary

AccessConstructor and Description
pack-priv
TransformerManager(boolean isRetransformable)

Method Summary

Modifier and TypeMethod and Description
public synchronized void
pack-priv String[]
private TransformerManager.TransformerInfo[]
pack-priv int
pack-priv synchronized boolean
pack-priv boolean
public synchronized boolean
pack-priv boolean
public byte[]
transform(Module module, ClassLoader loader, String classname, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mIsRetransformableback to summary
private boolean mIsRetransformable

Is this TransformerManager for transformers capable of retransformation?

mTransformerListback to summary
private TransformerManager.TransformerInfo[] mTransformerList

a given instance of this list is treated as immutable to simplify sync; we pay copying overhead whenever the list is changed rather than every time the list is referenced. The array is kept in the order the transformers are added via addTransformer (first added is 0, last added is length-1) Use an array, not a List or other Collection. This keeps the set of classes used by this code to a minimum. We want as few dependencies as possible in this code, since it is used inside the class definition system. Any class referenced here cannot be transformed by Java code.

Constructor Detail

TransformerManagerback to summary
pack-priv TransformerManager(boolean isRetransformable)

Method Detail

addTransformerback to summary
public synchronized void addTransformer(ClassFileTransformer transformer)
getNativeMethodPrefixesback to summary
pack-priv String[] getNativeMethodPrefixes()
getSnapshotTransformerListback to summary
private TransformerManager.TransformerInfo[] getSnapshotTransformerList()
getTransformerCountback to summary
pack-priv int getTransformerCount()
includesTransformerback to summary
pack-priv synchronized boolean includesTransformer(ClassFileTransformer transformer)
isRetransformableback to summary
pack-priv boolean isRetransformable()
removeTransformerback to summary
public synchronized boolean removeTransformer(ClassFileTransformer transformer)
setNativeMethodPrefixback to summary
pack-priv boolean setNativeMethodPrefix(ClassFileTransformer transformer, String prefix)
transformback to summary
public byte[] transform(Module module, ClassLoader loader, String classname, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)
sun.instrument back to summary

private Class TransformerManager.TransformerInfo

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv String
pack-priv final ClassFileTransformer

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv String
pack-priv void
setPrefix(String prefix)

pack-priv ClassFileTransformer
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mPrefixback to summary
pack-priv String mPrefix
mTransformerback to summary
pack-priv final ClassFileTransformer mTransformer

Constructor Detail

TransformerInfoback to summary
pack-priv TransformerInfo(ClassFileTransformer transformer)

Method Detail

getPrefixback to summary
pack-priv String getPrefix()
setPrefixback to summary
pack-priv void setPrefix(String prefix)
transformerback to summary
pack-priv ClassFileTransformer transformer()