protected static interface JavaModule.Dispatcher
java.lang.Module
API if it is available on the current VM.Modifier and Type | Interface and Description |
---|---|
static class |
JavaModule.Dispatcher.CreationAction
A creation action for a dispatcher.
|
static class |
JavaModule.Dispatcher.Disabled
A disabled dispatcher for a VM that does not support the
java.lang.Module API. |
static class |
JavaModule.Dispatcher.Enabled
A dispatcher for a VM that does support the
java.lang.Module API. |
Modifier and Type | Method and Description |
---|---|
void |
addReads(java.lang.instrument.Instrumentation instrumentation,
java.lang.Object source,
java.lang.Object target)
Adds a read-edge from the source to the target module.
|
boolean |
canRead(java.lang.Object source,
java.lang.Object target)
Checks if the source module can read the target module.
|
java.lang.ClassLoader |
getClassLoader(java.lang.Object module)
Returns the module's class loader.
|
java.lang.String |
getName(java.lang.Object module)
Returns the module's name.
|
java.io.InputStream |
getResourceAsStream(java.lang.Object module,
java.lang.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(java.lang.Object module)
Returns
true if the supplied module is named. |
JavaModule |
moduleOf(java.lang.Class<?> type)
Extracts the Java
Module for the provided class or returns null if the current VM does not support modules. |
boolean isAlive()
true
if modules are supported on the current VM.JavaModule moduleOf(java.lang.Class<?> type)
Module
for the provided class or returns null
if the current VM does not support modules.type
- The type for which to extract the module.Module
or null
if the current VM does not support modules.boolean isNamed(java.lang.Object module)
true
if the supplied module is named.module
- The java.lang.Module
to check for the existence of a name.true
if the supplied module is named.java.lang.String getName(java.lang.Object module)
module
- The java.lang.Module
to check for its name.java.io.InputStream getResourceAsStream(java.lang.Object module, java.lang.String name)
null
if such a resource does not exist.module
- The java.lang.Module
instance to apply this method upon.name
- The name of the resource.null
if it does not exist.java.lang.ClassLoader getClassLoader(java.lang.Object module)
module
- The java.lang.Module
boolean canRead(java.lang.Object source, java.lang.Object target)
source
- The source module.target
- The target module.true
if the source module can read the target module.void addReads(java.lang.instrument.Instrumentation instrumentation, java.lang.Object source, java.lang.Object target)
instrumentation
- The instrumentation instance to use for adding the edge.source
- The source module.target
- The target module.