Пример #1
0
 /**
  * Converts the message implementation into a String representation
  *
  * @param encoding The encoding to use when transforming the message (if necessary). The parameter
  *     is used when converting from a byte array
  * @return String representation of the message payload
  * @throws Exception Implementation may throw an endpoint specific exception
  */
 public String getPayloadAsString(String encoding) throws Exception {
   if (encoding == null) {
     return adapter.getPayloadAsString();
   } else {
     return adapter.getPayloadAsString(encoding);
   }
 }
Пример #2
0
 public MuleMessage(Object message, UMOMessageAdapter previous) {
   if (message instanceof UMOMessageAdapter) {
     adapter = (UMOMessageAdapter) message;
   } else {
     adapter = new DefaultMessageAdapter(message, previous);
   }
   if (previous.getExceptionPayload() != null) {
     setExceptionPayload(previous.getExceptionPayload());
   }
   setEncoding(previous.getEncoding());
   if (previous.getAttachmentNames().size() > 0) {
     Set attNames = adapter.getAttachmentNames();
     synchronized (attNames) {
       for (Iterator iterator = attNames.iterator(); iterator.hasNext(); ) {
         String s = (String) iterator.next();
         try {
           addAttachment(s, adapter.getAttachment(s));
         } catch (Exception e) {
           throw new MuleRuntimeException(new Message(Messages.FAILED_TO_READ_ATTACHMENT_X, s), e);
         }
       }
     }
   }
 }
Пример #3
0
 /**
  * Determines how many messages are in the correlation group
  *
  * @param size the total messages in this group or -1 if the size is not known
  */
 public void setCorrelationGroupSize(int size) {
   adapter.setCorrelationGroupSize(size);
 }
Пример #4
0
 /**
  * Sets a double property on the event
  *
  * @param name the property name or key
  * @param value the property value
  */
 public void setDoubleProperty(String name, double value) {
   adapter.setDoubleProperty(name, value);
 }
Пример #5
0
 /**
  * Determines how many messages are in the correlation group
  *
  * @return total messages in this group or -1 if the size is not known
  */
 public int getCorrelationGroupSize() {
   return adapter.getCorrelationGroupSize();
 }
Пример #6
0
 /**
  * Sets the encoding for this message
  *
  * @param encoding the encoding to use
  */
 public void setEncoding(String encoding) {
   adapter.setEncoding(encoding);
 }
Пример #7
0
 /**
  * Sets a String property on the event
  *
  * @param name the property name or key
  * @param value the property value
  */
 public void setStringProperty(String name, String value) {
   adapter.setStringProperty(name, value);
 }
Пример #8
0
 public void removeAttachment(String name) throws Exception {
   adapter.removeAttachment(name);
 }
Пример #9
0
 public Set getAttachmentNames() {
   return adapter.getAttachmentNames();
 }
Пример #10
0
 public void setIntProperty(String name, int value) {
   adapter.setIntProperty(name, value);
 }
Пример #11
0
 /**
  * Sets a correlationId for this message. The correlation Id can be used by components in the
  * system to manage message relations
  *
  * <p>transport protocol. As such not all messages will support the notion of a correlationId i.e.
  * tcp or file. In this situation the correlation Id is set as a property of the message where
  * it's up to developer to keep the association with the message. For example if the message is
  * serialised to xml the correlationId will be available in the message.
  *
  * @param id the Id reference for this relationship
  */
 public void setCorrelationId(String id) {
   adapter.setCorrelationId(id);
 }
Пример #12
0
 public boolean getBooleanProperty(String name, boolean defaultValue) {
   return adapter.getBooleanProperty(name, defaultValue);
 }
Пример #13
0
 public void setBooleanProperty(String name, boolean value) {
   adapter.setBooleanProperty(name, value);
 }
Пример #14
0
 public int getIntProperty(String name, int defaultValue) {
   return adapter.getIntProperty(name, defaultValue);
 }
Пример #15
0
 public Object getProperty(String name, Object defaultValue) {
   return adapter.getProperty(name, defaultValue);
 }
Пример #16
0
 public String getUniqueId() throws UniqueIdNotSupportedException {
   return adapter.getUniqueId();
 }
Пример #17
0
 public String toString() {
   return adapter.toString();
 }
Пример #18
0
 /**
  * Sets a correlationId for this message. The correlation Id can be used by components in the
  * system to manage message relations.
  *
  * <p>The correlationId is associated with the message using the underlying transport protocol. As
  * such not all messages will support the notion of a correlationId i.e. tcp or file. In this
  * situation the correlation Id is set as a property of the message where it's up to developer to
  * keep the association with the message. For example if the message is serialised to xml the
  * correlationId will be available in the message.
  *
  * @return the correlationId for this message or null if one hasn't been set
  */
 public String getCorrelationId() {
   return adapter.getCorrelationId();
 }
Пример #19
0
 public void addAttachment(String name, DataHandler dataHandler) throws Exception {
   adapter.addAttachment(name, dataHandler);
 }
Пример #20
0
 /**
  * Sets a replyTo address for this message. This is useful in an asynchronous environment where
  * the caller doesn't wait for a response and the response needs to be routed somewhere for
  * further processing. The value of this field can be any valid endpointUri url.
  *
  * @param replyTo the endpointUri url to reply to
  */
 public void setReplyTo(Object replyTo) {
   adapter.setReplyTo(replyTo);
 }
Пример #21
0
 public DataHandler getAttachment(String name) {
   return adapter.getAttachment(name);
 }
Пример #22
0
 /**
  * Sets a replyTo address for this message. This is useful in an asynchronous environment where
  * the caller doesn't wait for a response and the response needs to be routed somewhere for
  * further processing. The value of this field can be any valid endpointUri url.
  *
  * @return the endpointUri url to reply to or null if one has not been set
  */
 public Object getReplyTo() {
   return adapter.getReplyTo();
 }
Пример #23
0
 /**
  * Gets the encoding for the current message. For potocols that send encoding Information with the
  * message, this method should be overriden to expose the transport encoding, otherwise the
  * default encoding in the Mule configuration will be used
  *
  * @return the encoding for this message. This method must never return null
  */
 public String getEncoding() {
   return adapter.getEncoding();
 }
Пример #24
0
 /**
  * Gets a property of the payload implementation
  *
  * @param key the key on which to lookup the property value
  * @return the property value or null if the property does not exist
  */
 public Object getProperty(Object key) {
   return adapter.getProperty(key.toString());
 }
Пример #25
0
 /**
  * Gets a String property from the event
  *
  * @param name the name or key of the property
  * @param defaultValue a default value if the property doesn't exist in the event
  * @return the property value or the defaultValue if the property does not exist
  */
 public String getStringProperty(String name, String defaultValue) {
   return adapter.getStringProperty(name, defaultValue);
 }
Пример #26
0
 public void clearProperties() {
   adapter.clearProperties();
 }
Пример #27
0
 /**
  * Gets the sequence or ordering number for this message in the the correlation group (as defined
  * by the correlationId)
  *
  * @return the sequence number or -1 if the sequence is not important
  */
 public int getCorrelationSequence() {
   return adapter.getCorrelationSequence();
 }
Пример #28
0
 /**
  * Gets a double property from the event
  *
  * @param name the name or key of the property
  * @param defaultValue a default value if the property doesn't exist in the event
  * @return the property value or the defaultValue if the property does not exist
  */
 public double getDoubleProperty(String name, double defaultValue) {
   return adapter.getDoubleProperty(name, defaultValue);
 }
Пример #29
0
 public Object removeProperty(Object key) {
   return adapter.removeProperty(key);
 }
Пример #30
0
 /**
  * Gets the sequence or ordering number for this message in the the correlation group (as defined
  * by the correlationId)
  *
  * @param sequence the sequence number or -1 if the sequence is not important
  */
 public void setCorrelationSequence(int sequence) {
   adapter.setCorrelationSequence(sequence);
 }