Spec-Zone .ru
спецификации, руководства, описания, API
|
|
Java™ Platform Standard Ed. 7 DRAFT ea-b118 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.dyn.Linkage
public class Linkage extends Object
This class consists exclusively of static methods that control
the linkage of invokedynamic
instructions, and specifically
their reification as CallSite
objects.
Modifier and Type | Field and Description |
---|---|
static MethodType |
BOOTSTRAP_METHOD_TYPE
PROVISIONAL API, WORK IN PROGRESS: The type of any bootstrap method is a three-argument method (Class, String, MethodType) returning a CallSite . |
Modifier and Type | Method and Description |
---|---|
static MethodHandle |
getBootstrapMethod(Class callerClass)
Deprecated. |
static Object |
invalidateAll()
PROVISIONAL API, WORK IN PROGRESS: Invalidate all invokedynamic call sites everywhere. |
static Object |
invalidateCallerClass(Class<?> callerClass)
PROVISIONAL API, WORK IN PROGRESS: Invalidate all invokedynamic call sites in the bytecodes
of any methods of the given class. |
static void |
registerBootstrapMethod(Class<?> runtime,
String name)
Deprecated. Use @ BootstrapMethod annotations instead |
static void |
registerBootstrapMethod(Class callerClass,
MethodHandle bootstrapMethod)
Deprecated. Use @ BootstrapMethod annotations instead |
static void |
registerBootstrapMethod(String name)
Deprecated. Use @ BootstrapMethod annotations instead |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final MethodType BOOTSTRAP_METHOD_TYPE
(Class, String, MethodType)
returning a CallSite
.
Method Detail |
---|
public static void registerBootstrapMethod(Class callerClass, MethodHandle bootstrapMethod)
BootstrapMethod
annotations instead
A bootstrap method must be a method handle with a return type of CallSite
and the following arguments:
invokedynamic
instruction, for which the bootstrap method was registered
String
)
MethodType
)
CallSite
object (possibly of a subclass of CallSite
).
The registration must take place exactly once, either before the class has begun being initialized, or from within the class's static initializer. Registration will fail with an exception if any of the following conditions hold:
checkPermission
call throws
when passed LinkagePermission
("registerBootstrapMethod",callerClass).
callerClass
- a class that may have invokedynamic
sitesbootstrapMethod
- the method to use to bootstrap all such sitesIllegalArgumentException
- if the class argument is null or
a primitive class, or if the bootstrap method is the wrong typeIllegalStateException
- if the class already has a bootstrap
method, or if the its static initializer has already run
or is already running in another threadSecurityException
- if there is a security manager installed,
and a LinkagePermission
check fails for "registerBootstrapMethod"public static void registerBootstrapMethod(Class<?> runtime, String name)
BootstrapMethod
annotations instead
registerBootstrapMethod
for self-registration,
to be called from a static initializer.
Finds a static method of the required type in the
given runtime class, and installs it on the caller class.
NoSuchMethodException
- if there is no such methodIllegalStateException
- if the caller class's static initializer
has already run, or is already running in another threadpublic static void registerBootstrapMethod(String name)
BootstrapMethod
annotations instead
registerBootstrapMethod
for self-registration,
to be called from a static initializer.
Finds a static method of the required type in the
caller class itself, and installs it on the caller class.
IllegalArgumentException
- if there is no such methodIllegalStateException
- if the caller class's static initializer
has already run, or is already running in another threadpublic static MethodHandle getBootstrapMethod(Class callerClass)
IllegalArgumentException
- if the argument is null or
a primitive classSecurityException
- if there is a security manager installed,
and the immediate caller of this method is not in the same
package as the caller class
and a LinkagePermission
check fails for "getBootstrapMethod"public static Object invalidateAll()
invokedynamic
call sites everywhere.
When this method returns, every invokedynamic
instruction
will invoke its bootstrap method on next call.
It is unspecified whether call sites already known to the Java
code will continue to be associated with invokedynamic
instructions. If any call site is still so associated, its
CallSite.getTarget()
method is guaranteed to return null
the invalidation operation completes.
Invalidation operations are likely to be slow. Use them sparingly.
public static Object invalidateCallerClass(Class<?> callerClass)
invokedynamic
call sites in the bytecodes
of any methods of the given class.
When this method returns, every matching invokedynamic
instruction will invoke its bootstrap method on next call.
For additional semantics of call site invalidation,
see invalidateAll()
.
|
Java™ Platform Standard Ed. 7 DRAFT ea-b118 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1993, 2010, Oracle Corporation. All rights reserved.