Tabnine Logo
AbstractClosureFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
AbstractClosureFactory
in
com.netflix.hystrix.contrib.javanica.command.closure

Best Java code snippets using com.netflix.hystrix.contrib.javanica.command.closure.AbstractClosureFactory (Showing top 4 results out of 315)

origin: PipelineAI/pipeline

@Override
public Closure createClosure(MetaHolder metaHolder, Method method, Object o, Object... args) {
  try {
    Object closureObj;
    method.setAccessible(true);
    if (isCompileWeaving()) {
      closureObj = invokeAjcMethod(metaHolder.getAjcMethod(), o, metaHolder, args);
    } else {
      closureObj = method.invoke(o, args); // creates instance of an anonymous class
    }
    return createClosure(method.getName(), closureObj);
  } catch (InvocationTargetException e) {
    throw Throwables.propagate(e.getCause());
  } catch (Exception e) {
    throw Throwables.propagate(e);
  }
}
origin: PipelineAI/pipeline

/**
 * Creates closure.
 *
 * @param rootMethodName the name of external method within which closure is created.
 * @param closureObj     the instance of specific anonymous class
 * @return new {@link Closure} instance
 * @throws Exception
 */
Closure createClosure(String rootMethodName, final Object closureObj) throws Exception {
  if (!isClosureCommand(closureObj)) {
    throw new RuntimeException(format(ERROR_TYPE_MESSAGE, rootMethodName,
        getClosureCommandType().getName()).getMessage());
  }
  Method closureMethod = closureObj.getClass().getMethod(INVOKE_METHOD);
  return new Closure(closureMethod, closureObj);
}
origin: com.netflix.hystrix/hystrix-javanica

/**
 * Creates closure.
 *
 * @param rootMethodName the name of external method within which closure is created.
 * @param closureObj     the instance of specific anonymous class
 * @return new {@link Closure} instance
 * @throws Exception
 */
Closure createClosure(String rootMethodName, final Object closureObj) throws Exception {
  if (!isClosureCommand(closureObj)) {
    throw new RuntimeException(format(ERROR_TYPE_MESSAGE, rootMethodName,
        getClosureCommandType().getName()).getMessage());
  }
  Method closureMethod = closureObj.getClass().getMethod(INVOKE_METHOD);
  return new Closure(closureMethod, closureObj);
}
origin: com.netflix.hystrix/hystrix-javanica

@Override
public Closure createClosure(MetaHolder metaHolder, Method method, Object o, Object... args) {
  try {
    Object closureObj;
    method.setAccessible(true);
    if (isCompileWeaving()) {
      closureObj = invokeAjcMethod(metaHolder.getAjcMethod(), o, metaHolder, args);
    } else {
      closureObj = method.invoke(o, args); // creates instance of an anonymous class
    }
    return createClosure(method.getName(), closureObj);
  } catch (InvocationTargetException e) {
    throw Throwables.propagate(e.getCause());
  } catch (Exception e) {
    throw Throwables.propagate(e);
  }
}
com.netflix.hystrix.contrib.javanica.command.closureAbstractClosureFactory

Javadoc

Abstract implementation of ClosureFactory.

Most used methods

  • createClosure
    Creates closure.
  • getClosureCommandType
    Gets type of expected closure type.
  • isClosureCommand
    Checks that closureObj is instance of necessary class.

Popular in Java

  • Making http requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • compareTo (BigDecimal)
  • onCreateOptionsMenu (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Path (java.nio.file)
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JTextField (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • 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