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

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

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

origin: com.headius/invokebinder

  /**
   * @see Binder#tryFinally(MethodHandle)
   */
  public SmartBinder tryFinally(MethodHandle post) {
    return new SmartBinder(this, signature(), binder.tryFinally(post));
  }
}
origin: org.jruby/jruby-core

public static MethodHandle wrapWithFrameOnly(Signature signature, RubyModule implClass, String name, MethodHandle nativeTarget) {
  MethodHandle framePre = getFrameOnlyPre(signature, CallConfiguration.FrameFullScopeNone, implClass, name);
  MethodHandle framePost = getFramePost(signature, CallConfiguration.FrameFullScopeNone);
  // post logic for frame
  nativeTarget = Binder
      .from(nativeTarget.type())
      .tryFinally(framePost)
      .invoke(nativeTarget);
  // pre logic for frame
  nativeTarget = foldArguments(nativeTarget, framePre);
  // call polling and call number increment
  nativeTarget = Binder
      .from(nativeTarget.type())
      .fold(Binder
          .from(nativeTarget.type().changeReturnType(void.class))
          .permute(0)
          .invokeStaticQuiet(lookup(), ThreadContext.class, "callThreadPoll"))
      .invoke(nativeTarget);
  return nativeTarget;
}
origin: org.jruby/jruby-complete

public static MethodHandle wrapWithFrameOnly(Signature signature, RubyModule implClass, String name, MethodHandle nativeTarget) {
  MethodHandle framePre = getFrameOnlyPre(signature, CallConfiguration.FrameFullScopeNone, implClass, name);
  MethodHandle framePost = getFramePost(signature, CallConfiguration.FrameFullScopeNone);
  // post logic for frame
  nativeTarget = Binder
      .from(nativeTarget.type())
      .tryFinally(framePost)
      .invoke(nativeTarget);
  // pre logic for frame
  nativeTarget = foldArguments(nativeTarget, framePre);
  // call polling and call number increment
  nativeTarget = Binder
      .from(nativeTarget.type())
      .fold(Binder
          .from(nativeTarget.type().changeReturnType(void.class))
          .permute(0)
          .invokeStaticQuiet(lookup(), ThreadContext.class, "callThreadPoll"))
      .invoke(nativeTarget);
  return nativeTarget;
}
origin: org.jruby/jruby-core

public static MethodHandle wrapWithFraming(Signature signature, CallConfiguration callConfig, RubyModule implClass, String name, MethodHandle nativeTarget, StaticScope scope) {
  MethodHandle framePre = getFramePre(signature, callConfig, implClass, name, scope);
  if (framePre != null) {
    MethodHandle framePost = getFramePost(signature, callConfig);
    // break, return, redo handling
    boolean heapScoped = callConfig.scoping() != Scoping.None;
    boolean framed = callConfig.framing() != Framing.None;
    // post logic for frame
    nativeTarget = Binder
        .from(nativeTarget.type())
        .tryFinally(framePost)
        .invoke(nativeTarget);
    // pre logic for frame
    nativeTarget = foldArguments(nativeTarget, framePre);
    // call polling and call number increment
    nativeTarget = Binder
        .from(nativeTarget.type())
        .fold(Binder
            .from(nativeTarget.type().changeReturnType(void.class))
            .permute(0)
            .invokeStaticQuiet(lookup(), ThreadContext.class, "callThreadPoll"))
        .invoke(nativeTarget);
  }
  return nativeTarget;
}
origin: org.jruby/jruby-complete

public static MethodHandle wrapWithFraming(Signature signature, CallConfiguration callConfig, RubyModule implClass, String name, MethodHandle nativeTarget, StaticScope scope) {
  MethodHandle framePre = getFramePre(signature, callConfig, implClass, name, scope);
  if (framePre != null) {
    MethodHandle framePost = getFramePost(signature, callConfig);
    // break, return, redo handling
    boolean heapScoped = callConfig.scoping() != Scoping.None;
    boolean framed = callConfig.framing() != Framing.None;
    // post logic for frame
    nativeTarget = Binder
        .from(nativeTarget.type())
        .tryFinally(framePost)
        .invoke(nativeTarget);
    // pre logic for frame
    nativeTarget = foldArguments(nativeTarget, framePre);
    // call polling and call number increment
    nativeTarget = Binder
        .from(nativeTarget.type())
        .fold(Binder
            .from(nativeTarget.type().changeReturnType(void.class))
            .permute(0)
            .invokeStaticQuiet(lookup(), ThreadContext.class, "callThreadPoll"))
        .invoke(nativeTarget);
  }
  return nativeTarget;
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

.tryFinally(framePost)
.invoke(nativeTarget);
origin: com.ning.billing/killbill-osgi-bundles-jruby

.tryFinally(framePost)
.invoke(nativeTarget);
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

.tryFinally(permuteArguments(BLOCK_ESCAPE, site.type().changeReturnType(void.class), site.type().parameterCount() - 1))
.invoke(target);
origin: com.ning.billing/killbill-osgi-bundles-jruby

.tryFinally(permuteArguments(BLOCK_ESCAPE, site.type().changeReturnType(void.class), site.type().parameterCount() - 1))
.invoke(target);
origin: org.jruby/jruby-complete

.tryFinally(getBlockEscape(signature))
.invoke(mh);
origin: org.jruby/jruby-core

.tryFinally(getBlockEscape(signature))
.invoke(mh);
origin: org.jruby/jruby-complete

.from(target.type())
.foldVoid(traceCall)
.tryFinally(traceReturn)
.invoke(target);
origin: org.jruby/jruby-core

.from(target.type())
.foldVoid(traceCall)
.tryFinally(traceReturn)
.invoke(target);
com.headius.invokebinderBindertryFinally

Javadoc

Apply transforms to run the given handle's logic as a "finally" block. try { some_code // your eventual endpoint } finally { finally_logic // the given handle } The layering uses a combination of catch and fold to reuse the same target handle for both exceptional and non-exceptional paths. In essence, the result is equivalent to using the given post logic as both an exception handler (using catchException) and a "post fold" that runs after the main downstream handles have run.

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,
  • nop,
  • type,
  • append,
  • foldVoid,
  • identity

Popular in Java

  • Making http post requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • runOnUiThread (Activity)
  • addToBackStack (FragmentTransaction)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • JPanel (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Runner (org.openjdk.jmh.runner)
  • 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