예제 #1
0
 public DefaultMuleMessage(Object message, MessageAdapter previous) {
   if (message instanceof MessageAdapter) {
     adapter = (MessageAdapter) message;
     ((ThreadSafeAccess) adapter).resetAccessControl();
   } else {
     adapter = new DefaultMessageAdapter(message, previous);
   }
   if (previous.getExceptionPayload() != null) {
     setExceptionPayload(previous.getExceptionPayload());
   }
   setEncoding(previous.getEncoding());
   if (previous.getAttachmentNames().size() > 0) {
     Set<String> attNames = adapter.getAttachmentNames();
     for (String s : attNames) {
       try {
         addAttachment(s, adapter.getAttachment(s));
       } catch (Exception e) {
         throw new MuleRuntimeException(CoreMessages.failedToReadAttachment(s), e);
       }
     }
   }
   resetAccessControl();
 }
예제 #2
0
 /** {@inheritDoc} */
 public String getEncoding() {
   return adapter.getEncoding();
 }