Exemplo n.º 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);
   }
 }
Exemplo n.º 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);
         }
       }
     }
   }
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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();
 }
Exemplo n.º 6
0
 /**
  * Sets the encoding for this message
  *
  * @param encoding the encoding to use
  */
 public void setEncoding(String encoding) {
   adapter.setEncoding(encoding);
 }
Exemplo n.º 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);
 }
Exemplo n.º 8
0
 public void removeAttachment(String name) throws Exception {
   adapter.removeAttachment(name);
 }
Exemplo n.º 9
0
 public Set getAttachmentNames() {
   return adapter.getAttachmentNames();
 }
Exemplo n.º 10
0
 public void setIntProperty(String name, int value) {
   adapter.setIntProperty(name, value);
 }
Exemplo n.º 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);
 }
Exemplo n.º 12
0
 public boolean getBooleanProperty(String name, boolean defaultValue) {
   return adapter.getBooleanProperty(name, defaultValue);
 }
Exemplo n.º 13
0
 public void setBooleanProperty(String name, boolean value) {
   adapter.setBooleanProperty(name, value);
 }
Exemplo n.º 14
0
 public int getIntProperty(String name, int defaultValue) {
   return adapter.getIntProperty(name, defaultValue);
 }
Exemplo n.º 15
0
 public Object getProperty(String name, Object defaultValue) {
   return adapter.getProperty(name, defaultValue);
 }
Exemplo n.º 16
0
 public String getUniqueId() throws UniqueIdNotSupportedException {
   return adapter.getUniqueId();
 }
Exemplo n.º 17
0
 public String toString() {
   return adapter.toString();
 }
Exemplo n.º 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();
 }
Exemplo n.º 19
0
 public void addAttachment(String name, DataHandler dataHandler) throws Exception {
   adapter.addAttachment(name, dataHandler);
 }
Exemplo n.º 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);
 }
Exemplo n.º 21
0
 public DataHandler getAttachment(String name) {
   return adapter.getAttachment(name);
 }
Exemplo n.º 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();
 }
Exemplo n.º 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();
 }
Exemplo n.º 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());
 }
Exemplo n.º 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);
 }
Exemplo n.º 26
0
 public void clearProperties() {
   adapter.clearProperties();
 }
Exemplo n.º 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();
 }
Exemplo n.º 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);
 }
Exemplo n.º 29
0
 public Object removeProperty(Object key) {
   return adapter.removeProperty(key);
 }
Exemplo n.º 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);
 }