dk.netarkivet.common.distribute
Class JMSConnectionSunMQ

java.lang.Object
  extended by dk.netarkivet.common.distribute.JMSConnection
      extended by dk.netarkivet.common.distribute.JMSConnectionSunMQ
All Implemented Interfaces:
CleanupIF

public class JMSConnectionSunMQ
extends JMSConnection

Handles the communication with a Sun JMS broker. Note on Thread-safety: the methods and fields of JMSConnection are not accessed by multiple threads (though JMSConnection itself creates threads). Thus no synchronization is needed on methods and fields of JMSConnection. A shutdown hook is also added, which closes the connection.


Field Summary
 
Fields inherited from class dk.netarkivet.common.distribute.JMSConnection
CONSUMER_KEY_SEPARATOR, instance, log
 
Constructor Summary
protected JMSConnectionSunMQ()
          Override default public constructor.
 
Method Summary
protected  javax.jms.Queue getQueue(java.lang.String queueName)
          Returns an Queue.
protected  javax.jms.QueueConnectionFactory getQueueConnectionFactory()
          Returns a new QueueConnectionFactory.
protected  javax.jms.Topic getTopic(java.lang.String topicName)
          Returns an Topic.
protected  javax.jms.TopicConnectionFactory getTopicConnectionFactory()
          Returns a new TopicConnectionFactory.
 
Methods inherited from class dk.netarkivet.common.distribute.JMSConnection
cleanup, close, getHost, getInstance, getPort, initConnection, removeAllMessages, removeListener, reply, resend, send, sendMessage, setListener, unpack
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMSConnectionSunMQ

protected JMSConnectionSunMQ()
Override default public constructor.

Method Detail

getQueueConnectionFactory

protected javax.jms.QueueConnectionFactory getQueueConnectionFactory()
                                                              throws javax.jms.JMSException
Returns a new QueueConnectionFactory. This is an SunMQ implementation of QueueConnectionFactory. Notice: The return type is explicitly defined with package prefix to avoid name collision with javax.jms.QueueConnectionFactory

Specified by:
getQueueConnectionFactory in class JMSConnection
Returns:
QueueConnectionFactory
Throws:
javax.jms.JMSException

getTopicConnectionFactory

protected javax.jms.TopicConnectionFactory getTopicConnectionFactory()
                                                              throws javax.jms.JMSException
Returns a new TopicConnectionFactory. This is an SunMQ implementation of TopicConnectionFactory. Notice: The return type is explicitly defined with package prefix to avoid name collision with javax.jms.TopicConnectionFactory

Specified by:
getTopicConnectionFactory in class JMSConnection
Returns:
TopicConnectionFactory
Throws:
javax.jms.JMSException

getQueue

protected javax.jms.Queue getQueue(java.lang.String queueName)
                            throws javax.jms.JMSException
Returns an Queue. This is an SunMQ implementation of Queue. If no queue exists a new one will be created.

Specified by:
getQueue in class JMSConnection
Parameters:
queueName - the name of the queue.
Returns:
Queue
Throws:
javax.jms.JMSException

getTopic

protected javax.jms.Topic getTopic(java.lang.String topicName)
                            throws javax.jms.JMSException
Returns an Topic. This is an SunMQ implementation of Topic. If no topic exists a new one will be created.

Specified by:
getTopic in class JMSConnection
Parameters:
topicName - the name of the topic.
Returns:
Topic
Throws:
javax.jms.JMSException