예제 #1
0
 protected UMOMessage aggregateEvents(EventGroup events) throws RoutingException {
   StringBuffer newPayload = new StringBuffer();
   UMOEvent event = null;
   for (Iterator iterator = events.getEvents().iterator(); iterator.hasNext(); ) {
     event = (UMOEvent) iterator.next();
     try {
       newPayload.append(event.getMessageAsString()).append(" ");
     } catch (UMOException e) {
       throw new RoutingException(event.getMessage(), event.getEndpoint(), e);
     }
   }
   return new MuleMessage(newPayload.toString(), event.getProperties());
 }
예제 #2
0
 /**
  * Returns the message contents as a string
  *
  * @return the message contents as a string
  * @throws org.mule.umo.UMOException if the message cannot be converted into a string
  */
 public String getMessageAsString() throws UMOException {
   return event.getMessageAsString();
 }