*
* @param messageId The request ID to abandon
*/
public AbandonableRequest abandonOutstandingRequest( int messageId )
{
AbandonableRequest request = null;
synchronized ( outstandingLock )
{
request = outstandingRequests.remove( messageId );
}
// Remove the PagedSearch cursors now
try
{
closeAllPagedSearches();
}
catch ( Exception e )
{
LOG.error( I18n.err( I18n.ERR_172, e.getLocalizedMessage() ) );
}
if ( request == null )
{
LOG.warn( "AbandonableRequest with messageId {} not found in outstandingRequests.", messageId );
return null;
}
if ( request.isAbandoned() )
{
LOG.info( "AbandonableRequest with messageId {} has already been abandoned", messageId );
return request;
}
request.abandon();
if ( IS_DEBUG )
{
LOG.debug( "AbandonRequest on AbandonableRequest wth messageId {} was successful.", messageId );
}