public class JMSConnectionSunMQ extends JMSConnection
Methods are implemented to get a connection, as well as queues and topics. The error handling will try to reconnect on given error scenarios.
The warnings and errorcodes reported by Sun Message Queue 4.1 can be found in Appendix A Sun Java System Message Queue 4.1 Developer's Guide for Java Clients: http://docs.sun.com/app/docs/doc/819-7757/aeqgo?a=view
Modifier and Type | Field and Description |
---|---|
static String |
JMS_BROKER_HOST
settings.common.jms.broker:
The JMS broker host contacted by the JMS connection. |
static String |
JMS_BROKER_PORT
settings.common.jms.port:
The port the JMS connection should use. |
static String[] |
RECONNECT_ERRORCODES |
closeHook, connection, connectionLock, CONSUMER_KEY_SEPARATOR, consumers, instance, listeners, producers, session
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Reset the singleton and close the connection by calling super().
|
protected com.sun.messaging.ConnectionFactory |
getConnectionFactory()
Returns a new QueueConnectionFactory.
|
protected javax.jms.Destination |
getDestination(String channelName)
Returns an Queue or a Topic.
|
static JMSConnection |
getInstance()
Intialises an Open Message Queue JMS connection.
|
javax.jms.QueueSession |
getQueueSession()
Provides a QueueSession instance.
|
void |
onException(javax.jms.JMSException e)
Exceptionhandler for the JMSConnection.
|
createQueueBrowser, getConsumerKey, initConnection, reconnect, removeListener, reply, resend, send, sendMessage, setListener, unpack
public static final String[] RECONNECT_ERRORCODES
public static String JMS_BROKER_HOST
public static String JMS_BROKER_PORT
public static JMSConnection getInstance() throws IOFailure
IOFailure
- when connection to JMS broker failedprotected com.sun.messaging.ConnectionFactory getConnectionFactory() throws javax.jms.JMSException
Notice: The return type is explicitly defined with package prefix to avoid name collision with javax.jms.QueueConnectionFactory
getConnectionFactory
in class JMSConnection
javax.jms.JMSException
- If unable to create a QueueConnectionfactory with the necessary properties:
imqConsumerflowLimit set to 1, imqBrokerHostname and imqBrokerHostPort set to the values defined in our settings.protected javax.jms.Destination getDestination(String channelName) throws javax.jms.JMSException
getDestination
in class JMSConnection
channelName
- the name of the queue or topic.javax.jms.JMSException
- If unable to create the destination.public void cleanup()
cleanup
in interface CleanupIF
cleanup
in class JMSConnection
public void onException(javax.jms.JMSException e)
onException
in interface javax.jms.ExceptionListener
onException
in class JMSConnection
e
- an JMSExceptionpublic javax.jms.QueueSession getQueueSession() throws javax.jms.JMSException
JMSConnection
QueueSession
object isen't
available on the generic JMSConnectionFactory
getQueueSession
in class JMSConnection
QueueSession
object connected to the current JMS brokerjavax.jms.JMSException
- Failure to retrieve the QueueBrowser
JMS BrowserCopyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.