public class RabbitResourceHolder extends ResourceHolderSupport
Note: This is an SPI class, not intended to be used by applications.
RabbitTransactionManager
,
RabbitTemplate
Constructor and Description |
---|
RabbitResourceHolder()
Create a new RabbitResourceHolder that is open for resources to be added.
|
RabbitResourceHolder(com.rabbitmq.client.Channel channel,
boolean releaseAfterCompletion)
Construct an instance for the channel.
|
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(Class<? extends Connection> connectionType)
Deprecated.
Not used.
|
boolean |
isFrozen()
Deprecated.
|
boolean |
isReleaseAfterCompletion()
Whether the resources should be released after transaction completion.
|
void |
rollbackAll() |
void |
setRequeueOnRollback(boolean requeueOnRollback)
Set to true to requeue a message on rollback; default true.
|
clear, getDeadline, getTimeToLiveInMillis, getTimeToLiveInSeconds, hasTimeout, isOpen, isRollbackOnly, isSynchronizedWithTransaction, isVoid, released, requested, reset, resetRollbackOnly, setRollbackOnly, setSynchronizedWithTransaction, setTimeoutInMillis, setTimeoutInSeconds, unbound
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.@Deprecated public final boolean isFrozen()
public boolean isReleaseAfterCompletion()
public void setRequeueOnRollback(boolean requeueOnRollback)
requeueOnRollback
- true to requeuepublic final void addConnection(Connection connection)
public final void addChannel(com.rabbitmq.client.Channel channel)
public final void addChannel(com.rabbitmq.client.Channel channel, @Nullable Connection connection)
public boolean containsChannel(com.rabbitmq.client.Channel channel)
@Nullable public Connection getConnection()
@Deprecated @Nullable public Connection getConnection(Class<? extends Connection> connectionType)
connectionType
- the type.@Nullable public com.rabbitmq.client.Channel getChannel()
public void commitAll() throws AmqpException
AmqpException
public void closeAll()
public void addDeliveryTag(com.rabbitmq.client.Channel channel, long deliveryTag)
public void rollbackAll()