Package net.bytebuddy.implementation
Interface LoadedTypeInitializer
-
- All Known Implementing Classes:
AgentBuilder.InitializationStrategy.SelfInjection.Dispatcher.InjectingInitializer
,LoadedTypeInitializer.Compound
,LoadedTypeInitializer.ForStaticField
,LoadedTypeInitializer.NoOp
public interface LoadedTypeInitializer
Implementations of this interface explicitly initialize a loaded type. Usually, such implementations inject runtime context into an instrumented type which cannot be defined by the means of the Java class file format.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
LoadedTypeInitializer.Compound
A compound loaded type initializer that combines several type initializers.static class
LoadedTypeInitializer.ForStaticField
A type initializer for setting a value for a static field.static class
LoadedTypeInitializer.NoOp
A loaded type initializer that does not do anything.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isAlive()
Indicates if this initializer is alive and needs to be invoked.void
onLoad(java.lang.Class<?> type)
Callback that is invoked on the creation of an instrumented type.
-
-
-
Method Detail
-
onLoad
void onLoad(java.lang.Class<?> type)
Callback that is invoked on the creation of an instrumented type. If the loaded type initializer is alive, this method should be implemented empty instead of throwing an exception.- Parameters:
type
- The manifestation of the instrumented type.
-
isAlive
boolean isAlive()
Indicates if this initializer is alive and needs to be invoked. This is only meant as a mark. A loaded type initializer that is not alive might still be called and must therefore not throw an exception but rather provide an empty implementation.- Returns:
true
if this initializer is alive.
-
-