Tabnine Logo
com.netflix.hystrix.contrib.javanica.aop.aspectj
Code IndexAdd Tabnine to your IDE (free)

How to use com.netflix.hystrix.contrib.javanica.aop.aspectj

Best Java code snippets using com.netflix.hystrix.contrib.javanica.aop.aspectj (Showing top 20 results out of 315)

origin: PipelineAI/pipeline

private static Class<?> getFirstGenericParameter(Type type) {
  return getFirstGenericParameter(type, 1);
}
origin: PipelineAI/pipeline

public static WeavingMode getWeavingMode() {
  try {
    return WeavingMode.valueOf(EnvUtils.WEAVING_MODE);
  } catch (IllegalArgumentException e) {
    throw new IllegalArgumentException("wrong 'weavingMode' property, supported: " + Arrays.toString(WeavingMode.values()) + ", actual = " + EnvUtils.WEAVING_MODE, e);
  }
}
origin: PipelineAI/pipeline

private Throwable hystrixRuntimeExceptionToThrowable(MetaHolder metaHolder, HystrixRuntimeException e) {
  if (metaHolder.raiseHystrixExceptionsContains(HystrixException.RUNTIME_EXCEPTION)) {
    return e;
  }
  return getCause(e);
}
origin: PipelineAI/pipeline

@Bean
public HystrixCommandAspect hystrixAspect() {
  return new HystrixCommandAspect();
}
origin: PipelineAI/pipeline

@Around("hystrixCommandAnnotationPointcut() || hystrixCollapserAnnotationPointcut()")
public Object methodsAnnotatedWithHystrixCommand(final ProceedingJoinPoint joinPoint) throws Throwable {
  Method method = getMethodFromTarget(joinPoint);
  Validate.notNull(method, "failed to get method from joinPoint: %s", joinPoint);
  if (method.isAnnotationPresent(HystrixCommand.class) && method.isAnnotationPresent(HystrixCollapser.class)) {
    throw new IllegalStateException("method cannot be annotated with HystrixCommand and HystrixCollapser " +
        "annotations at the same time");
  }
  MetaHolderFactory metaHolderFactory = META_HOLDER_FACTORY_MAP.get(HystrixPointcutType.of(method));
  MetaHolder metaHolder = metaHolderFactory.create(joinPoint);
  HystrixInvokable invokable = HystrixCommandFactory.getInstance().create(metaHolder);
  ExecutionType executionType = metaHolder.isCollapserAnnotationPresent() ?
      metaHolder.getCollapserExecutionType() : metaHolder.getExecutionType();
  Object result;
  try {
    if (!metaHolder.isObservable()) {
      result = CommandExecutor.execute(invokable, executionType, metaHolder);
    } else {
      result = executeObservable(invokable, executionType, metaHolder);
    }
  } catch (HystrixBadRequestException e) {
    throw e.getCause() != null ? e.getCause() : e;
  } catch (HystrixRuntimeException e) {
    throw hystrixRuntimeExceptionToThrowable(metaHolder, e);
  }
  return result;
}
origin: PipelineAI/pipeline

public abstract MetaHolder create(Object proxy, Method method, Object obj, Object[] args, final ProceedingJoinPoint joinPoint);
origin: PipelineAI/pipeline

  @Override
  public MetaHolder create(Object proxy, Method method, Object obj, Object[] args, final ProceedingJoinPoint joinPoint) {
    HystrixCommand hystrixCommand = method.getAnnotation(HystrixCommand.class);
    ExecutionType executionType = ExecutionType.getExecutionType(method.getReturnType());
    MetaHolder.Builder builder = metaHolderBuilder(proxy, method, obj, args, joinPoint);
    if (isCompileWeaving()) {
      builder.ajcMethod(getAjcMethodFromTarget(joinPoint));
    }
    return builder.defaultCommandKey(method.getName())
            .hystrixCommand(hystrixCommand)
            .observableExecutionMode(hystrixCommand.observableExecutionMode())
            .executionType(executionType)
            .observable(ExecutionType.OBSERVABLE == executionType)
            .build();
  }
}
origin: PipelineAI/pipeline

MetaHolder.Builder builder = metaHolderBuilder(proxy, batchCommandMethod, obj, args, joinPoint);
origin: PipelineAI/pipeline

  @Bean
  public HystrixCacheAspect hystrixCacheAspect() {
    return new HystrixCacheAspect();
  }
}
origin: PipelineAI/pipeline

private Object executeObservable(HystrixInvokable invokable, ExecutionType executionType, final MetaHolder metaHolder) {
  return mapObservable(((Observable) CommandExecutor.execute(invokable, executionType, metaHolder))
      .onErrorResumeNext(new Func1<Throwable, Observable>() {
        @Override
        public Observable call(Throwable throwable) {
          if (throwable instanceof HystrixBadRequestException) {
            return Observable.error(throwable.getCause());
          } else if (throwable instanceof HystrixRuntimeException) {
            HystrixRuntimeException hystrixRuntimeException = (HystrixRuntimeException) throwable;
            return Observable.error(hystrixRuntimeExceptionToThrowable(metaHolder, hystrixRuntimeException));
          }
          return Observable.error(throwable);
        }
      }), metaHolder);
}
origin: apache/incubator-dubbo-samples

  @Bean
  public HystrixCommandAspect hystrixCommandAspect() {
    return new HystrixCommandAspect();
  }
}
origin: com.netflix.hystrix/hystrix-javanica

public static WeavingMode getWeavingMode() {
  try {
    return WeavingMode.valueOf(EnvUtils.WEAVING_MODE);
  } catch (IllegalArgumentException e) {
    throw new IllegalArgumentException("wrong 'weavingMode' property, supported: " + Arrays.toString(WeavingMode.values()) + ", actual = " + EnvUtils.WEAVING_MODE, e);
  }
}
origin: PipelineAI/pipeline

private Throwable getCause(HystrixRuntimeException e) {
  if (e.getFailureType() != HystrixRuntimeException.FailureType.COMMAND_EXCEPTION) {
    return e;
  }
  Throwable cause = e.getCause();
  // latest exception in flow should be propagated to end user
  if (e.getFallbackException() instanceof FallbackInvocationException) {
    cause = e.getFallbackException().getCause();
    if (cause instanceof HystrixRuntimeException) {
      cause = getCause((HystrixRuntimeException) cause);
    }
  } else if (cause instanceof CommandActionExecutionException) { // this situation is possible only if a callee throws an exception which type extends Throwable directly
    CommandActionExecutionException commandActionExecutionException = (CommandActionExecutionException) cause;
    cause = commandActionExecutionException.getCause();
  }
  return Optional.fromNullable(cause).or(e);
}
origin: com.netflix.hystrix/hystrix-javanica

private static Class<?> getFirstGenericParameter(Type type) {
  return getFirstGenericParameter(type, 1);
}
origin: apache/incubator-dubbo-samples

  @Bean
  public HystrixCommandAspect hystrixCommandAspect() {
    return new HystrixCommandAspect();
  }
}
origin: com.netflix.hystrix/hystrix-javanica

private Throwable hystrixRuntimeExceptionToThrowable(MetaHolder metaHolder, HystrixRuntimeException e) {
  if (metaHolder.raiseHystrixExceptionsContains(HystrixException.RUNTIME_EXCEPTION)) {
    return e;
  }
  return getCause(e);
}
origin: wyh-spring-ecosystem-student/spring-boot-student

@Bean
public HystrixCommandAspect hystrixAspect() {
  return new HystrixCommandAspect();
}
origin: 794147572/cloud

@Bean
public HystrixCommandAspect hystrixCommandAspect(){
  return new HystrixCommandAspect();
}
origin: org.springframework.cloud/spring-cloud-netflix-hystrix

@Bean
public HystrixCommandAspect hystrixCommandAspect() {
  return new HystrixCommandAspect();
}
origin: 794147572/cloud

@Bean
public HystrixCommandAspect hystrixCommandAspect() {
  return new HystrixCommandAspect();
}
com.netflix.hystrix.contrib.javanica.aop.aspectj

Most used classes

  • HystrixCommandAspect
    AspectJ aspect to process methods which annotated with HystrixCommand annotation.
  • HystrixCommandAspect$CollapserMetaHolderFactory
  • HystrixCommandAspect$CommandMetaHolderFactory
  • HystrixCommandAspect$HystrixPointcutType
  • HystrixCommandAspect$MetaHolderFactory
    A factory to create MetaHolder depending on HystrixPointcutType.
  • HystrixCacheAspect
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