public final boolean removeExpirable ( Expirable expirable ) throws SevereMessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "removeExpirable" , "objId=" + ( expirable == null ? "null" : String . valueOf ( expirable . expirableGetID ( ) ) ) + " ET=" + ( expirable == null ? "null" : String . valueOf ( expirable . expirableGetExpiryTime ( ) ) ) + " addEnabled=" + addEnabled ) ; } boolean reply = false ; boolean cancelled = false ; // Ignore this request if the expirer has ended or the given entry is null synchronized ( lockObject ) { if ( addEnabled && expirable != null ) { long expiryTime = expirable . expirableGetExpiryTime ( ) ; ExpirableReference expirableRef = new ExpirableReference ( expirable ) ; expirableRef . setExpiryTime ( expiryTime ) ; // Remove the expirable from the expiry index reply = expiryIndex . remove ( expirableRef ) ; if ( reply && expiryIndex . size ( ) <= 0 ) // We just removed the last entry { if ( expiryAlarm != null ) { expiryAlarm . cancel ( ) ; alarmScheduled = false ; cancelled = true ; } } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "removeExpirable" , "reply=" + reply + " cancelled=" + cancelled ) ; return reply ; }
Remove an Expirable reference for an item from the expiry index .