Package com.devebot.opflow
Class OpflowRestrictor
java.lang.Object
com.devebot.opflow.OpflowRestrictor
- All Implemented Interfaces:
AutoCloseable
public class OpflowRestrictor extends Object implements AutoCloseable
- Author:
- pnhung177
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceOpflowRestrictor.Action<T> -
Constructor Summary
Constructors Constructor Description OpflowRestrictor()OpflowRestrictor(ReentrantReadWriteLock sharedLock, Map<String,Object> options)OpflowRestrictor(Map<String,Object> options) -
Method Summary
Modifier and Type Method Description voidclose()<T> Tfilter(OpflowRestrictor.Action<T> action)StringgetInstanceId()longgetPauseDuration()longgetPauseElapsed()longgetPauseTimeout()intgetSemaphoreLimit()intgetSemaphorePermits()longgetSemaphoreTimeout()booleanisActive()booleanisPaused()booleanisPauseEnabled()booleanisSemaphoreEnabled()voidlock()Map<String,Object>pause(long duration)voidsetActive(boolean enabled)voidunlock()Map<String,Object>unpause()
-
Constructor Details
-
OpflowRestrictor
public OpflowRestrictor() -
OpflowRestrictor
-
OpflowRestrictor
-
-
Method Details
-
isActive
public boolean isActive() -
setActive
public void setActive(boolean enabled) -
getInstanceId
-
isPauseEnabled
public boolean isPauseEnabled() -
getPauseTimeout
public long getPauseTimeout() -
getPauseDuration
public long getPauseDuration() -
getPauseElapsed
public long getPauseElapsed() -
getSemaphoreLimit
public int getSemaphoreLimit() -
getSemaphorePermits
public int getSemaphorePermits() -
isSemaphoreEnabled
public boolean isSemaphoreEnabled() -
getSemaphoreTimeout
public long getSemaphoreTimeout() -
filter
- Throws:
Throwable
-
isPaused
public boolean isPaused() -
pause
-
unpause
-
lock
public void lock() -
unlock
public void unlock() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-