Package net.bytebuddy.dynamic
Class NexusAccessor.Dispatcher.Available
- java.lang.Object
-
- net.bytebuddy.dynamic.NexusAccessor.Dispatcher.Available
-
- All Implemented Interfaces:
NexusAccessor.Dispatcher
- Enclosing interface:
- NexusAccessor.Dispatcher
@Enhance public static class NexusAccessor.Dispatcher.Available extends java.lang.Object implements NexusAccessor.Dispatcher
An enabled dispatcher for registering a type initializer in aNexus.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.NexusAccessor.Dispatcher
NexusAccessor.Dispatcher.Available, NexusAccessor.Dispatcher.CreationAction, NexusAccessor.Dispatcher.Unavailable
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.MethodcleanTheNexus.clean(Reference)method.private java.lang.reflect.Methodregisterprivate static java.lang.ObjectSTATIC_METHODIndicates that a static method is invoked by reflection.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAvailable(java.lang.reflect.Method register, java.lang.reflect.Method clean)Creates a new dispatcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclean(java.lang.ref.Reference<? extends java.lang.ClassLoader> reference)Cleans any dead entries of the system class loader'sNexus.booleanisAlive()Returnstrueif this dispatcher is alive.voidregister(java.lang.String name, java.lang.ClassLoader classLoader, java.lang.ref.ReferenceQueue<? super java.lang.ClassLoader> referenceQueue, int identification, LoadedTypeInitializer loadedTypeInitializer)Registers a type initializer with the system class loader's nexus.
-
-
-
Field Detail
-
STATIC_METHOD
private static final java.lang.Object STATIC_METHOD
Indicates that a static method is invoked by reflection.
-
register
private final java.lang.reflect.Method register
-
clean
private final java.lang.reflect.Method clean
TheNexus.clean(Reference)method.
-
-
Constructor Detail
-
Available
protected Available(java.lang.reflect.Method register, java.lang.reflect.Method clean)Creates a new dispatcher.- Parameters:
register- TheNexus.register(String, ClassLoader, ReferenceQueue, int, Object)method.clean- TheNexus.clean(Reference)method.
-
-
Method Detail
-
isAlive
public boolean isAlive()
Returnstrueif this dispatcher is alive.- Specified by:
isAlivein interfaceNexusAccessor.Dispatcher- Returns:
trueif this dispatcher is alive.
-
clean
public void clean(java.lang.ref.Reference<? extends java.lang.ClassLoader> reference)
Cleans any dead entries of the system class loader'sNexus.- Specified by:
cleanin interfaceNexusAccessor.Dispatcher- Parameters:
reference- The reference to remove.
-
register
public void register(java.lang.String name, java.lang.ClassLoader classLoader, java.lang.ref.ReferenceQueue<? super java.lang.ClassLoader> referenceQueue, int identification, LoadedTypeInitializer loadedTypeInitializer)Registers a type initializer with the system class loader's nexus.- Specified by:
registerin interfaceNexusAccessor.Dispatcher- Parameters:
name- The name of a type for which a loaded type initializer is registered.classLoader- The class loader for which a loaded type initializer is registered.referenceQueue- A reference queue to notify about stale nexus entries ornullif no queue should be referenced.identification- An identification for the initializer to run.loadedTypeInitializer- The loaded type initializer to be registered.
-
-