void onInstanceLost ( String uniqueIdentifier ) { log ( TAG , "instance lost " + uniqueIdentifier ) ; List < String > queriesIds = results . get ( uniqueIdentifier ) ; if ( queriesIds == null ) { return ; } for ( String queryId : queriesIds ) { String [ ] args = new String [ 2 ] ; args [ 0 ] = queryId ; args [ 1 ] = uniqueIdentifier ; Message msg = handler . obtainMessage ( SearchMessages . RESULT_LOST , args ) ; log ( TAG , "sending message RESULT_LOST to handler for queryId: " + queryId ) ; handler . sendMessage ( msg ) ; } }
Call this method when the middleware notify that a spf instance is lost . It will notify the event to all the active searches that have the lost instance in their results .