Class OndemandHystrixCommandFactory.OndemandHystrixCommand<E>
- java.lang.Object
-
- com.netflix.hystrix.HystrixCommand<E>
-
- de.hybris.platform.integration.commons.hystrix.OndemandHystrixCommandFactory.OndemandHystrixCommand<E>
-
- All Implemented Interfaces:
com.netflix.hystrix.HystrixExecutable<E>
- Enclosing class:
- OndemandHystrixCommandFactory
public class OndemandHystrixCommandFactory.OndemandHystrixCommand<E> extends com.netflix.hystrix.HystrixCommand<E>Class used for creating HystrixCommand threads. This allows us to run code separate from the acc local thread. It also allows us to provide both a timeout for the run event and a fallback strategy if either an error occurred or we exceeded the timeout limit.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanRunEvent()OndemandHystrixCommandConfigurationgetCommandConfig()SessiongetEventSession()protected HystrixExecutable<E>getExecutable()protected EgetFallback()java.util.Map<java.lang.String,java.lang.Object>getSessionAttributes()protected TenantgetTenant()booleanisExternalCallsEnabled()protected Erun()voidsetCommandConfig(OndemandHystrixCommandConfiguration commandConfig)voidsetEventSession(Session eventSession)voidsetExecutable(HystrixExecutable<E> executable)voidsetExternalCallsEnabled(boolean externalCallsEnabled)voidsetSessionAttributes(java.util.Map<java.lang.String,java.lang.Object> sessionAttributes)voidsetTenant(Tenant tenant)-
Methods inherited from class com.netflix.hystrix.HystrixCommand
execute, getCacheKey, getCommandGroup, getCommandKey, getExecutionEvents, getExecutionTimeInMilliseconds, getFailedExecutionException, getMetrics, getProperties, getThreadPoolKey, isCircuitBreakerOpen, isExecutedInThread, isExecutionComplete, isFailedExecution, isResponseFromCache, isResponseFromFallback, isResponseRejected, isResponseShortCircuited, isResponseTimedOut, isSuccessfulExecution, queue
-
-
-
-
Method Detail
-
canRunEvent
protected boolean canRunEvent()
-
getFallback
protected E getFallback()
- Overrides:
getFallbackin classcom.netflix.hystrix.HystrixCommand<E>
-
getCommandConfig
public OndemandHystrixCommandConfiguration getCommandConfig()
-
setCommandConfig
public void setCommandConfig(OndemandHystrixCommandConfiguration commandConfig)
-
getEventSession
public Session getEventSession()
-
setEventSession
public void setEventSession(Session eventSession)
-
getSessionAttributes
public java.util.Map<java.lang.String,java.lang.Object> getSessionAttributes()
-
setSessionAttributes
public void setSessionAttributes(java.util.Map<java.lang.String,java.lang.Object> sessionAttributes)
-
setTenant
public void setTenant(Tenant tenant)
-
getTenant
protected Tenant getTenant()
-
isExternalCallsEnabled
public boolean isExternalCallsEnabled()
-
setExternalCallsEnabled
public void setExternalCallsEnabled(boolean externalCallsEnabled)
-
getExecutable
protected HystrixExecutable<E> getExecutable()
-
setExecutable
public void setExecutable(HystrixExecutable<E> executable)
-
-