Interface CheckAssetContext
-
- All Known Implementing Classes:
AssetLatchImpl
public interface CheckAssetContext
Context to check on theAsset
.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
failFunctions(java.lang.Throwable failure, boolean isPermanent)
Fails theFunctionState
instances waiting on thisAsset
.long
getTime()
Obtains the time that check is being made.void
releaseFunctions(boolean isPermanent)
Releases theFunctionState
instances waiting on theAsset
.
-
-
-
Method Detail
-
getTime
long getTime()
Obtains the time that check is being made.
As many
Asset
instances may be checked at the same time (or nanoseconds from each other) this provides optimisation to obtain the current time in milliseconds (equivalent toSystem.currentTimeMillis()
for purpose of checkingAsset
timeouts).- Returns:
System.currentTimeMillis()
equivalent for checkingAsset
timeouts.
-
releaseFunctions
void releaseFunctions(boolean isPermanent)
Releases theFunctionState
instances waiting on theAsset
.- Parameters:
isPermanent
-true
indicates that allFunctionState
instances added to theAssetLatch
from now on are activated immediately. It is useful to flag anAssetLatch
in this state when theAsset
is no longer being used to stop aFunctionState
from waiting forever.
-
failFunctions
void failFunctions(java.lang.Throwable failure, boolean isPermanent)
Fails theFunctionState
instances waiting on thisAsset
.- Parameters:
failure
- Failure to propagate to theThreadState
of theFunctionState
instances waiting on theAsset
.isPermanent
-true
indicates that allFunctionState
instances added to theAssetLatch
from now on are activated immediately with the input failure. It is useful to flag anAssetLatch
in this state when theAsset
is in a failed state that can not be recovered from.
-
-