@ Override public final void releaseIfDiscardable ( ) throws SevereMessageStoreException { boolean unlink = false ; // flag so we can unlink outside sync block if ( isStoreNever ( ) ) { synchronized ( this ) { if ( ItemLinkState . STATE_AVAILABLE == _itemLinkState ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "removing STORE_NEVER item as a result of discard" ) ; ListStatistics stats = getParentStatistics ( ) ; synchronized ( stats ) { stats . decrementAvailable ( ) ; stats . decrementTotal ( _inMemoryItemSize ) ; } _itemLinkState = ItemLinkState . STATE_NOT_STORED ; unlink = true ; } } } if ( unlink ) { getMessageStoreImpl ( ) . unregister ( this ) ; unlink ( ) ; } }
This is the callback from the item cache to indicate that the discardable item should be freed . It s only used to remove STORE_NEVER items from the MS when the cache of these items is full .