Java Code Examples for com.netflix.hystrix.strategy.executionhook.HystrixCommandExecutionHookDefault

Following code examples demonstrate how to use com.netflix.hystrix.strategy.executionhook.HystrixCommandExecutionHookDefault from netflix-hystrix. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use com.netflix.hystrix.strategy.executionhook.HystrixCommandExecutionHookDefault and various code implementation of this class.
Example 1
Project : netflix-hystrix Source File : HystrixPlugins.java View Source Code on GitHub

    public HystrixCommandExecutionHook getCommandExecutionHook() {
        if (commandExecutionHook.get() == null) {
            Object impl = getPluginImplementation(HystrixCommandExecutionHook.class);
            if (impl == null) {
                commandExecutionHook.compareAndSet(null, HystrixCommandExecutionHookDefault.getInstance());
            } else {
                commandExecutionHook.compareAndSet(null, (HystrixCommandExecutionHook) impl);
            }
        }
        return commandExecutionHook.get();
    }
			
Example 2
Project : netflix-hystrix Source File : HystrixPrometheusMetricsPublisher.java View Source Code on GitHub

                        public void accept(Histogram.Builder builder) {
                            if (metrics == MetricsType.EXPONENTIAL) {
                                builder.exponentialBuckets(exponentialStart, exponentialFactor, exponentialCount);
                            } else if (metrics == MetricsType.LINEAR) {
                                builder.linearBuckets(linearStart, linearWidth, linearCount);
                            } else if (metrics == MetricsType.DISTINCT) {
                                builder.buckets(distinctBuckets);
                            } else if (metrics == MetricsType.DEFAULT) {
                            } else {
                                throw new IllegalStateException("unknown enum state " + metrics);
                            }
                        }