@HashCodeAndEqualsPlugin.Enhance public static class JavaModule.Dispatcher.Enabled extends Object implements JavaModule.Dispatcher
java.lang.Module API.JavaModule.Dispatcher.CreationAction, JavaModule.Dispatcher.Disabled, JavaModule.Dispatcher.Enabled| Modifier | Constructor and Description |
|---|---|
protected |
Enabled(Method getModule,
Method getClassLoader,
Method isNamed,
Method getName,
Method getResourceAsStream,
Method canRead,
Method isModifiableModule,
Method redefineModule)
Creates an enabled dispatcher.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addReads(Instrumentation instrumentation,
Object source,
Object target)
Adds a read-edge from the source to the target module.
|
boolean |
canRead(Object source,
Object target)
Checks if the source module can read the target module.
|
ClassLoader |
getClassLoader(Object module)
Returns the module's class loader.
|
String |
getName(Object module)
Returns the module's name.
|
InputStream |
getResourceAsStream(Object module,
String name)
Returns a resource stream for this module for a resource of the given name or
null if such a resource does not exist. |
boolean |
isAlive()
Checks if this dispatcher is alive, i.e.
|
boolean |
isNamed(Object module)
Returns
true if the supplied module is named. |
JavaModule |
moduleOf(Class<?> type)
Extracts the Java
Module for the provided class or returns null if the current VM does not support modules. |
protected Enabled(Method getModule, Method getClassLoader, Method isNamed, Method getName, Method getResourceAsStream, Method canRead, Method isModifiableModule, Method redefineModule)
getModule - The java.lang.Class#getModule() method.getClassLoader - The java.lang.Module#getClassLoader() method.isNamed - The java.lang.Module#isNamed() method.getName - The java.lang.Module#getName() method.getResourceAsStream - The java.lang.Module#getResourceAsStream(String) method.canRead - The java.lang.Module#canRead(Module) method.isModifiableModule - The java.lang.instrument.Instrumentation#isModifiableModule method.redefineModule - The java.lang.instrument.Instrumentation#redefineModule method.public boolean isAlive()
JavaModule.DispatcherisAlive in interface JavaModule.Dispatchertrue if modules are supported on the current VM.public JavaModule moduleOf(Class<?> type)
JavaModule.DispatcherModule for the provided class or returns null if the current VM does not support modules.moduleOf in interface JavaModule.Dispatchertype - The type for which to extract the module.Module or null if the current VM does not support modules.public InputStream getResourceAsStream(Object module, String name)
JavaModule.Dispatchernull if such a resource does not exist.getResourceAsStream in interface JavaModule.Dispatchermodule - The java.lang.Module instance to apply this method upon.name - The name of the resource.null if it does not exist.public ClassLoader getClassLoader(Object module)
JavaModule.DispatchergetClassLoader in interface JavaModule.Dispatchermodule - The java.lang.Modulepublic boolean isNamed(Object module)
JavaModule.Dispatchertrue if the supplied module is named.isNamed in interface JavaModule.Dispatchermodule - The java.lang.Module to check for the existence of a name.true if the supplied module is named.public String getName(Object module)
JavaModule.DispatchergetName in interface JavaModule.Dispatchermodule - The java.lang.Module to check for its name.public boolean canRead(Object source, Object target)
JavaModule.DispatchercanRead in interface JavaModule.Dispatchersource - The source module.target - The target module.true if the source module can read the target module.public void addReads(Instrumentation instrumentation, Object source, Object target)
JavaModule.DispatcheraddReads in interface JavaModule.Dispatcherinstrumentation - The instrumentation instance to use for adding the edge.source - The source module.target - The target module.Copyright © 2014–2018. All rights reserved.