1 10 11 package org.mule.providers.rmi; 12 13 import org.mule.providers.AbstractMessageAdapter; 14 import org.mule.umo.provider.MessageTypeNotSupportedException; 15 16 19 20 public class RmiMessageAdapter extends AbstractMessageAdapter 21 { 22 25 private static final long serialVersionUID = -1765089871661318129L; 26 27 private final Object message; 28 29 public RmiMessageAdapter(Object message) throws MessageTypeNotSupportedException 30 { 31 if (message == null) 32 { 33 throw new MessageTypeNotSupportedException(null, getClass()); 34 } 35 this.message = message; 36 } 37 38 public byte[] getPayloadAsBytes() throws Exception 39 { 40 return convertToBytes(getPayload()); 41 } 42 43 51 public String getPayloadAsString(String encoding) throws Exception 52 { 53 return message.toString(); 54 } 55 56 public Object getPayload() 57 { 58 return message; 59 } 60 } 61 | Popular Tags |