Class LimitSupport
- java.lang.Object
-
- com.levigo.jadice.server.core.util.LimitSupport
-
-
Constructor Summary
Constructors Constructor Description LimitSupport(ServerJob job, Job clientJob)
Create a job dependentLimitSupport
(i.e.LimitSupport(WorkerController<? extends Node> controller)
Create a controller dependentLimitSupport
(i.e.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <L extends Limit>
LgetNextSignificantLimit(Class<L> limitType, Limit.WhenExceedAction action)
Get the nextLimit
of given Type and Action that is not exceeded yet and that will be triggered ontest(Class, long)
.void
test(Class<? extends Limit> limitType, long count)
Test if theLimit
s of the given type were hit.
-
-
-
Constructor Detail
-
LimitSupport
public LimitSupport(WorkerController<? extends Node> controller)
Create a controller dependentLimitSupport
(i.e. in the context of aNodeWorker
).- Parameters:
controller
- The controller where to emit warnings or failures ifLimit
s are hit.
-
LimitSupport
public LimitSupport(ServerJob job, Job clientJob)
Create a job dependentLimitSupport
(i.e. not in the context of aNodeWorker
).
-
-
Method Detail
-
getNextSignificantLimit
public <L extends Limit> L getNextSignificantLimit(Class<L> limitType, Limit.WhenExceedAction action)
Get the nextLimit
of given Type and Action that is not exceeded yet and that will be triggered ontest(Class, long)
.- Type Parameters:
L
- Limit type- Parameters:
limitType
- Class of the Limit type to look foraction
- The action to look for- Returns:
- The next significant Limit
-
-