1 17 package org.apache.servicemix.tck; 18 19 import javax.jbi.messaging.MessageExchange; 20 import javax.jbi.messaging.MessagingException; 21 import javax.jbi.messaging.NormalizedMessage; 22 import javax.xml.namespace.QName ; 23 24 import org.apache.servicemix.MessageExchangeListener; 25 import org.apache.servicemix.components.util.ComponentSupport; 26 27 30 public class ReceiverComponent extends ComponentSupport implements MessageExchangeListener, Receiver { 31 32 public static final QName SERVICE = new QName ("http://servicemix.org/example/", "receiver"); 33 public static final String ENDPOINT = "receiver"; 34 35 private MessageList messageList = new MessageList(); 36 37 public ReceiverComponent() { 38 super(SERVICE, ENDPOINT); 39 } 40 41 public void onMessageExchange(MessageExchange exchange) throws MessagingException { 44 NormalizedMessage inMessage = getInMessage(exchange); 45 NormalizedMessage copyMessage = exchange.createMessage(); 48 getMessageTransformer().transform(exchange, inMessage, copyMessage); 49 messageList.addMessage(copyMessage); 50 done(exchange); 51 } 52 53 public MessageList getMessageList() { 56 return messageList; 57 } 58 } 59 | Popular Tags |