public class HystrixPlugins
extends java.lang.Object
register
methods in this classHystrixDynamicProperties
(usually Archaius, see get methods for property names)ServiceLoader
HystrixDynamicProperties
implementation
which is only loaded through System.properties
or the ServiceLoader (see the getter
for more details).
See the Hystrix GitHub Wiki for more information: https://github.com/Netflix/Hystrix/wiki/Plugins.
Modifier and Type | Method and Description |
---|---|
HystrixCommandExecutionHook |
getCommandExecutionHook()
Retrieve instance of
HystrixCommandExecutionHook to use based on order of precedence as defined in HystrixPlugins class header. |
HystrixConcurrencyStrategy |
getConcurrencyStrategy()
Retrieve instance of
HystrixConcurrencyStrategy to use based on order of precedence as defined in HystrixPlugins class header. |
HystrixDynamicProperties |
getDynamicProperties()
Retrieves the instance of
HystrixDynamicProperties to use. |
HystrixEventNotifier |
getEventNotifier()
Retrieve instance of
HystrixEventNotifier to use based on order of precedence as defined in HystrixPlugins class header. |
static HystrixPlugins |
getInstance() |
HystrixMetricsPublisher |
getMetricsPublisher()
Retrieve instance of
HystrixMetricsPublisher to use based on order of precedence as defined in HystrixPlugins class header. |
HystrixPropertiesStrategy |
getPropertiesStrategy()
Retrieve instance of
HystrixPropertiesStrategy to use based on order of precedence as defined in HystrixPlugins class header. |
void |
registerCommandExecutionHook(HystrixCommandExecutionHook impl)
Register a
HystrixCommandExecutionHook implementation as a global override of any injected or default implementations. |
void |
registerConcurrencyStrategy(HystrixConcurrencyStrategy impl)
Register a
HystrixConcurrencyStrategy implementation as a global override of any injected or default implementations. |
void |
registerEventNotifier(HystrixEventNotifier impl)
Register a
HystrixEventNotifier implementation as a global override of any injected or default implementations. |
void |
registerMetricsPublisher(HystrixMetricsPublisher impl)
Register a
HystrixMetricsPublisher implementation as a global override of any injected or default implementations. |
void |
registerPropertiesStrategy(HystrixPropertiesStrategy impl)
Register a
HystrixPropertiesStrategy implementation as a global override of any injected or default implementations. |
static void |
reset()
Reset all of the HystrixPlugins to null.
|
public static HystrixPlugins getInstance()
public static void reset()
Hystrix.reset()
public HystrixEventNotifier getEventNotifier()
HystrixEventNotifier
to use based on order of precedence as defined in HystrixPlugins
class header.
Override default by using registerEventNotifier(HystrixEventNotifier)
or setting property (via Archaius): hystrix.plugin.HystrixEventNotifier.implementation
with the full classname to
load.
HystrixEventNotifier
implementation to usepublic void registerEventNotifier(HystrixEventNotifier impl)
HystrixEventNotifier
implementation as a global override of any injected or default implementations.impl
- HystrixEventNotifier
implementationjava.lang.IllegalStateException
- if called more than once or after the default was initialized (if usage occurs before trying to register)public HystrixConcurrencyStrategy getConcurrencyStrategy()
HystrixConcurrencyStrategy
to use based on order of precedence as defined in HystrixPlugins
class header.
Override default by using registerConcurrencyStrategy(HystrixConcurrencyStrategy)
or setting property (via Archaius): hystrix.plugin.HystrixConcurrencyStrategy.implementation
with the
full classname to load.
HystrixConcurrencyStrategy
implementation to usepublic void registerConcurrencyStrategy(HystrixConcurrencyStrategy impl)
HystrixConcurrencyStrategy
implementation as a global override of any injected or default implementations.impl
- HystrixConcurrencyStrategy
implementationjava.lang.IllegalStateException
- if called more than once or after the default was initialized (if usage occurs before trying to register)public HystrixMetricsPublisher getMetricsPublisher()
HystrixMetricsPublisher
to use based on order of precedence as defined in HystrixPlugins
class header.
Override default by using registerMetricsPublisher(HystrixMetricsPublisher)
or setting property (via Archaius): hystrix.plugin.HystrixMetricsPublisher.implementation
with the full
classname to load.
HystrixMetricsPublisher
implementation to usepublic void registerMetricsPublisher(HystrixMetricsPublisher impl)
HystrixMetricsPublisher
implementation as a global override of any injected or default implementations.impl
- HystrixMetricsPublisher
implementationjava.lang.IllegalStateException
- if called more than once or after the default was initialized (if usage occurs before trying to register)public HystrixPropertiesStrategy getPropertiesStrategy()
HystrixPropertiesStrategy
to use based on order of precedence as defined in HystrixPlugins
class header.
Override default by using registerPropertiesStrategy(HystrixPropertiesStrategy)
or setting property (via Archaius): hystrix.plugin.HystrixPropertiesStrategy.implementation
with the full
classname to load.
HystrixPropertiesStrategy
implementation to usepublic HystrixDynamicProperties getDynamicProperties()
HystrixDynamicProperties
to use.
Unlike the other plugins this plugin cannot be re-registered and is only loaded at creation
of the HystrixPlugins
singleton.
The order of precedence for loading implementations is:
hystrix.plugin.HystrixDynamicProperties.implementation
with the class as a value.ServiceLoader
.System.getProperties()
null
public void registerPropertiesStrategy(HystrixPropertiesStrategy impl)
HystrixPropertiesStrategy
implementation as a global override of any injected or default implementations.impl
- HystrixPropertiesStrategy
implementationjava.lang.IllegalStateException
- if called more than once or after the default was initialized (if usage occurs before trying to register)public HystrixCommandExecutionHook getCommandExecutionHook()
HystrixCommandExecutionHook
to use based on order of precedence as defined in HystrixPlugins
class header.
Override default by using registerCommandExecutionHook(HystrixCommandExecutionHook)
or setting property (via Archaius): hystrix.plugin.HystrixCommandExecutionHook.implementation
with the
full classname to
load.
HystrixCommandExecutionHook
implementation to usepublic void registerCommandExecutionHook(HystrixCommandExecutionHook impl)
HystrixCommandExecutionHook
implementation as a global override of any injected or default implementations.impl
- HystrixCommandExecutionHook
implementationjava.lang.IllegalStateException
- if called more than once or after the default was initialized (if usage occurs before trying to register)