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 Type
    Method
    Description
    long
    Returns a scalar value for the maximum amount of time that an instance should be allowed to be idle
    Returns a TimeUnit that qualifies the getMaxIdleTime() value
    boolean
    isExpired(long lastUsed, TimeUnit timeUnit)
    Determines 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

      boolean isExpired(long lastUsed, TimeUnit timeUnit)
      Determines if an instance should be expired based on the last time it was used.
      Parameters:
      lastUsed - a scalar time value
      timeUnit - a TimeUnit that qualifies the lastUsed
      Returns:
      true if expiration should take place. false otherwise.
    • 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 a TimeUnit that qualifies the getMaxIdleTime() value