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 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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clean(Reference<? extends ClassLoader> reference)
Cleans any dead entries of the system class loader'sNexus
.boolean
isAlive()
Returnstrue
if this dispatcher is alive.void
register(String name, ClassLoader classLoader, ReferenceQueue<? super ClassLoader> referenceQueue, int identification, LoadedTypeInitializer loadedTypeInitializer)
Registers a type initializer with the system class loader's nexus.
-
-
-
Constructor Detail
-
Available
protected Available(Method register, 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()
Returnstrue
if this dispatcher is alive.- Specified by:
isAlive
in interfaceNexusAccessor.Dispatcher
- Returns:
true
if this dispatcher is alive.
-
clean
public void clean(Reference<? extends ClassLoader> reference)
Cleans any dead entries of the system class loader'sNexus
.- Specified by:
clean
in interfaceNexusAccessor.Dispatcher
- Parameters:
reference
- The reference to remove.
-
register
public void register(String name, ClassLoader classLoader, ReferenceQueue<? super ClassLoader> referenceQueue, int identification, LoadedTypeInitializer loadedTypeInitializer)
Registers a type initializer with the system class loader's nexus.- Specified by:
register
in 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 ornull
if no queue should be referenced.identification
- An identification for the initializer to run.loadedTypeInitializer
- The loaded type initializer to be registered.
-
-