Interface CheckAssetContext
-
- All Known Implementing Classes:
AssetLatchImpl
public interface CheckAssetContextContext to check on theAsset.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidfailFunctions(java.lang.Throwable failure, boolean isPermanent)Fails theFunctionStateinstances waiting on thisAsset.longgetTime()Obtains the time that check is being made.voidreleaseFunctions(boolean isPermanent)Releases theFunctionStateinstances waiting on theAsset.
-
-
-
Method Detail
-
getTime
long getTime()
Obtains the time that check is being made.
As many
Assetinstances 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 checkingAssettimeouts).- Returns:
System.currentTimeMillis()equivalent for checkingAssettimeouts.
-
releaseFunctions
void releaseFunctions(boolean isPermanent)
Releases theFunctionStateinstances waiting on theAsset.- Parameters:
isPermanent-trueindicates that allFunctionStateinstances added to theAssetLatchfrom now on are activated immediately. It is useful to flag anAssetLatchin this state when theAssetis no longer being used to stop aFunctionStatefrom waiting forever.
-
failFunctions
void failFunctions(java.lang.Throwable failure, boolean isPermanent)Fails theFunctionStateinstances waiting on thisAsset.- Parameters:
failure- Failure to propagate to theThreadStateof theFunctionStateinstances waiting on theAsset.isPermanent-trueindicates that allFunctionStateinstances added to theAssetLatchfrom now on are activated immediately with the input failure. It is useful to flag anAssetLatchin this state when theAssetis in a failed state that can not be recovered from.
-
-