public static NoResponseListener getInstance ( Batcher batcher ) { if ( batcher instanceof WriteBatcher ) { WriteFailureListener [ ] writeFailureListeners = ( ( WriteBatcher ) batcher ) . getBatchFailureListeners ( ) ; for ( WriteFailureListener writeFailureListener : writeFailureListeners ) { if ( writeFailureListener instanceof NoResponseListener ) { return ( NoResponseListener ) writeFailureListener ; } } } else if ( batcher instanceof QueryBatcher ) { QueryFailureListener [ ] queryFailureListeners = ( ( QueryBatcher ) batcher ) . getQueryFailureListeners ( ) ; for ( QueryFailureListener queryFailureListener : queryFailureListeners ) { if ( queryFailureListener instanceof NoResponseListener ) { return ( NoResponseListener ) queryFailureListener ; } } } else { throw new IllegalStateException ( "The Batcher should be either a QueryBatcher instance or a WriteBatcher instance" ) ; } return null ; }
Returns the NoResponseListener instance registered with the Batcher .