public void execute ( ChannelQueryListener listener ) { addChannelQueryListener ( listener ) ; // Make a local copy to avoid synchronization Result localResult = result ; // If the query was executed, just call the listener if ( localResult != null ) { listener . queryExecuted ( localResult ) ; } else { execute ( ) ; } }
Executes the query and calls the listener with the result . If the query was already executed the listener is called immediately with the result .