public interface Connection
extends javax.jms.Connection
1. Provide API to create a MQ NO_ACKNOWLEDGE session.
2. Provide API to set the connection event listener.
3. Provide API to query broker adress and HA state.
Modifier and Type | Method and Description |
---|---|
javax.jms.Session |
createSession(int acknowledgeMode)
Creates a
Session object. |
java.lang.String |
getBrokerAddress()
Get the broker's address that the connection is connected (related) to.
|
boolean |
isConnectedToHABroker()
Get the current connection state.
|
void |
removeConsumerEventListener(Destination dest)
Remove a MQ consumer event listener from the current connection.
|
void |
setConsumerEventListener(Destination dest,
EventListener listener)
Set consumer event listener on a destination to the current connection.
|
void |
setEventListener(EventListener listener)
Set MQ connection event listener to the current connection.
|
close, createConnectionConsumer, createDurableConnectionConsumer, createSession, createSession, createSharedConnectionConsumer, createSharedDurableConnectionConsumer, getClientID, getExceptionListener, getMetaData, setClientID, setExceptionListener, start, stop
javax.jms.Session createSession(int acknowledgeMode) throws javax.jms.JMSException
Session
object.createSession
in interface javax.jms.Connection
acknowledgeMode
- indicates whether the consumer or the client will acknowledge any messages it receives; Legal
values are Session.AUTO_ACKNOWLEDGE
, Session.CLIENT_ACKNOWLEDGE
,
Session.DUPS_OK_ACKNOWLEDGE
, and com.sun.messaging.jms.Session.NO_ACKNOWLEDGE
JMSException
- if the Connection
object fails to create a session due to some internal error or
lack of support for the specific transaction and acknowledgement mode.javax.jms.JMSException
Session.AUTO_ACKNOWLEDGE
,
Session.CLIENT_ACKNOWLEDGE
,
Session.DUPS_OK_ACKNOWLEDGE
,
Session.NO_ACKNOWLEDGE
void setEventListener(EventListener listener) throws javax.jms.JMSException
listener
- EventListenerJMSException
javax.jms.JMSException
void setConsumerEventListener(Destination dest, EventListener listener) throws javax.jms.JMSException
dest
- the destination on which consumer event is interestedlistener
- EventListenerJMSException
javax.jms.JMSException
void removeConsumerEventListener(Destination dest) throws javax.jms.JMSException
dest
- the destination on which addConsumerEventListener() was called previouslylistener
- EventListenerJMSException
javax.jms.JMSException
java.lang.String getBrokerAddress()
boolean isConnectedToHABroker()
Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved.