Class TopicSubscriptionManager
- java.lang.Object
-
- org.camunda.bpm.client.topic.impl.TopicSubscriptionManager
-
-
Field Summary
Fields Modifier and Type Field Description protected ReentrantLockACQUISITION_MONITORprotected BackoffStrategybackoffStrategyprotected longclientLockDurationprotected EngineClientengineClientprotected Map<String,ExternalTaskHandler>externalTaskHandlersprotected ExternalTaskServiceImplexternalTaskServiceprotected ConditionIS_WAITINGprotected AtomicBooleanisBackoffStrategyDisabledprotected AtomicBooleanisRunningprotected static TopicSubscriptionManagerLoggerLOGprotected CopyOnWriteArrayList<TopicSubscription>subscriptionsprotected List<TopicRequestDto>taskTopicRequestsprotected Threadthreadprotected TypedValuestypedValues
-
Constructor Summary
Constructors Constructor Description TopicSubscriptionManager(EngineClient engineClient, TypedValues typedValues, long clientLockDuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidacquire()voiddisableBackoffStrategy()protected FetchAndLockResponseDtofetchAndLock(List<TopicRequestDto> subscriptions)EngineClientgetEngineClient()List<TopicSubscription>getSubscriptions()protected voidhandleExternalTask(ExternalTask externalTask, ExternalTaskHandler taskHandler)booleanisRunning()protected voidprepareAcquisition(TopicSubscription subscription)protected voidresume()voidrun()protected voidrunBackoffStrategy(FetchAndLockResponseDto fetchAndLockResponse)voidsetBackoffStrategy(BackoffStrategy backOffStrategy)voidstart()voidstop()protected voidsubscribe(TopicSubscription subscription)protected voidsuspend(long waitTime)protected voidunsubscribe(TopicSubscriptionImpl subscription)
-
-
-
Field Detail
-
LOG
protected static final TopicSubscriptionManagerLogger LOG
-
ACQUISITION_MONITOR
protected ReentrantLock ACQUISITION_MONITOR
-
IS_WAITING
protected Condition IS_WAITING
-
isRunning
protected AtomicBoolean isRunning
-
externalTaskService
protected ExternalTaskServiceImpl externalTaskService
-
engineClient
protected EngineClient engineClient
-
subscriptions
protected CopyOnWriteArrayList<TopicSubscription> subscriptions
-
taskTopicRequests
protected List<TopicRequestDto> taskTopicRequests
-
externalTaskHandlers
protected Map<String,ExternalTaskHandler> externalTaskHandlers
-
thread
protected Thread thread
-
backoffStrategy
protected BackoffStrategy backoffStrategy
-
isBackoffStrategyDisabled
protected AtomicBoolean isBackoffStrategyDisabled
-
typedValues
protected TypedValues typedValues
-
clientLockDuration
protected long clientLockDuration
-
-
Constructor Detail
-
TopicSubscriptionManager
public TopicSubscriptionManager(EngineClient engineClient, TypedValues typedValues, long clientLockDuration)
-
-
Method Detail
-
acquire
protected void acquire()
-
prepareAcquisition
protected void prepareAcquisition(TopicSubscription subscription)
-
fetchAndLock
protected FetchAndLockResponseDto fetchAndLock(List<TopicRequestDto> subscriptions)
-
handleExternalTask
protected void handleExternalTask(ExternalTask externalTask, ExternalTaskHandler taskHandler)
-
stop
public void stop()
-
start
public void start()
-
subscribe
protected void subscribe(TopicSubscription subscription)
-
unsubscribe
protected void unsubscribe(TopicSubscriptionImpl subscription)
-
getEngineClient
public EngineClient getEngineClient()
-
getSubscriptions
public List<TopicSubscription> getSubscriptions()
-
isRunning
public boolean isRunning()
-
setBackoffStrategy
public void setBackoffStrategy(BackoffStrategy backOffStrategy)
-
runBackoffStrategy
protected void runBackoffStrategy(FetchAndLockResponseDto fetchAndLockResponse)
-
suspend
protected void suspend(long waitTime)
-
resume
protected void resume()
-
disableBackoffStrategy
public void disableBackoffStrategy()
-
-