public class ConnectionManager extends Object
| Constructor and Description |
|---|
ConnectionManager(XAConnectionFactory xaConnectionFactory,
String user,
String pass) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Create JMS connection.
|
void |
connectAndAccept(XAResourceConsumer consumer)
Invoke
XAResourceConsumer accept method before making sure that JMS connection is available. |
<T> T |
connectAndApply(XAResourceFunction<T> function)
Invoke
XAResourceFunction apply method before making sure that JMS connection is available. |
void |
disconnect()
Close current JMS connection.
|
boolean |
isConnected()
Check if JMS connection is active.
|
public void connectAndAccept(XAResourceConsumer consumer) throws XAException
XAResourceConsumer accept method before making sure that JMS connection is available. Current
connection is used if one is available. If connection is not available, new connection is created before the
accept call and closed after it.consumer - XAResourceConsumer to be executed.XAException - if JMS connection cannot be created.public <T> T connectAndApply(XAResourceFunction<T> function) throws XAException
XAResourceFunction apply method before making sure that JMS connection is available. Current
connection is used if one is available. If connection is not available, new connection is created before the
apply call and closed after it.T - Return type of the XAResourceFunction.function - XAResourceFunction to be executed.XAResourceFunction.XAException - if JMS connection cannot be created.public void connect()
throws XAException
XAException - if JMS connection cannot be created.public void disconnect()
public boolean isConnected()
true if JMS connection is active.Copyright © 2019 JBoss by Red Hat. All rights reserved.