@Override protected GENMessageSender<byte[]> createMessageSender(GENMessage msg, String remoteRootURI) throws MALException, MALTransmitErrorException { RLOGGER.log(Level.FINE, "RMI received request to create connections to URI:{0}", remoteRootURI); try { // create new sender for this URI return new RMIMessageSender(remoteRootURI); } catch (NotBoundException e) { RLOGGER.log(Level.WARNING, "RMI could not connect to :" + remoteRootURI, e); throw new MALTransmitErrorException(msg.getHeader(), new MALStandardError(MALHelper.DESTINATION_UNKNOWN_ERROR_NUMBER, null), null); } catch (IOException e) { RLOGGER.log(Level.WARNING, "RMI could not connect to :" + remoteRootURI, e); throw new MALTransmitErrorException(msg.getHeader(), new MALStandardError(MALHelper.DELIVERY_FAILED_ERROR_NUMBER, null), null); } }
return new GENMessage(false, JMSEndpoint.createReturnHeader(msg, true, MALPubSubOperation._PUBLISH_STAGE), null, null, ex.getStandardError().getErrorNumber(), ex.getStandardError().getExtraInformation()); throw new MALTransmitErrorException(msg.getHeader(), new MALStandardError(MALHelper.BAD_ENCODING_ERROR_NUMBER, new Union(ex.getLocalizedMessage())), msg.getQoSProperties());
@Override public void sendMessages(final MALMessage[] msgList) throws MALTransmitMultipleErrorException { final List<MALTransmitErrorException> v = new LinkedList<MALTransmitErrorException>(); try { final Object multiSendHandle = internalCreateMultiSendHandle(msgList); for (int idx = 0; idx < msgList.length; idx++) { try { internalSendMessage(multiSendHandle, idx == (msgList.length - 1), (GENMessage) msgList[idx]); } catch (MALTransmitErrorException ex) { v.add(ex); } } internalCloseMultiSendHandle(multiSendHandle, msgList); } catch (Exception ex) { v.add(new MALTransmitErrorException(null, new MALStandardError(MALHelper.INTERNAL_ERROR_NUMBER, new Union(ex.getMessage())), null)); } if (!v.isEmpty()) { throw new MALTransmitMultipleErrorException(v.toArray(new MALTransmitErrorException[v.size()])); } }
} catch (MALException ex) { LOGGER.log(Level.SEVERE, "GEN could not encode message!", ex); throw new MALTransmitErrorException(msg.getHeader(), new MALStandardError(MALHelper.BAD_ENCODING_ERROR_NUMBER, null), null);
LOGGER.log(Level.WARNING, "TCPIP could not find host :{0}", remoteRootURI); LOGGER.log(Level.FINE, "TCPIP could not find host :" + remoteRootURI, e); throw new MALTransmitErrorException(msg.getHeader(), new MALStandardError(MALHelper.DESTINATION_UNKNOWN_ERROR_NUMBER, null), null); } catch (java.net.ConnectException e) { LOGGER.log(Level.WARNING, "TCPIP could not connect to : {0}", remoteRootURI); LOGGER.log(Level.FINE, "TCPIP could not connect to : " + remoteRootURI, e); throw new MALTransmitErrorException( msg.getHeader(), new MALStandardError( throw new MALTransmitErrorException(msg.getHeader(), new MALStandardError(MALHelper.DELIVERY_FAILED_ERROR_NUMBER, null), null);
throw new MALTransmitErrorException(msg.getHeader(), new MALStandardError(MALHelper.BAD_ENCODING_ERROR_NUMBER, null), null);
throw new MALTransmitErrorException(hdr, new MALStandardError(MALHelper.UNKNOWN_ERROR_NUMBER, lst), null); throw new MALTransmitErrorException(hdr, new MALStandardError(MALHelper.UNKNOWN_ERROR_NUMBER, null), null);
throw new MALTransmitErrorException(msg.getHeader(), new MALStandardError(MALHelper.DESTINATION_UNKNOWN_ERROR_NUMBER, "URI To field must not be null"), qosProperties); throw new MALTransmitErrorException(msg.getHeader(), new MALStandardError(MALHelper.DELIVERY_FAILED_ERROR_NUMBER, null), null); throw new MALTransmitErrorException(msg.getHeader(), new MALStandardError(MALHelper.INTERNAL_ERROR_NUMBER, null), null); throw new MALTransmitErrorException(msg.getHeader(), new MALStandardError(MALHelper.INTERNAL_ERROR_NUMBER, null), null);
throw new MALTransmitErrorException(msg.getHeader(), new MALStandardError(MALHelper.INTERNAL_ERROR_NUMBER, new Union(e.getMessage())), null);
throw new MALTransmitErrorException(msg.getHeader(), new MALStandardError(MALHelper.DESTINATION_UNKNOWN_ERROR_NUMBER, null), null);