Package com.reignite.messaging.amfr

Examples of com.reignite.messaging.amfr.RemotingMessage


    AMFMessageBody messageBody = context.getRequestBody();

    Endpoint endpoint = context.getEndpoint();

    RemotingMessage remotingMessage = (RemotingMessage) messageBody.getData();
    try {
      responseBody.setData(endpoint.routeMessageToService(remotingMessage));
    } catch (MessagingException e) {
      LogWriter.error(getClass(), "Failed to route message to service: " + e, e);
      ErrorMessage errorBody = new ErrorMessage("Service destination could not be reached",
          remotingMessage.getDestination(), remotingMessage.getOperation(), remotingMessage.getParameters());
      responseBody.setData(errorBody);
    }
    responseBody.setResponseURI(messageBody.getResponseURI());
    if (responseBody.getData() instanceof ErrorMessage) {
      responseBody.setResponseURI(responseBody.getResponseURI() + AMFMessageBody.STATUS_METHOD);
View Full Code Here


    return walkToEndOfChain(filter.getNext());
  }

  @Override
  public MessageBodyData routeMessageToService(MessageBodyData data) throws MessagingException {
    RemotingMessage message = (RemotingMessage) data;
    String destination = message.getDestination();
    String operation = message.getOperation();
    Object[] params = message.getParameters();
    Service service = locateService(destination, operation, params);
    Object response = null;
    if (service == null) {
      response = new ErrorMessage("Service was null.", destination, operation, params);
      LogWriter.error(getClass(), response.toString());
    } else {
      try {
        response = service.invoke();
      } catch (Exception e) {
        response = new ErrorMessage("Service invocation failed: " + e.getMessage(), destination, operation,
            params);
        LogWriter.error(getClass(), response.toString(), e);
      }
    }
    RemoteResponseMessage ack = message.createResponse();
    ack.setBody(response);

    return ack;
  }
View Full Code Here

TOP

Related Classes of com.reignite.messaging.amfr.RemotingMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.