Package java.lang.invoke

Examples of java.lang.invoke.MethodHandle


    return handle.invoke(receiver);
  }

  public static Object perform(Object receiver, Symbol selector, Object arg1)
      throws Throwable {
    MethodHandle handle = getHandle(receiver, selector);
    return handle.invoke(receiver, arg1);
  }
View Full Code Here


    return handle.invoke(receiver, arg1);
  }

  public static Object perform(Object receiver, Symbol selector, Object arg1,
      Object arg2) throws Throwable {
    MethodHandle handle = getHandle(receiver, selector);
    return handle.invoke(receiver, arg1, arg2);
  }
View Full Code Here

    return handle.invoke(receiver, arg1, arg2);
  }

  public static Object perform(Object receiver, Symbol selector, Object arg1,
      Object arg2, Object arg3) throws Throwable {
    MethodHandle handle = getHandle(receiver, selector);
    return handle.invoke(receiver, arg1, arg2, arg3);
  }
View Full Code Here

    return handle.invoke(receiver, arg1, arg2, arg3);
  }

  public static Object perform(Object receiver, Symbol selector, Object arg1,
      Object arg2, Object arg3, Object arg4) throws Throwable {
    MethodHandle handle = getHandle(receiver, selector);
    return handle.invoke(receiver, arg1, arg2, arg3, arg4);
  }
View Full Code Here

    return handle.invoke(receiver, arg1, arg2, arg3, arg4);
  }

  public static Object perform_withArguments_(Object receiver,
      Symbol selector, Object[] arguments) throws Throwable {
    MethodHandle handle = getHandle(receiver, selector);
    return handle.bindTo(receiver).invokeWithArguments(arguments);
  }
View Full Code Here

    return handle.bindTo(receiver).invokeWithArguments(arguments);
  }

  public static Object perform(Object receiver, String selector)
      throws Throwable {
    MethodHandle handle = getHandle(receiver, selector);
    return handle.invoke(receiver);
  }
View Full Code Here

    return handle.invoke(receiver);
  }

  public static Object perform(Object receiver, String selector, Object arg1)
      throws Throwable {
    MethodHandle handle = getHandle(receiver, selector);
    return handle.invoke(receiver, arg1);
  }
View Full Code Here

      }
     
      AlmostFinalCallSite(AlmostFinalValue volatileFinalValue) {
        super(MethodType.methodType(Object.class));
        Object lock = new Object();
        MethodHandle fallback = FALLBACK.bindTo(this);
        synchronized(lock) {
          value = NONE;
          switchPoint = new SwitchPoint();
          setTarget(fallback);
        }
View Full Code Here

        synchronized(lock) {
          Object value = this.value;
          if (value == NONE) {
            value = volatileFinalValue.initialValue();
          }
          MethodHandle target = switchPoint.guardWithTest(MethodHandles.constant(Object.class, value), fallback);
          setTarget(target);
          return value;
        }
      }
View Full Code Here

    try {

      Method method = identityClass.getDeclaredMethod("initialize");
      Object instance = aSystemMapping
          .singletonAtReference_(_aClassMapping.reference().nonmeta());
      final MethodHandle unreflect = MethodHandles.lookup().unreflect(
          method);
      System.out.println("Initializing " + identityClass);
      unreflect.invoke(instance);
      return this;
    } catch (NoSuchMethodException e) {
      return this;
    } catch (SecurityException | IllegalAccessException
        | IllegalArgumentException | InvocationTargetException e) {
View Full Code Here

TOP

Related Classes of java.lang.invoke.MethodHandle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.