com.createtank.elemenope.transports
Class JmsQueueDispatcher

java.lang.Object
  extended by com.createtank.elemenope.DispatcherFailoverImpl
      extended by com.createtank.elemenope.transports.JmsQueueDispatcher
All Implemented Interfaces:
Dispatcher, ElemenopeComponent, ElemenopeConnectionEntity, FailoverDispatcher
Direct Known Subclasses:
SynchronousJmsQueueDispatcher

public class JmsQueueDispatcher
extends DispatcherFailoverImpl

JMS queue implementation of the elemenope Dispatcher interface

For an example configuration, see jms.xml

Author:
John Joseph Roets [joe@createtank.com]

Constructor Summary
JmsQueueDispatcher()
          Creates a new instance of JmsQueueDispatcher
 
Method Summary
 void connect(Connector connector)
          Connects to configured queue.
 java.lang.Object dispatchCallback(java.lang.String operationType, java.lang.Object object)
          Implementation specific sending functionality called from generic failover implmentation.
 java.lang.Object dispatchCallback(java.lang.String operationType, java.lang.Object object, java.util.Map atts)
          Implementation specific sending functionality called from generic failover implmentation.
 java.util.Map getConnectionAttributes()
          gets connectivity attributes
 void releaseComponents()
          Should be called upon shutdown, in order for elemenope component classes clean up after themselves.
 ElemenopeDispatchResponse send(OperationType object)
          Sends TrnasactionType Object through configured Connection entity.
 ElemenopeDispatchResponse send(java.lang.String operationType, java.lang.Object object)
          Sends generic Object through configured Connection entity.
 ElemenopeDispatchResponse send(java.lang.String operationType, java.lang.Object object, java.util.Map atts)
          Sends generic Object through configured Connection entity.
 void setComponents(ElemenopeComponents components)
          Passes all configured components to implementing Object.
 void setConfigurationAttributes(java.util.Map atts)
          sets configuration attributes
 void setConnectionAttributes(java.util.Map atts)
          sets connectivity attributes
 
Methods inherited from class com.createtank.elemenope.DispatcherFailoverImpl
failover, failover, send, send
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmsQueueDispatcher

public JmsQueueDispatcher()
Creates a new instance of JmsQueueDispatcher

Method Detail

setComponents

public void setComponents(ElemenopeComponents components)
Description copied from interface: ElemenopeComponent
Passes all configured components to implementing Object.

Should ususally be called at the end of the initialization cycle, when all components have been instantiated.


setConnectionAttributes

public void setConnectionAttributes(java.util.Map atts)
Description copied from interface: ElemenopeConnectionEntity
sets connectivity attributes

Parameters:
atts - Map of connectivity attributes

connect

public void connect(Connector connector)
             throws ElemenopeConnectionException
Connects to configured queue.

Parameters:
connector -
Throws:
ElemenopeConnectionException

send

public ElemenopeDispatchResponse send(OperationType object)
                               throws ElemenopeException
Description copied from interface: Dispatcher
Sends TrnasactionType Object through configured Connection entity.

Specified by:
send in interface Dispatcher
Overrides:
send in class DispatcherFailoverImpl
Returns:
Throws:
ElemenopeException

send

public ElemenopeDispatchResponse send(java.lang.String operationType,
                                      java.lang.Object object)
                               throws ElemenopeException
Description copied from interface: Dispatcher
Sends generic Object through configured Connection entity.

Specified by:
send in interface Dispatcher
Overrides:
send in class DispatcherFailoverImpl
Parameters:
operationType - configured name of operation to execute.
object - Object to send.
Returns:
ElemenopeDispatchResponse object containing data returned and further information on the dispatch path and DispatcherFailover [DFO] information.
Throws:
ElemenopeException

send

public ElemenopeDispatchResponse send(java.lang.String operationType,
                                      java.lang.Object object,
                                      java.util.Map atts)
                               throws ElemenopeException
Description copied from interface: Dispatcher
Sends generic Object through configured Connection entity.

Specified by:
send in interface Dispatcher
Overrides:
send in class DispatcherFailoverImpl
Parameters:
operationType - configured name of operation to execute.
object - Object to send.
atts - attributes to send along with message if applicable.
Returns:
ElemenopeDispatchResponse object containing data returned and further information on the dispatch path and DispatcherFailover [DFO] information.
Throws:
ElemenopeException

getConnectionAttributes

public java.util.Map getConnectionAttributes()
                                      throws ElemenopeException
Description copied from interface: ElemenopeConnectionEntity
gets connectivity attributes

Returns:
connectivity attributes
Throws:
ElemenopeException

dispatchCallback

public java.lang.Object dispatchCallback(java.lang.String operationType,
                                         java.lang.Object object)
                                  throws ElemenopeException
Description copied from interface: FailoverDispatcher
Implementation specific sending functionality called from generic failover implmentation.

Returns:
Throws:
ElemenopeException

dispatchCallback

public java.lang.Object dispatchCallback(java.lang.String operationType,
                                         java.lang.Object object,
                                         java.util.Map atts)
                                  throws ElemenopeException
Description copied from interface: FailoverDispatcher
Implementation specific sending functionality called from generic failover implmentation.

Parameters:
operationType - Corresponds to JMSType JMS Header
object - Payload of operation
atts - attributes included with payload to direct bpm or other transport specific functionality. Within this implementation, the following attributes are supported:
  • JMSPriority - will set the JMS priority for this message (must be stored as an Integer)
  • JMSCorrelationID - will set the JMS correlation ID for this message (must be stored as a String)
  • JMSCorrelationIDAsBytes - will set the JMS correlation ID for this message with a byte[] value (for use with non-JMS targets - please see JMS documentation for use) (must be stored as a byte[])
  • JMSExpiration - will set the JMS expiration or time-to-live value for this message (must be stored as a Long)
  • Any custom JMS header - will be stored within the message's JMS properties as an Object property.
Returns:
Throws:
ElemenopeException
See Also:
FailoverDispatcher.dispatchCallback(java.lang.String, java.lang.Object)

releaseComponents

public void releaseComponents()
Description copied from interface: ElemenopeComponent
Should be called upon shutdown, in order for elemenope component classes clean up after themselves.


setConfigurationAttributes

public void setConfigurationAttributes(java.util.Map atts)
                                throws ElemenopeException
Description copied from interface: ElemenopeComponent
sets configuration attributes

Parameters:
atts - Map of connectivity attributes
Throws:
ElemenopeException