public static enum ClassReloadingStrategy.Engine extends Enum<ClassReloadingStrategy.Engine>
Class
.Modifier and Type | Class and Description |
---|---|
protected static class |
ClassReloadingStrategy.Engine.ClassRedefinitionTransformer
A class file transformer that applies a given
ClassDefinition . |
Enum Constant and Description |
---|
REDEFINITION
Redefines a class using
Instrumentation.redefineClasses(java.lang.instrument.ClassDefinition...) . |
RETRANSFORMATION
Redefines a class using
Instrumentation.retransformClasses(Class[]) . |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
apply(Instrumentation instrumentation,
Map<Class<?>,ClassDefinition> classDefinitions)
Applies this engine for the given arguments.
|
boolean |
isRedefinition()
Returns
true if this engine represents REDEFINITION . |
String |
toString() |
protected abstract ClassReloadingStrategy.Engine |
validate(Instrumentation instrumentation)
Validates that this engine supports a given transformation type.
|
static ClassReloadingStrategy.Engine |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ClassReloadingStrategy.Engine[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ClassReloadingStrategy.Engine REDEFINITION
Instrumentation.redefineClasses(java.lang.instrument.ClassDefinition...)
.public static final ClassReloadingStrategy.Engine RETRANSFORMATION
Instrumentation.retransformClasses(Class[])
. This requires synchronization on
the ClassReloadingStrategy.instrumentation
object.public static ClassReloadingStrategy.Engine[] values()
for (ClassReloadingStrategy.Engine c : ClassReloadingStrategy.Engine.values()) System.out.println(c);
public static ClassReloadingStrategy.Engine valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullprotected abstract void apply(Instrumentation instrumentation, Map<Class<?>,ClassDefinition> classDefinitions) throws UnmodifiableClassException, ClassNotFoundException
instrumentation
- The instrumentation to be used for applying the redefinition.classDefinitions
- A mapping of the classes to be redefined to their redefinition.UnmodifiableClassException
- If a class is not modifiable.ClassNotFoundException
- If a class was not found.protected abstract ClassReloadingStrategy.Engine validate(Instrumentation instrumentation)
instrumentation
- The instrumentation instance being used.public boolean isRedefinition()
true
if this engine represents REDEFINITION
.true
if this engine represents REDEFINITION
.public String toString()
toString
in class Enum<ClassReloadingStrategy.Engine>
Copyright © 2014–2016. All rights reserved.