/** * Retrieve instance of {@link HystrixPropertiesStrategy} to use based on order of precedence as defined in {@link HystrixPlugins} class header. * <p> * Override default by using {@link #registerPropertiesStrategy(HystrixPropertiesStrategy)} or setting property (via Archaius): <code>hystrix.plugin.HystrixPropertiesStrategy.implementation</code> with the full * classname to load. * * @return {@link HystrixPropertiesStrategy} implementation to use */ public HystrixPropertiesStrategy getPropertiesStrategy() { if (propertiesFactory.get() == null) { // check for an implementation from Archaius first Object impl = getPluginImplementation(HystrixPropertiesStrategy.class); if (impl == null) { // nothing set via Archaius so initialize with default propertiesFactory.compareAndSet(null, HystrixPropertiesStrategyDefault.getInstance()); // we don't return from here but call get() again in case of thread-race so the winner will always get returned } else { // we received an implementation from Archaius so use it propertiesFactory.compareAndSet(null, (HystrixPropertiesStrategy) impl); } } return propertiesFactory.get(); }
@Override public HystrixCollapserProperties getCollapserProperties(HystrixCollapserKey collapserKey, com.netflix.hystrix.HystrixCollapserProperties.Setter builder) { return HystrixPropertiesStrategyDefault.getInstance() .getCollapserProperties(collapserKey, builder); }
/** * Retrieve instance of {@link HystrixPropertiesStrategy} to use based on order of precedence as defined in {@link HystrixPlugins} class header. * <p> * Override default by using {@link #registerPropertiesStrategy(HystrixPropertiesStrategy)} or setting property (via Archaius): <code>hystrix.plugin.HystrixPropertiesStrategy.implementation</code> with the full * classname to load. * * @return {@link HystrixPropertiesStrategy} implementation to use */ public HystrixPropertiesStrategy getPropertiesStrategy() { if (propertiesFactory.get() == null) { // check for an implementation from Archaius first Object impl = getPluginImplementation(HystrixPropertiesStrategy.class); if (impl == null) { // nothing set via Archaius so initialize with default propertiesFactory.compareAndSet(null, HystrixPropertiesStrategyDefault.getInstance()); // we don't return from here but call get() again in case of thread-race so the winner will always get returned } else { // we received an implementation from Archaius so use it propertiesFactory.compareAndSet(null, (HystrixPropertiesStrategy) impl); } } return propertiesFactory.get(); }
static HystrixStrategies getDefault() { return new HystrixStrategies(HystrixPropertiesStrategyDefault.getInstance(), HystrixConcurrencyStrategyDefault.getInstance(), HystrixEventNotifierDefault.getInstance(), "default"); }