1 17 package org.apache.servicemix.components.util; 18 19 import org.springframework.beans.factory.InitializingBean; 20 21 import javax.jbi.messaging.MessageExchange; 22 import javax.jbi.messaging.MessagingException; 23 import javax.jbi.messaging.NormalizedMessage; 24 25 31 public class TransformComponent extends TransformComponentSupport implements InitializingBean { 32 private MessageTransformer transformer; 33 34 public void afterPropertiesSet() throws Exception { 35 if (transformer == null) { 36 throw new IllegalArgumentException ("Must specify a transformer property"); 37 } 38 } 39 40 public MessageTransformer getTransformer() { 41 return transformer; 42 } 43 44 public void setTransformer(MessageTransformer transformer) { 45 this.transformer = transformer; 46 } 47 48 protected boolean transform(MessageExchange exchange, NormalizedMessage in, NormalizedMessage out) throws MessagingException { 49 return transformer.transform(exchange, in, out); 50 } 51 } 52 | Popular Tags |