@Override public void sendNowWith(final RequestDispatcher viaThis) { try { viaThis.dispatch(this); } catch (Exception e) { throw new MessageDeliveryFailure("could not deliver message: " + e.getMessage(), e); } }
private void sendDeliveryFailure(Message m) { MessageDeliveryFailure mdf = new MessageDeliveryFailure("could not deliver message because the outgoing queue is full"); if (m.getErrorCallback() == null || m.getErrorCallback().error(m, mdf)) { ErrorHelper.sendClientError(svc.getBus(), m, mdf.getMessage(), mdf); throw mdf; } }
"\ndisconnect: " + disconnect; if (!(e instanceof MessageDeliveryFailure && ((MessageDeliveryFailure) e).isRpcEndpointException())) { if (e == null) { logger.error(logMessage);
"\ndisconnect: " + disconnect; if (!(e instanceof MessageDeliveryFailure && ((MessageDeliveryFailure) e).isRpcEndpointException())) { if (e == null) { logger.error(logMessage);
@Override public void sendGlobalWith(final RequestDispatcher viaThis) { try { viaThis.dispatchGlobal(message); } catch (Exception e) { throw new MessageDeliveryFailure("unable to deliver message: " + e.getMessage(), e); } }
private void sendDeliveryFailure(Message m) { MessageDeliveryFailure mdf = new MessageDeliveryFailure("could not deliver message because the outgoing queue is full"); if (m.getErrorCallback() == null || m.getErrorCallback().error(m, mdf)) { ErrorHelper.sendClientError(svc.getBus(), m, mdf.getMessage(), mdf); throw mdf; } }
@Override public void sendNowWith(final RequestDispatcher viaThis) { try { viaThis.dispatch(this); } catch (Exception e) { throw new MessageDeliveryFailure("unable to deliver message: " + e.getMessage(), e); } }
throw new MessageDeliveryFailure( "wrong number of arguments sent to endpoint. (received: " + (parms == null ? 0 : parms.size()) throw new MessageDeliveryFailure("error invoking RPC endpoint " + method, e.getCause(), true); throw new MessageDeliveryFailure("error invoking endpoint", e);
/** * Invokes all callback functions that can be associated to the <tt>message</tt> * * @param message - the message in question */ public void callback(Message message) { if (!endpoints.containsKey(message.getCommandType())) { throw new MessageDeliveryFailure("no such endpoint '" + message.getCommandType() + "' in service: " + message.getSubject()); } endpoints.get(message.getCommandType()).callback(message); }
@Override public void reply() { final Message incomingMessage = getIncomingMessage(); if (incomingMessage == null) { throw new IllegalStateException("Cannot reply. Cannot find incoming message."); } if (!incomingMessage.hasResource(RequestDispatcher.class.getName())) { throw new IllegalStateException("Cannot reply. Cannot find RequestDispatcher resource."); } final RequestDispatcher dispatcher = (RequestDispatcher) incomingMessage.getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get(); if (dispatcher == null) { throw new IllegalStateException("Cannot reply. Cannot find RequestDispatcher resource."); } final Message msg = getIncomingMessage(); message.copyResource("Session", msg); message.copyResource(RequestDispatcher.class.getName(), msg); try { dispatcher.dispatch(message); } catch (Exception e) { throw new MessageDeliveryFailure("unable to deliver message: " + e.getMessage(), e); } }
public void callback(final Message message) { final MethodDispatcher method = methodDispatchers.get(message.getCommandType()); try { if (method == null) { if (defaultAction) { defaultCallback.callback(message); } else { throw new MessageDeliveryFailure(String.format("Unrecognized command, %s, in service %s", message.getCommandType(), message.getSubject())); } } else { method.dispatch(message); } } catch (MessageDeliveryFailure e) { throw e; } catch (Exception e) { maybeUnwrapAndThrowError(e); } }
@Override public void sendGlobalWith(final RequestDispatcher viaThis) { try { viaThis.dispatchGlobal(message); } catch (Exception e) { throw new MessageDeliveryFailure("unable to deliver message: " + e.getMessage(), e); } }
@Override public void sendNowWith(final RequestDispatcher viaThis) { try { viaThis.dispatch(this); } catch (Exception e) { throw new MessageDeliveryFailure("could not deliver message: " + e.getMessage(), e); } }
@Override public void sendNowWith(final RequestDispatcher viaThis) { try { viaThis.dispatch(this); } catch (Exception e) { throw new MessageDeliveryFailure("unable to deliver message: " + e.getMessage(), e); } }
throw new MessageDeliveryFailure( "wrong number of arguments sent to endpoint. (received: " + (parms == null ? 0 : parms.size()) throw new MessageDeliveryFailure("error invoking RPC endpoint " + method, e.getCause(), true); throw new MessageDeliveryFailure("error invoking endpoint", e);
/** * Invokes all callback functions that can be associated to the <tt>message</tt> * * @param message - the message in question */ public void callback(Message message) { if (!endpoints.containsKey(message.getCommandType())) { throw new MessageDeliveryFailure("no such endpoint '" + message.getCommandType() + "' in service: " + message.getSubject()); } endpoints.get(message.getCommandType()).callback(message); }
@Override public void reply() { final Message incomingMessage = getIncomingMessage(); if (incomingMessage == null) { throw new IllegalStateException("Cannot reply. Cannot find incoming message."); } if (!incomingMessage.hasResource(RequestDispatcher.class.getName())) { throw new IllegalStateException("Cannot reply. Cannot find RequestDispatcher resource."); } final RequestDispatcher dispatcher = (RequestDispatcher) incomingMessage.getResource(ResourceProvider.class, RequestDispatcher.class.getName()).get(); if (dispatcher == null) { throw new IllegalStateException("Cannot reply. Cannot find RequestDispatcher resource."); } final Message msg = getIncomingMessage(); message.copyResource("Session", msg); message.copyResource(RequestDispatcher.class.getName(), msg); try { dispatcher.dispatch(message); } catch (Exception e) { throw new MessageDeliveryFailure("unable to deliver message: " + e.getMessage(), e); } }
public void callback(final Message message) { final MethodDispatcher method = methodDispatchers.get(message.getCommandType()); try { if (method == null) { if (defaultAction) { defaultCallback.callback(message); } else { throw new MessageDeliveryFailure(String.format("Unrecognized command, %s, in service %s", message.getCommandType(), message.getSubject())); } } else { method.dispatch(message); } } catch (MessageDeliveryFailure e) { throw e; } catch (Exception e) { maybeUnwrapAndThrowError(e); } }