private void internalHandleSend(final MALMessage msg, final Address address) throws MALInteractionException { try { MALContextFactoryImpl.LOGGER.log(Level.FINE, "internalHandleSend for type {0}", address.handler); address.handler.handleSend(new SendInteractionImpl(sender, msg), msg.getBody()); } catch (MALException ex) { MALContextFactoryImpl.LOGGER.log(Level.WARNING, "Error generated during reception of SEND pattern, dropping: {0}", ex); } }
@Override public void close() throws MALException { super.close(); this.handler.malFinalize(this); }
private void internalHandleSubmit(final MALMessage msg, final Address address) throws MALInteractionException { SubmitInteractionImpl interaction = new SubmitInteractionImpl(sender, address, msg); try { try { MALContextFactoryImpl.LOGGER.log(Level.FINE, "internalHandleSubmit for {0} type {1}", new Object[] { msg.getHeader().getTransactionId(), address.handler }); address.handler.handleSubmit(interaction, msg.getBody()); } catch (MALInteractionException ex) { interaction.sendError(ex.getStandardError()); } } catch (MALException ex) { sender.returnError(address, msg.getHeader(), MALSubmitOperation.SUBMIT_ACK_STAGE, ex); } }
private void internalHandleRequest(final MALMessage msg, final Address address) throws MALInteractionException { RequestInteractionImpl interaction = new RequestInteractionImpl(sender, address, msg); try { try { MALContextFactoryImpl.LOGGER.log(Level.FINE, "internalHandleRequest for {0} type {1}", new Object[] { msg.getHeader().getTransactionId(), address.handler }); address.handler.handleRequest(interaction, msg.getBody()); } catch (MALInteractionException ex) { interaction.sendError(ex.getStandardError()); } } catch (MALException ex) { sender.returnError(address, msg.getHeader(), MALRequestOperation.REQUEST_RESPONSE_STAGE, ex); } }
this.handler.malInitialize(this); this.handler.malInitialize(this);
private void internalHandleProgress(final MALMessage msg, final Address address) throws MALInteractionException { ProgressInteractionImpl interaction = new ProgressInteractionImpl(sender, address, msg); try { try { MALContextFactoryImpl.LOGGER.log(Level.FINE, "internalHandleProgresss for {0} type {1}", new Object[] { msg.getHeader().getTransactionId(), address.handler }); address.handler.handleProgress(interaction, msg.getBody()); } catch (MALInteractionException ex) { interaction.sendError(ex.getStandardError()); } } catch (MALException ex) { try { interaction.sendError(new MALStandardError(MALHelper.INTERNAL_ERROR_NUMBER, new Union(ex.getLocalizedMessage()))); } catch (MALException noex) { // this exception cannot actually be thrown in this implmentation, therefore we can safely ignore it } } }
private void internalHandleInvoke(final MALMessage msg, final Address address) throws MALInteractionException { InvokeInteractionImpl interaction = new InvokeInteractionImpl(sender, address, msg); try { try { MALContextFactoryImpl.LOGGER.log(Level.FINE, "internalHandleInvoke for {0} type {1}", new Object[] { msg.getHeader().getTransactionId(), address.handler }); address.handler.handleInvoke(interaction, msg.getBody()); } catch (MALInteractionException ex) { interaction.sendError(ex.getStandardError()); } } catch (MALException ex) { try { interaction.sendError(new MALStandardError(MALHelper.INTERNAL_ERROR_NUMBER, new Union(ex.getLocalizedMessage()))); } catch (MALException noex) { // this exception cannot actually be thrown in this implmentation, therefore we can safely ignore it } } }