org.apache.tuscany.sca.binding.jms.provider
Class RRBJMSBindingInvoker

java.lang.Object
  extended by org.apache.tuscany.sca.binding.jms.provider.RRBJMSBindingInvoker
All Implemented Interfaces:
DataExchangeSemantics, Invoker

public class RRBJMSBindingInvoker
extends java.lang.Object
implements Invoker, DataExchangeSemantics

Invoker for the JMS binding.


Field Summary
protected  Destination bindingReplyDest
           
protected  Destination bindingRequestDest
           
protected  JMSBinding jmsBinding
           
protected  JMSResourceFactory jmsResourceFactory
           
protected  Operation operation
           
protected  java.lang.String operationName
           
protected  RuntimeComponentReference reference
           
protected  JMSMessageProcessor requestMessageProcessor
           
protected  JMSMessageProcessor responseMessageProcessor
           
protected  RuntimeWire runtimeWire
           
 
Constructor Summary
RRBJMSBindingInvoker(JMSBinding jmsBinding, Operation operation, JMSResourceFactory jmsResourceFactory, RuntimeComponentReference reference)
           
 
Method Summary
 boolean allowsPassByReference()
          Indicate if the data can be passed in by reference as they won't be mutated.
protected  Destination getReplyToDestination(Session session)
           
protected  Destination getRequestDestination(Message tuscanyMsg, Session session)
           
 Message invoke(Message tuscanyMsg)
          Process a synchronous wire
protected  Destination lookupDestination()
          Looks up the Destination Queue for the JMS Binding
protected  Destination lookupDestinationQueue(boolean isReponseQueue)
          Looks up the Destination Queue for the JMS Binding.
protected  Destination lookupResponseDestination()
          Looks up the Destination Response Queue for the JMS Binding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

operation

protected Operation operation

operationName

protected java.lang.String operationName

jmsBinding

protected JMSBinding jmsBinding

jmsResourceFactory

protected JMSResourceFactory jmsResourceFactory

requestMessageProcessor

protected JMSMessageProcessor requestMessageProcessor

responseMessageProcessor

protected JMSMessageProcessor responseMessageProcessor

bindingRequestDest

protected Destination bindingRequestDest

bindingReplyDest

protected Destination bindingReplyDest

reference

protected RuntimeComponentReference reference

runtimeWire

protected RuntimeWire runtimeWire
Constructor Detail

RRBJMSBindingInvoker

public RRBJMSBindingInvoker(JMSBinding jmsBinding,
                            Operation operation,
                            JMSResourceFactory jmsResourceFactory,
                            RuntimeComponentReference reference)
Method Detail

lookupDestination

protected Destination lookupDestination()
                                 throws javax.naming.NamingException,
                                        JMSBindingException
Looks up the Destination Queue for the JMS Binding

Returns:
The Destination Queue
Throws:
javax.naming.NamingException - Failed to lookup Destination Queue
JMSBindingException - Failed to lookup Destination Queue
See Also:
lookupDestinationQueue(boolean)

lookupResponseDestination

protected Destination lookupResponseDestination()
                                         throws javax.naming.NamingException,
                                                JMSBindingException
Looks up the Destination Response Queue for the JMS Binding

Returns:
The Destination Response Queue
Throws:
javax.naming.NamingException - Failed to lookup Destination Response Queue
JMSBindingException - Failed to lookup Destination Response Queue
See Also:
lookupDestinationQueue(boolean)

lookupDestinationQueue

protected Destination lookupDestinationQueue(boolean isReponseQueue)
                                      throws javax.naming.NamingException,
                                             JMSBindingException
Looks up the Destination Queue for the JMS Binding.

What happens in the look up will depend on the create mode specified for the JMS Binding:

See the SCA JMS Binding specification for more information.

Parameters:
isReponseQueue - true if we are creating a response queue. false if we are creating a request queue
Returns:
The Destination queue.
Throws:
javax.naming.NamingException - Failed to lookup JMS queue
JMSBindingException - Failed to lookup JMS Queue. Probable cause is that the JMS queue's current existence/non-existence is not compatible with the create mode specified on the binding

invoke

public Message invoke(Message tuscanyMsg)
Description copied from interface: Invoker
Process a synchronous wire

Specified by:
invoke in interface Invoker
Parameters:
tuscanyMsg - The request Message for the wire
Returns:
The response Message from the wire

getRequestDestination

protected Destination getRequestDestination(Message tuscanyMsg,
                                            Session session)
                                     throws JMSBindingException,
                                            javax.naming.NamingException,
                                            JMSException
Throws:
JMSBindingException
javax.naming.NamingException
JMSException

getReplyToDestination

protected Destination getReplyToDestination(Session session)
                                     throws JMSException,
                                            JMSBindingException,
                                            javax.naming.NamingException
Throws:
JMSException
JMSBindingException
javax.naming.NamingException

allowsPassByReference

public boolean allowsPassByReference()
Description copied from interface: DataExchangeSemantics
Indicate if the data can be passed in by reference as they won't be mutated.

Specified by:
allowsPassByReference in interface DataExchangeSemantics
Returns:
true if pass-by-reference is allowed