Package org.jboss.soa.esb.message

Examples of org.jboss.soa.esb.message.Body


    _replyToOriginator = config.getBooleanAttribute(Constants.REPLY_TO_ORIGINATOR_TAG, false) ;
  }
 
  public void setJBPMContextParameters(Message message)
  {
    Body body = message.getBody();

        if (null!=_keyPath)
            body.add(Constants.KEYPATH, _keyPath);

        if (null!=_actor)
      body.add(Constants.ACTOR_ID  ,_actor);

        if (null!=_processName)
      body.add(Constants.PROCESS_DEFINITION_NAME  ,_processName);

        if (null!=_processId)
      body.add(Constants.PROCESS_DEFINITION_ID  ,_processId);

        if (null!=_transitionName)
      body.add(Constants.TRANSITION_NAME, _transitionName);

        Map<String,Object> variableMap = _mapper.mapFromEsbMessageToJBpmMap(message,_esbToBpm);

        if (null!=variableMap)
            body.add(Constants.VARIABLE_VALUES, variableMap);

        if (_replyToOriginator) {
            final Call call = message.getHeader().getCall() ;
            setEPR(body, Constants.REPLY_TO, getEPR(call.getReplyTo())) ;
            setEPR(body, Constants.FAULT_TO, getEPR(call.getFaultTo())) ;
View Full Code Here


   {

      SaySomething hello = (SaySomething) getBeanFactory().getBean(
            "helloObject");

      Body msgBody = message.getBody();
      String contents = (String) message.getBody().get();
      StringBuffer sb = new StringBuffer();
      sb.append(contents);
      sb.append("\n");
      sb.append(hello.getGreeting());

      msgBody.add(sb.toString());

      return message;
   }
View Full Code Here

   public Message sayGoodbyeSpring(Message message) throws Exception
   {
      SaySomething goodbye = (SaySomething) getBeanFactory().getBean(
            "goodbyeObject");

      Body msgBody = message.getBody();
       String contents = (String) message.getBody().get();
      StringBuffer sb = new StringBuffer();
      sb.append(contents);
      sb.append("\n");
      sb.append(goodbye.getGreeting());

      msgBody.add(sb.toString());

      return message;
   }
View Full Code Here

    logFooter();
    return message;          
  }
 
  public Message playWithMessage(Message message) throws Exception {
     Body msgBody = message.getBody();
     String contents = (String) msgBody.get();
     StringBuffer sb = new StringBuffer();
     sb.append("\nBEFORE\n");
     sb.append(contents);
     sb.append("\nAFTER\n");
     msgBody.add(sb.toString());
     return message;
  }
View Full Code Here

  public static final String bodyType (Message msg)
  {
    if ((msg == null) || (msg.getBody() == null))
      throw new IllegalArgumentException();
   
    Body body = msg.getBody();
   
    String type = (String) body.get(CONTENT_TYPE);
   
    if (type == null)
      return RAW_BODY;
    else
      return type;
View Full Code Here

    }
   
    private static Message getFaultMessage(final QName code, final String description, final String detail, final Throwable th)
    {
        final Message message = MessageFactory.getInstance().getMessage() ;
        final Body body = message.getBody() ;
        final Fault fault = message.getFault() ;
        if (th != null)
        {
            fault.setCause(th);
            fault.setReason(th.toString()) ;
        }
        fault.setCode(URI.create(Factory.PROCESSING_ERROR)) ;
       
        body.add(Fault.DETAIL_CODE_CONTENT, code) ;
        if (description != null)
        {
            body.add(Fault.DETAIL_DESCRIPTION_CONTENT, description) ;
        }
        if (detail != null)
        {
            body.add(Fault.DETAIL_DETAIL_CONTENT, detail) ;
        }
        fault.setReason(description) ;
       
        return message ;
    }
View Full Code Here

      this.paramType = paramType;
      this.bodyParam = bodyParam;
    }

    public Object getParam(Message message) throws MessageDeliverException {
      Body body = message.getBody();
     
      String bodyPartName = AnnotationUtil.getBodyName(bodyParam);
      if(bodyPartName != null) {
        Object param = body.get(bodyPartName);
        if(param != null && !paramType.isInstance(param)) {
          throw new MessageDeliverException("Named Body part '" + bodyPartName + "' exists on ESB message but is not of type '" + paramType.getName() + "'.");
        }
        return param;
      } else {     
        for(String bodyPartNameOnMessage : body.getNames()) {
          Object param = body.get(bodyPartNameOnMessage);
          if(param != null && paramType.isInstance(param)) {
            return param;
          }
        }
      }
View Full Code Here

        catch (final MalformedObjectNameException mone)
        {
            throw new ActionProcessingException("Error creating MBean proxy", mone) ;
        }
       
        final Body body = message.getBody() ;
        final Object messageRequest ;
        if (requestLocation != null)
        {
            messageRequest = body.get(requestLocation) ;
        }
        else
        {
            messageRequest = body.get() ;
        }
        final String contents = String.valueOf(messageRequest) ;
        ebwsServer.logMessage(contents) ;
       
        final Properties props = message.getProperties() ;
        final String wsaMessageID = (String) props.getProperty(Environment.WSA_MESSAGE_ID) ;
        log(ebwsServer, wsaMessageID) ;
       
        final String response = (message.getBody().get(EBWSUtil.ERROR) != null ? EBWSUtil.INVALID_RESPONSE : EBWSUtil.VALID_RESPONSE) ;
        ebwsServer.logMessage(response) ;
       
        if (responseLocation != null)
        {
            body.add(responseLocation, response) ;
        }
        else
        {
            body.add(response) ;
        }
        return message;
    }
View Full Code Here

    }
   
    public void testOldSerializedBodyDeserialisation()
        throws Exception
    {
        final Body body = (Body)deserialise("old_body.ser") ;
        validateOldBody(body) ;
    }
View Full Code Here

    }
   
    public void testNewSerializedBodyDeserialisation()
        throws Exception
    {
        final Body body = (Body)deserialise("new_body.ser") ;
        validateNewBody(body) ;
    }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.message.Body

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.