org.openanzo.common.jms
Class ActiveMqProvider

java.lang.Object
  extended by org.openanzo.common.jms.ActiveMqProvider
All Implemented Interfaces:
IJmsProvider

public class ActiveMqProvider
extends java.lang.Object
implements IJmsProvider

Implementation of IJmsProvider for the ActiveMQ jms system.

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Field Summary
 
Fields inherited from interface org.openanzo.services.IJmsProvider
SELECTOR_NOT_TRANSACTION_BEGIN, SELECTOR_NOT_TRANSACTION_COMPLETE, SELECTOR_TRANSACTION_BEGIN, SELECTOR_TRANSACTION_COMPLETE
 
Constructor Summary
ActiveMqProvider()
           
 
Method Summary
 void connectProvider(javax.jms.Session session, javax.jms.Destination updateDestination, javax.jms.MessageListener listener)
          Do any provider specific operations in order to finish connecting to provider.
 javax.jms.Destination convertReplyToDestination(javax.jms.Session session, javax.jms.Destination destination)
          Do any provider specific operations that are needed in order to convert a replyToDestination to a Destination object that the provider can send messages.
 java.lang.String convertSelectorString(java.lang.String selector)
          Do any provider specific operations in order to make a selector string valid for the provider
 javax.jms.Destination convertStringToDestination(javax.jms.Session session, java.lang.String destination)
          Do any provider specific operations that are needed in order to convert a String representation of a Destination to a Destination object that the provider can send messages.
 javax.jms.ConnectionFactory createConnectionFactory(java.util.Properties properties)
          Create a new ActiveMq connection factory.
 void disconnectProvider()
          Do any provider specific operations in order to finish disconnecting from a provider.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActiveMqProvider

public ActiveMqProvider()
Method Detail

createConnectionFactory

public javax.jms.ConnectionFactory createConnectionFactory(java.util.Properties properties)
Create a new ActiveMq connection factory. Defaults to tcp://localhost if jmshost property is not set. will prepend tcp:// if no protocol is set as part of jmshost property.

Specified by:
createConnectionFactory in interface IJmsProvider
Parameters:
properties - Configuration properties for the ConnectionFactory
Returns:
New JMS ConnectionFactory based on the given properties
See Also:
ConnectionFactory

convertReplyToDestination

public javax.jms.Destination convertReplyToDestination(javax.jms.Session session,
                                                       javax.jms.Destination destination)
Description copied from interface: IJmsProvider
Do any provider specific operations that are needed in order to convert a replyToDestination to a Destination object that the provider can send messages.

Specified by:
convertReplyToDestination in interface IJmsProvider
Parameters:
session - Session destination is a member of
destination - Destination to convert
Returns:
Converted/augmented destination

convertSelectorString

public java.lang.String convertSelectorString(java.lang.String selector)
Description copied from interface: IJmsProvider
Do any provider specific operations in order to make a selector string valid for the provider

Specified by:
convertSelectorString in interface IJmsProvider
Parameters:
selector - Selector string to convert
Returns:
converted selector string

convertStringToDestination

public javax.jms.Destination convertStringToDestination(javax.jms.Session session,
                                                        java.lang.String destination)
Description copied from interface: IJmsProvider
Do any provider specific operations that are needed in order to convert a String representation of a Destination to a Destination object that the provider can send messages.

Specified by:
convertStringToDestination in interface IJmsProvider
Parameters:
session - Session destination is a member of
destination - String representation of destination to convert
Returns:
New destination object

connectProvider

public void connectProvider(javax.jms.Session session,
                            javax.jms.Destination updateDestination,
                            javax.jms.MessageListener listener)
                     throws javax.jms.JMSException
Description copied from interface: IJmsProvider
Do any provider specific operations in order to finish connecting to provider. This is called after standard connect code is called.

Specified by:
connectProvider in interface IJmsProvider
Parameters:
session - Session operation is occurring within
updateDestination - The Destination object representing the updateDestination
listener - The messageListener for said connection.
Throws:
javax.jms.JMSException

disconnectProvider

public void disconnectProvider()
                        throws javax.jms.JMSException
Description copied from interface: IJmsProvider
Do any provider specific operations in order to finish disconnecting from a provider. This is called after standard

Specified by:
disconnectProvider in interface IJmsProvider
Throws:
javax.jms.JMSException


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.