1 17 package org.apache.servicemix.components.drools; 18 19 import javax.jbi.messaging.DeliveryChannel; 20 import javax.jbi.messaging.MessageExchange; 21 import javax.jbi.messaging.MessagingException; 22 import javax.jbi.messaging.NormalizedMessage; 23 import javax.xml.namespace.QName ; 24 25 import org.drools.WorkingMemory; 26 27 32 public class JbiHelper { 33 private DroolsComponent component; 34 private MessageExchange exchange; 35 private NormalizedMessage in; 36 private WorkingMemory memory; 37 38 public JbiHelper(DroolsComponent component, 39 MessageExchange exchange, 40 NormalizedMessage in, 41 WorkingMemory memory) { 42 this.component = component; 43 this.exchange = exchange; 44 this.in = in; 45 this.memory = memory; 46 } 47 48 54 public void forwardToService(String uri, String localPart) throws MessagingException { 55 QName service = new QName (uri, localPart); 56 component.forwardToService(exchange, in, service); 57 } 58 59 public void forwardToService(QName name, QName operation, QName interfaceName) throws MessagingException { 60 component.forwardToService(exchange, in, name); 61 } 62 63 public void invoke(QName service, QName operation, QName interfaceName) throws MessagingException { 64 component.invoke(exchange, in, service, interfaceName, operation); 65 } 66 67 public void route(QName service, QName operation, QName interfaceName) throws MessagingException { 68 component.route(exchange, in, service, interfaceName, operation); 69 } 70 71 public DeliveryChannel getDeliveryChannel() throws MessagingException { 72 return getComponent().getContext().getDeliveryChannel(); 73 } 74 75 public DroolsComponent getComponent() { 76 return component; 77 } 78 79 public MessageExchange getExchange() { 80 return exchange; 81 } 82 83 public NormalizedMessage getIn() { 84 return in; 85 } 86 } 87 | Popular Tags |