List of usage examples for java.lang.invoke ConstantCallSite ConstantCallSite
public ConstantCallSite(MethodHandle target)
From source file:org.apache.commons.javaflow.examples.invokedynamic.SimpleDynamicLinkage.java
public static CallSite bootstrapDynamic(final MethodHandles.Lookup caller, final String name, final MethodType type) throws NoSuchMethodException, IllegalAccessException { final MethodHandles.Lookup lookup = MethodHandles.lookup(); final Class<?> thisClass = lookup.lookupClass(); // (who am I?) final MethodHandle sayHello = lookup.findStatic(thisClass, "sayHello", MethodType.methodType(void.class)); return new ConstantCallSite(sayHello.asType(type)); }