Spring AMQP

org.springframework.amqp.rabbit.connection
Class RabbitResourceHolder

java.lang.Object
  extended by org.springframework.transaction.support.ResourceHolderSupport
      extended by org.springframework.amqp.rabbit.connection.RabbitResourceHolder
All Implemented Interfaces:
ResourceHolder

public class RabbitResourceHolder
extends ResourceHolderSupport

Rabbit resource holder, wrapping a RabbitMQ Connection and Channel. RabbitTransactionManager binds instances of this class to the thread, for a given Rabbit ConnectionFactory.

Note: This is an SPI class, not intended to be used by applications.

Author:
Mark Fisher, Dave Syer
See Also:
RabbitTransactionManager, RabbitTemplate

Constructor Summary
RabbitResourceHolder()
          Create a new RabbitResourceHolder that is open for resources to be added.
RabbitResourceHolder(com.rabbitmq.client.Channel channel)
           
 
Method Summary
 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)
           
 boolean isChannelTransactional()
           
 boolean isFrozen()
           
 void rollbackAll()
           
 
Methods inherited from class org.springframework.transaction.support.ResourceHolderSupport
clear, getDeadline, getTimeToLiveInMillis, getTimeToLiveInSeconds, hasTimeout, isOpen, isRollbackOnly, isSynchronizedWithTransaction, isVoid, released, requested, reset, setRollbackOnly, setSynchronizedWithTransaction, setTimeoutInMillis, setTimeoutInSeconds, unbound
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RabbitResourceHolder

public RabbitResourceHolder()
Create a new RabbitResourceHolder that is open for resources to be added.


RabbitResourceHolder

public RabbitResourceHolder(com.rabbitmq.client.Channel channel)
Parameters:
channel - a channel to add
Method Detail

isFrozen

public final boolean isFrozen()

addConnection

public final void addConnection(Connection connection)

addChannel

public final void addChannel(com.rabbitmq.client.Channel channel)

addChannel

public final void addChannel(com.rabbitmq.client.Channel channel,
                             Connection connection)

containsChannel

public boolean containsChannel(com.rabbitmq.client.Channel channel)

getConnection

public Connection getConnection()

getConnection

public Connection getConnection(Class<? extends Connection> connectionType)

getChannel

public com.rabbitmq.client.Channel getChannel()

commitAll

public void commitAll()
               throws AmqpException
Throws:
AmqpException

closeAll

public void closeAll()

addDeliveryTag

public void addDeliveryTag(com.rabbitmq.client.Channel channel,
                           long deliveryTag)

rollbackAll

public void rollbackAll()

isChannelTransactional

public boolean isChannelTransactional()
Returns:
true if the channels in this holder are transactional

Spring AMQP

Copyright © 2011. All Rights Reserved.