Tabnine Logo
Binder.invokeStatic
Code IndexAdd Tabnine to your IDE (free)

How to use
invokeStatic
method
in
com.headius.invokebinder.Binder

Best Java code snippets using com.headius.invokebinder.Binder.invokeStatic (Showing top 10 results out of 315)

origin: com.headius/invokebinder

/**
 * Terminate this binder by looking up the named static method on the
 * given target type. Perform the actual method lookup using the given
 * Lookup object.
 *
 * @param lookup the Lookup to use for handle lookups
 * @param target the type on which to find the static method
 * @param name   the name of the target static method
 * @return a SmartHandle with this binder's starting signature, bound
 * to the target method
 * @throws NoSuchMethodException  if the named method with current signature's types does not exist
 * @throws IllegalAccessException if the named method is not accessible to the given Lookup
 */
public SmartHandle invokeStatic(Lookup lookup, Class<?> target, String name) throws NoSuchMethodException, IllegalAccessException {
  return new SmartHandle(start, binder.invokeStatic(lookup, target, name));
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

  .insert(0, site.name)
  .invokeStatic(MethodHandles.lookup(), Bootstrap.class, "invokeSelfSimple");
    .from(site.type().changeReturnType(boolean.class))
    .insert(0, new Class[]{RubyClass.class}, selfClass)
    .invokeStatic(MethodHandles.lookup(), Bootstrap.class, "testType");
mh = MethodHandles.guardWithTest(test, mh, fallback);
mh = switchPoint.guardWithTest(mh, fallback);
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  .insert(0, site.name)
  .invokeStatic(MethodHandles.lookup(), Bootstrap.class, "invokeSelfSimple");
    .from(site.type().changeReturnType(boolean.class))
    .insert(0, new Class[]{RubyClass.class}, selfClass)
    .invokeStatic(MethodHandles.lookup(), Bootstrap.class, "testType");
mh = MethodHandles.guardWithTest(test, mh, fallback);
mh = switchPoint.guardWithTest(mh, fallback);
origin: com.headius/invokebinder

/**
 * Apply the chain of transforms and bind them to a static method specified
 * using the end signature plus the given class and name. The method will
 * be retrieved using the given Lookup and must match the end signature
 * exactly.
 *
 * If the final handle's type does not exactly match the initial type for
 * this Binder, an additional cast will be attempted.
 *
 * This version is "quiet" in that it throws an unchecked InvalidTransformException
 * if the target method does not exist or is inaccessible.
 *
 * @param lookup the MethodHandles.Lookup to use to look up the method
 * @param target the class in which to find the method
 * @param name   the name of the method to invoke
 * @return the full handle chain, bound to the given method
 */
public MethodHandle invokeStaticQuiet(MethodHandles.Lookup lookup, Class<?> target, String name) {
  try {
    return invokeStatic(lookup, target, name);
  } catch (IllegalAccessException | NoSuchMethodException e) {
    throw new InvalidTransformException(e);
  }
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

public static CallSite contextFieldBootstrap(Lookup lookup, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
  MutableCallSite site = new MutableCallSite(type);
  
  if (name.equals("nil")) {
    site.setTarget(Binder.from(type).insert(0, site).invokeStatic(lookup, InvokeDynamicSupport.class, "loadNil"));
  } else if (name.equals("runtime")) {
    site.setTarget(Binder.from(type).insert(0, site).invokeStatic(lookup, InvokeDynamicSupport.class, "loadRuntime"));
  }
  
  return site;
}

origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public static CallSite contextFieldBootstrap(Lookup lookup, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
  MutableCallSite site = new MutableCallSite(type);
  
  if (name.equals("nil")) {
    site.setTarget(Binder.from(type).insert(0, site).invokeStatic(lookup, InvokeDynamicSupport.class, "loadNil"));
  } else if (name.equals("runtime")) {
    site.setTarget(Binder.from(type).insert(0, site).invokeStatic(lookup, InvokeDynamicSupport.class, "loadRuntime"));
  }
  
  return site;
}

origin: com.ning.billing/killbill-osgi-bundles-jruby

public static IRubyObject inheritanceSearchConst(MutableCallSite site, String constName, ThreadContext context, IRubyObject cmVal) throws Throwable {
  Ruby runtime = context.runtime;
  RubyModule module;
  if (cmVal instanceof RubyModule) {
    module = (RubyModule) cmVal;
  } else {
    throw runtime.newTypeError(cmVal + " is not a type/class");
  }
  SwitchPoint switchPoint = (SwitchPoint)runtime.getConstantInvalidator(constName).getData();
  IRubyObject value = module.getConstantFromNoConstMissing(constName, false);
  if (value == null) {
    return (IRubyObject)UndefinedValue.UNDEFINED;
  }
  // bind constant until invalidated
  MethodHandle target = Binder.from(site.type())
      .drop(0, 2)
      .constant(value);
  MethodHandle fallback = Binder.from(site.type())
      .insert(0, site, constName)
      .invokeStatic(MethodHandles.lookup(), Bootstrap.class, "inheritanceSearchConst");
  site.setTarget(switchPoint.guardWithTest(target, fallback));
  return value;
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public static IRubyObject searchConst(MutableCallSite site, String constName, ThreadContext context, StaticScope staticScope) throws Throwable {
  Ruby runtime = context.runtime;
  SwitchPoint switchPoint = (SwitchPoint)runtime.getConstantInvalidator(constName).getData();
  IRubyObject value = staticScope.getConstant(constName);
  if (value == null) {
    return staticScope.getModule().callMethod(context, "const_missing", runtime.fastNewSymbol(constName));
  }
  // bind constant until invalidated
  MethodHandle target = Binder.from(site.type())
      .drop(0, 2)
      .constant(value);
  MethodHandle fallback = Binder.from(site.type())
      .insert(0, site, constName)
      .invokeStatic(MethodHandles.lookup(), Bootstrap.class, "searchConst");
  site.setTarget(switchPoint.guardWithTest(target, fallback));
  return value;
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public static IRubyObject inheritanceSearchConst(MutableCallSite site, String constName, ThreadContext context, IRubyObject cmVal) throws Throwable {
  Ruby runtime = context.runtime;
  RubyModule module;
  if (cmVal instanceof RubyModule) {
    module = (RubyModule) cmVal;
  } else {
    throw runtime.newTypeError(cmVal + " is not a type/class");
  }
  SwitchPoint switchPoint = (SwitchPoint)runtime.getConstantInvalidator(constName).getData();
  IRubyObject value = module.getConstantFromNoConstMissing(constName, false);
  if (value == null) {
    return (IRubyObject)UndefinedValue.UNDEFINED;
  }
  // bind constant until invalidated
  MethodHandle target = Binder.from(site.type())
      .drop(0, 2)
      .constant(value);
  MethodHandle fallback = Binder.from(site.type())
      .insert(0, site, constName)
      .invokeStatic(MethodHandles.lookup(), Bootstrap.class, "inheritanceSearchConst");
  site.setTarget(switchPoint.guardWithTest(target, fallback));
  return value;
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

public static IRubyObject searchConst(MutableCallSite site, String constName, ThreadContext context, StaticScope staticScope) throws Throwable {
  Ruby runtime = context.runtime;
  SwitchPoint switchPoint = (SwitchPoint)runtime.getConstantInvalidator(constName).getData();
  IRubyObject value = staticScope.getConstant(constName);
  if (value == null) {
    return staticScope.getModule().callMethod(context, "const_missing", runtime.fastNewSymbol(constName));
  }
  // bind constant until invalidated
  MethodHandle target = Binder.from(site.type())
      .drop(0, 2)
      .constant(value);
  MethodHandle fallback = Binder.from(site.type())
      .insert(0, site, constName)
      .invokeStatic(MethodHandles.lookup(), Bootstrap.class, "searchConst");
  site.setTarget(switchPoint.guardWithTest(target, fallback));
  return value;
}
com.headius.invokebinderBinderinvokeStatic

Javadoc

Apply the chain of transforms and bind them to a static method specified using the end signature plus the given class and name. The method will be retrieved using the given Lookup and must match the end signature exactly. If the final handle's type does not exactly match the initial type for this Binder, an additional cast will be attempted.

Popular methods of Binder

  • from
    Construct a new Binder, starting from a given MethodType.
  • insert
    Insert at the given index the given argument value(s).
  • invoke
    Apply the chain of transforms and bind them to a static method specified using the end signature plu
  • collect
    Box all incoming arguments from the given position onward into the given array type.
  • constant
    Apply the tranforms, binding them to a constant value that will propagate back through the chain. Th
  • drop
    Drop from the given index a number of arguments.
  • filter
    Filter incoming arguments, from the given index, replacing each with the result of calling the assoc
  • fold
    Process the incoming arguments using the given handle, inserting the result as the first argument.
  • invokeVirtual
    Apply the chain of transforms and bind them to a virtual method specified using the end signature pl
  • permute
    Permute the incoming arguments to a new sequence specified by the given values. Arguments may be dup
  • cast
    Cast the incoming arguments to the given MethodType. The casts applied are equivalent to those in Me
  • filterReturn
    Filter return value, using a function that produces the current return type from another type. The n
  • cast,
  • filterReturn,
  • invokeStaticQuiet,
  • invokeVirtualQuiet,
  • tryFinally,
  • nop,
  • type,
  • append,
  • foldVoid,
  • identity

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • addToBackStack (FragmentTransaction)
  • getContentResolver (Context)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now