/** * Invoked when a response arrives (even if the response code is not * successful, the response still was successfully transmitted). * * @param response the response */ protected void succeeded(final CoapResponse response) { // use thread from the protocol stage if (executor == null) deliver(response); // use thread from the client executer else executor.execute(new Runnable() { public void run() { try { deliver(response); } catch (Throwable t) { LOGGER.log(Level.WARNING, "Exception while handling response", t); }}}); }
@Override public void onTimeout() { failed(); }
/** * Invoked when a response arrives (even if the response code is not * successful, the response still was successfully transmitted). * * @param response the response */ protected void succeeded(final CoapResponse response) { // use thread from the protocol stage if (executor == null) deliver(response); // use thread from the client executer else executor.execute(new Runnable() { public void run() { try { deliver(response); } catch (Throwable t) { LOGGER.log(Level.WARNING, "Exception while handling response", t); }}}); }
@Override public void onReject() { failed(); }
@Override public void onTimeout() { failed(); }
@Override public void onReject() { failed(); }
@Override public void onResponse(final Response response) { succeeded(response != null ? new CoapResponse(response) : null); }
private void asynchronous(Request request, CoapHandler handler) { request.addMessageObserver(new MessageObserverImpl(handler)); send(request); }
@Override public void onResponse(final Response response) { succeeded(response != null ? new CoapResponse(response) : null); }
private void asynchronous(Request request, CoapHandler handler) { request.addMessageObserver(new MessageObserverImpl(handler)); send(request); }
public void run() { try { deliver(response); } catch (Throwable t) { LOGGER.log(Level.WARNING, "Exception while handling response", t); }}}); }
/** * Marks the relation as canceled and invokes the the handler's failed() * method. */ @Override protected void failed() { relation.setCanceled(true); super.failed(); } }
public void run() { try { deliver(response); } catch (Throwable t) { LOGGER.log(Level.WARNING, "Exception while handling response", t); }}}); }
/** * Marks the relation as canceled and invokes the the handler's failed() * method. */ @Override protected void failed() { relation.setCanceled(true); super.failed(); } }