public class RabbitResourceHolder
extends org.springframework.transaction.support.ResourceHolderSupport
Note: This is an SPI class, not intended to be used by applications.
RabbitTransactionManager,
RabbitTemplate| Modifier and Type | Field and Description |
|---|---|
private java.util.List<com.rabbitmq.client.Channel> |
channels |
private java.util.Map<Connection,java.util.List<com.rabbitmq.client.Channel>> |
channelsPerConnection |
private java.util.List<Connection> |
connections |
private org.springframework.util.MultiValueMap<com.rabbitmq.client.Channel,java.lang.Long> |
deliveryTags |
private boolean |
frozen |
private static org.apache.commons.logging.Log |
logger |
private boolean |
releaseAfterCompletion |
private boolean |
transactional |
| Constructor and Description |
|---|
RabbitResourceHolder()
Create a new RabbitResourceHolder that is open for resources to be added.
|
RabbitResourceHolder(com.rabbitmq.client.Channel channel,
boolean releaseAfterCompletion) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChannel(com.rabbitmq.client.Channel channel) |
void |
addChannel(com.rabbitmq.client.Channel channel,
Connection connection) |
void |
addConnection(Connection connection) |
void |
addDeliveryTag(com.rabbitmq.client.Channel channel,
long deliveryTag) |
void |
closeAll() |
void |
commitAll() |
boolean |
containsChannel(com.rabbitmq.client.Channel channel) |
com.rabbitmq.client.Channel |
getChannel() |
Connection |
getConnection() |
Connection |
getConnection(java.lang.Class<? extends Connection> connectionType) |
boolean |
isChannelTransactional() |
boolean |
isFrozen() |
boolean |
isReleaseAfterCompletion()
Whether the resources should be released after transaction completion.
|
void |
rollbackAll() |
clear, getDeadline, getTimeToLiveInMillis, getTimeToLiveInSeconds, hasTimeout, isOpen, isRollbackOnly, isSynchronizedWithTransaction, isVoid, released, requested, reset, setRollbackOnly, setSynchronizedWithTransaction, setTimeoutInMillis, setTimeoutInSeconds, unboundprivate static final org.apache.commons.logging.Log logger
private final boolean frozen
private final java.util.List<Connection> connections
private final java.util.List<com.rabbitmq.client.Channel> channels
private final java.util.Map<Connection,java.util.List<com.rabbitmq.client.Channel>> channelsPerConnection
private final org.springframework.util.MultiValueMap<com.rabbitmq.client.Channel,java.lang.Long> deliveryTags
private boolean transactional
private boolean releaseAfterCompletion
public RabbitResourceHolder()
public RabbitResourceHolder(com.rabbitmq.client.Channel channel,
boolean releaseAfterCompletion)
channel - a channel to addreleaseAfterCompletion - true if the channel should be released after completion.public final boolean isFrozen()
public boolean isReleaseAfterCompletion()
public final void addConnection(Connection connection)
public final void addChannel(com.rabbitmq.client.Channel channel)
public final void addChannel(com.rabbitmq.client.Channel channel,
Connection connection)
public boolean containsChannel(com.rabbitmq.client.Channel channel)
public Connection getConnection()
public Connection getConnection(java.lang.Class<? extends Connection> connectionType)
public com.rabbitmq.client.Channel getChannel()
public void commitAll()
throws AmqpException
AmqpExceptionpublic void closeAll()
public void addDeliveryTag(com.rabbitmq.client.Channel channel,
long deliveryTag)
public void rollbackAll()
public boolean isChannelTransactional()