Interface ExpirationPolicy
- All Superinterfaces:
org.mule.runtime.api.component.Component
public interface ExpirationPolicy
extends org.mule.runtime.api.component.Component
A policy around when should a given instances be expired
Notice that this contract is not directly tied to the instance to be expired itself. It's tied to the concept of idle based
expiration.
- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.mule.runtime.api.component.Component
org.mule.runtime.api.component.Component.Annotations -
Field Summary
Fields inherited from interface org.mule.runtime.api.component.Component
ANNOTATIONS_PROPERTY_NAME, NS_MULE_DOCUMENTATION, NS_MULE_PARSER_METADATA -
Method Summary
Modifier and TypeMethodDescriptionlongReturns a scalar value for the maximum amount of time that an instance should be allowed to be idleReturns aTimeUnitthat qualifies thegetMaxIdleTime()valuebooleanDetermines if an instance should be expired based on the last time it was used.Methods inherited from interface org.mule.runtime.api.component.Component
getAnnotation, getAnnotations, getDslSource, getIdentifier, getLocation, getRepresentation, getRootContainerLocation, setAnnotations
-
Method Details
-
isExpired
Determines if an instance should be expired based on the last time it was used.- Parameters:
lastUsed- a scalar time valuetimeUnit- aTimeUnitthat qualifies thelastUsed- Returns:
trueif expiration should take place.falseotherwise.
-
getMaxIdleTime
long getMaxIdleTime()Returns a scalar value for the maximum amount of time that an instance should be allowed to be idle -
getTimeUnit
TimeUnit getTimeUnit()Returns aTimeUnitthat qualifies thegetMaxIdleTime()value
-