public static class AgentBuilder.Default.InitializationStrategy.SelfInjection.Nexus extends Object
This nexus is a global dispatcher for initializing classes with
LoadedTypeInitializer
s. To do so, this class is to be loaded
by the system class loader in an explicit manner. Any instrumented class is then injected a code
block into its static type initializer that makes a call to this very same nexus which had the
loaded type initializer registered before hand.
Important: The nexus must never be accessed directly but only by its
AgentBuilder.Default.InitializationStrategy.SelfInjection.Nexus.Accessor
which makes sure that the nexus is loaded by the system class loader. Otherwise, a class might not
be able to initialize itself if it is loaded by different class loader that does not have the
system class loader in its hierarchy.
Modifier and Type | Class and Description |
---|---|
protected static class |
AgentBuilder.Default.InitializationStrategy.SelfInjection.Nexus.Accessor
An accessor for making sure that the accessed
AgentBuilder.Default.InitializationStrategy.SelfInjection.Nexus
is loaded by the system class loader. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
int |
hashCode() |
static void |
initialize(Class<?> type)
Initializes a loaded type.
|
static void |
register(String name,
ClassLoader classLoader,
Object typeInitializer) |
String |
toString() |
public static void initialize(Class<?> type) throws Exception
type
- The loaded type to initialize.Exception
- If an exception occurs.public static void register(String name, ClassLoader classLoader, Object typeInitializer)
name
- The name of the type for the loaded type initializer.classLoader
- The class loader of the type for the loaded type initializer.typeInitializer
- The type initializer to register. The initializer must be an instance
of LoadedTypeInitializer
where
it does however not matter which class loader loaded this latter type.Copyright © 2014–2015. All rights reserved.