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
Direct Known Subclasses:
LocallyExposedRabbitResourceHolder

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
See Also:
(not yet implemented), RabbitTemplate

Constructor Summary
RabbitResourceHolder()
          Create a new RabbitResourceHolder that is open for resources to be added.
RabbitResourceHolder(com.rabbitmq.client.Channel channel)
          Create a new RabbitResourceHolder for the given Rabbit Channel.
RabbitResourceHolder(com.rabbitmq.client.Connection connection, com.rabbitmq.client.Channel channel)
          Create a new RabbitResourceHolder for the given Rabbit resources.
RabbitResourceHolder(ConnectionFactory connectionFactory)
          Create a new RabbitResourceHolder that is open for resources to be added.
RabbitResourceHolder(ConnectionFactory connectionFactory, com.rabbitmq.client.Connection connection, com.rabbitmq.client.Channel channel)
          Create a new RabbitResourceHolder for the given Rabbit resources.
 
Method Summary
 void addChannel(com.rabbitmq.client.Channel channel)
           
 void addChannel(com.rabbitmq.client.Channel channel, com.rabbitmq.client.Connection connection)
           
 void addConnection(com.rabbitmq.client.Connection connection)
           
 void closeAll()
           
 void commitAll()
           
 boolean containsChannel(com.rabbitmq.client.Channel channel)
           
 com.rabbitmq.client.Channel getChannel()
           
 com.rabbitmq.client.Channel getChannel(Class<? extends com.rabbitmq.client.Channel> channelType)
           
 com.rabbitmq.client.Channel getChannel(Class<? extends com.rabbitmq.client.Channel> channelType, com.rabbitmq.client.Connection connection)
           
 com.rabbitmq.client.Connection getConnection()
           
 com.rabbitmq.client.Connection getConnection(Class<? extends com.rabbitmq.client.Connection> connectionType)
           
 boolean isFrozen()
           
 
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.

See Also:
addConnection(com.rabbitmq.client.Connection), addChannel(com.rabbitmq.client.Channel)

RabbitResourceHolder

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

Parameters:
connectionFactory - the Rabbit ConnectionFactory that this resource holder is associated with (may be null)

RabbitResourceHolder

public RabbitResourceHolder(com.rabbitmq.client.Channel channel)
Create a new RabbitResourceHolder for the given Rabbit Channel.

Parameters:
channel - the Rabbit Channel

RabbitResourceHolder

public RabbitResourceHolder(com.rabbitmq.client.Connection connection,
                            com.rabbitmq.client.Channel channel)
Create a new RabbitResourceHolder for the given Rabbit resources.

Parameters:
connection - the Rabbit Connection
channel - the Rabbit Channel

RabbitResourceHolder

public RabbitResourceHolder(ConnectionFactory connectionFactory,
                            com.rabbitmq.client.Connection connection,
                            com.rabbitmq.client.Channel channel)
Create a new RabbitResourceHolder for the given Rabbit resources.

Parameters:
connectionFactory - the Rabbit ConnectionFactory that this resource holder is associated with (may be null)
connection - the Rabbit Connection
channel - the Rabbit Channel
Method Detail

isFrozen

public final boolean isFrozen()

addConnection

public final void addConnection(com.rabbitmq.client.Connection connection)

addChannel

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

addChannel

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

containsChannel

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

getConnection

public com.rabbitmq.client.Connection getConnection()

getConnection

public com.rabbitmq.client.Connection getConnection(Class<? extends com.rabbitmq.client.Connection> connectionType)

getChannel

public com.rabbitmq.client.Channel getChannel()

getChannel

public com.rabbitmq.client.Channel getChannel(Class<? extends com.rabbitmq.client.Channel> channelType)

getChannel

public com.rabbitmq.client.Channel getChannel(Class<? extends com.rabbitmq.client.Channel> channelType,
                                              com.rabbitmq.client.Connection connection)

commitAll

public void commitAll()
               throws IOException
Throws:
IOException

closeAll

public void closeAll()

Spring AMQP

Copyright © 2010. All Rights Reserved.