Spring AMQP

org.springframework.amqp.rabbit.support
Class RabbitAccessor

java.lang.Object
  extended by org.springframework.amqp.rabbit.support.RabbitAccessor
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
AbstractRabbitListeningContainer, RabbitTemplate

public abstract class RabbitAccessor
extends Object
implements InitializingBean

Author:
Mark Fisher

Field Summary
protected  org.apache.commons.logging.Log logger
          Logger available to subclasses
 
Constructor Summary
RabbitAccessor()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  AmqpException convertRabbitAccessException(Exception ex)
           
protected  com.rabbitmq.client.Channel createChannel(com.rabbitmq.client.Connection con)
          Create a RabbitMQ Channel for the given Connection.
protected  com.rabbitmq.client.Connection createConnection()
          Create a RabbitMQ Connection via this template's ConnectionFactory and its host and port values.
 ConnectionFactory getConnectionFactory()
          Return the ConnectionFactory that this accessor uses for obtaining RabbitMQ Connections.
 boolean isChannelTransacted()
          Return whether the RabbitMQ channels used by this accessor are supposed to be transacted.
 void setChannelTransacted(boolean channelTransacted)
          Set the transaction mode that is used for a RabbitMQ Channel, Default is "false".
 void setConnectionFactory(ConnectionFactory connectionFactory)
          Set the ConnectionFactory to use for obtaining RabbitMQ Connections.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Logger available to subclasses

Constructor Detail

RabbitAccessor

public RabbitAccessor()
Method Detail

setConnectionFactory

public void setConnectionFactory(ConnectionFactory connectionFactory)
Set the ConnectionFactory to use for obtaining RabbitMQ Connections.


getConnectionFactory

public ConnectionFactory getConnectionFactory()
Return the ConnectionFactory that this accessor uses for obtaining RabbitMQ Connections.


setChannelTransacted

public void setChannelTransacted(boolean channelTransacted)
Set the transaction mode that is used for a RabbitMQ Channel, Default is "false".


isChannelTransacted

public boolean isChannelTransacted()
Return whether the RabbitMQ channels used by this accessor are supposed to be transacted.

See Also:
setChannelTransacted(boolean)

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface InitializingBean

createConnection

protected com.rabbitmq.client.Connection createConnection()
                                                   throws IOException
Create a RabbitMQ Connection via this template's ConnectionFactory and its host and port values.

Returns:
the new RabbitMQ Connection
Throws:
IOException - if thrown by RabbitMQ API methods
See Also:
ConnectionFactory#newConnection(String, int)

createChannel

protected com.rabbitmq.client.Channel createChannel(com.rabbitmq.client.Connection con)
                                             throws IOException
Create a RabbitMQ Channel for the given Connection.

Parameters:
con - the RabbitMQ Connection to create a Channel for
Returns:
the new RabbitMQ Channel
Throws:
IOException - if thrown by RabbitMQ API methods

convertRabbitAccessException

protected AmqpException convertRabbitAccessException(Exception ex)

Spring AMQP

Copyright © 2010. All Rights Reserved.