예제 #1
0
 /**
  * Default implementation to call a listener's {@link IoFutureListener#exception(Throwable)}
  * method. Owners may override this method so that the listener is called from a thread pool.
  *
  * @param listener the listener to call
  * @param throwable the exception to pass to the listener
  */
 protected void scheduleException(IoFutureListener<V> listener, Throwable throwable) {
   LOG.debug("Calling the default exception scheduler");
   try {
     listener.exception(throwable);
   } catch (Throwable t) {
     LOG.warn("Listener threw an exception", t);
   }
 }
예제 #2
0
 /**
  * Default implementation to call a listener's {@link IoFutureListener#completed(Object)} method.
  * Owners may override this method so that the listener is called from a thread pool.
  *
  * @param listener the listener to call
  * @param result the result to pass to the listener
  */
 protected void scheduleResult(IoFutureListener<V> listener, V result) {
   LOG.debug("Calling the default result scheduler");
   try {
     listener.completed(result);
   } catch (Throwable t) {
     LOG.warn("Listener threw an exception", t);
   }
 }