org.apache.servicemix.drools.model
Class JbiHelper

java.lang.Object
  extended by org.apache.servicemix.drools.model.JbiHelper

public class JbiHelper
extends Object

A helper class for use inside a rule to forward a message to an endpoint

Version:
$Revision: 426415 $

Constructor Summary
JbiHelper(DroolsEndpoint endpoint, javax.jbi.messaging.MessageExchange exchange, org.drools.WorkingMemory memory)
           
 
Method Summary
 void answer(Source content)
          Answer the exchange with the given response content
 void answer(String content)
           
 void fault(Source content)
          Send a JBI Error message (for InOnly) or JBI Fault message (for the other MEPs)
 void fault(String content)
           
 javax.jbi.messaging.DeliveryChannel getChannel()
           
 javax.jbi.component.ComponentContext getContext()
           
 DroolsEndpoint getEndpoint()
           
 Exchange getExchange()
           
 Log getLogger()
           
 boolean isExchangeHandled()
          Has the MessageExchange been handled by the drools endpoint?
 void route(String uri)
          Forwards the inbound message to the given target
 void routeTo(Source content, String uri)
          Send a message to the uri
 void routeTo(String content, String uri)
           
 void routeToDefault(Source content)
          Send this content to the default routing URI (DroolsEndpoint.getDefaultRouteURI() specified on the endpoint
 void routeToDefault(String content)
           
 void update()
          Update the MessageExchange information in the rule engine's WorkingMemory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JbiHelper

public JbiHelper(DroolsEndpoint endpoint,
                 javax.jbi.messaging.MessageExchange exchange,
                 org.drools.WorkingMemory memory)
Method Detail

getEndpoint

public DroolsEndpoint getEndpoint()

getContext

public javax.jbi.component.ComponentContext getContext()

getChannel

public javax.jbi.messaging.DeliveryChannel getChannel()
                                               throws javax.jbi.messaging.MessagingException
Throws:
javax.jbi.messaging.MessagingException

getExchange

public Exchange getExchange()

getLogger

public Log getLogger()

route

public void route(String uri)
           throws javax.jbi.messaging.MessagingException
Forwards the inbound message to the given target

Parameters:
uri -
Throws:
javax.jbi.messaging.MessagingException

routeTo

public void routeTo(String content,
                    String uri)
             throws javax.jbi.messaging.MessagingException
Throws:
javax.jbi.messaging.MessagingException
See Also:
routeTo(Source, String)

routeTo

public void routeTo(Source content,
                    String uri)
             throws javax.jbi.messaging.MessagingException
Send a message to the uri

Parameters:
content - the message content
uri - the target endpoint's uri
Throws:
javax.jbi.messaging.MessagingException

routeToDefault

public void routeToDefault(String content)
                    throws javax.jbi.messaging.MessagingException
Throws:
javax.jbi.messaging.MessagingException
See Also:
routeToDefault(Source)

routeToDefault

public void routeToDefault(Source content)
                    throws javax.jbi.messaging.MessagingException
Send this content to the default routing URI (DroolsEndpoint.getDefaultRouteURI() specified on the endpoint

Parameters:
content - the message body
Throws:
javax.jbi.messaging.MessagingException

fault

public void fault(String content)
           throws Exception
Throws:
Exception
See Also:
fault(Source)

fault

public void fault(Source content)
           throws Exception
Send a JBI Error message (for InOnly) or JBI Fault message (for the other MEPs)

Parameters:
content - the error content
Throws:
Exception

answer

public void answer(String content)
            throws Exception
Throws:
Exception
See Also:
answer(Source)

answer

public void answer(Source content)
            throws Exception
Answer the exchange with the given response content

Parameters:
content - the response
Throws:
Exception

update

public void update()
Update the MessageExchange information in the rule engine's WorkingMemory


isExchangeHandled

public boolean isExchangeHandled()
Has the MessageExchange been handled by the drools endpoint?

Returns:


Copyright © 2005-2009 The Apache Software Foundation. All Rights Reserved.