InvokeDynamic from source code in JDK7

Preliminary versions of JDK 7 included the java.dyn.InvokeDynamic class, which allowed you to create invokedynamic instructions from source code.

See here: http://fwierzbicki.blogspot.com/2009/08/invokedynamic-and-jython-part-i.html

In the official release of JDK 7, this class seems to have disappeared. Does anyone know if this source code option is supported?

+1
source share
1 answer
Package

java.dyn has been renamed java.lang.invoke.

Although I don’t think you can create an invokedynamic command from Java, the instruction exists for other dynamic languages.

In Java, you can use "java.lang.invoke.MethodHandle" as a faster alternative to reflection, examples are available in the javadoc of the MethodHandle class. Note that the invokedynamic instruction itself relies on the MethodHandle to dynamically link methods. (You can read more detailed information at http://java.sun.com/developer/technicalArticles/DynTypeLang/index.html )

+7
source

All Articles