final boolean isExpired ( ) throws SevereMessageStoreException { // 182086 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "isExpired" ) ; if ( isAvailable ( ) && internalCanExpire ( ) ) { // we can only expire if we are available long expiryTime = _tuple . getExpiryTime ( ) ; if ( expiryTime != 0 && expiryTime <= Expirer . timeNow ( ) ) { // we are due to expire boolean hasBecomeNonReleasable = false ; synchronized ( this ) { if ( ItemLinkState . STATE_AVAILABLE == _itemLinkState ) { // force item to be present AbstractItem item = _getItemNoRestore ( ) ; if ( null == item ) { item = _restoreItem ( ) ; } ListStatistics stats = getParentStatistics ( ) ; synchronized ( stats ) { stats . incrementExpiring ( ) ; stats . decrementAvailable ( ) ; } _lockID = AbstractItemLink . EXPIRY_LOCK_ID ; hasBecomeNonReleasable = _declareNotDiscardable ( item ) ; _itemLinkState = ItemLinkState . STATE_LOCKED_FOR_EXPIRY ; } } if ( hasBecomeNonReleasable ) { _declareNotReleasable ( ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "isExpired" , Boolean . valueOf ( isExpiring ( ) ) ) ; return isExpiring ( ) ; }
Establish whether the item has reached its expiry time and if so query it to see if it is willing to expire . If so set the state accordingly and lock the item for expiry .