Class RabbitAccessor
java.lang.Object
org.springframework.amqp.rabbit.connection.RabbitAccessor
- All Implemented Interfaces:
InitializingBean
- Direct Known Subclasses:
AbstractMessageListenerContainer,RabbitTemplate
- Author:
- Mark Fisher, Dave Syer, Gary Russell
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected RuntimeExceptionprotected ConnectionCreate a RabbitMQ Connection via this template's ConnectionFactory and its host and port values.protected com.rabbitmq.client.ChannelgetChannel(RabbitResourceHolder holder) Fetch an appropriate Channel from the given RabbitResourceHolder.protected ConnectiongetConnection(RabbitResourceHolder holder) Fetch an appropriate Connection from the given RabbitResourceHolder.protected RabbitResourceHolderbooleanvoidsetChannelTransacted(boolean transactional) Flag to indicate that channels created by this component will be transactional.voidsetConnectionFactory(ConnectionFactory connectionFactory) Set the ConnectionFactory to use for obtaining RabbitMQConnections.
-
Field Details
-
logger
Logger available to subclasses.
-
-
Constructor Details
-
RabbitAccessor
public RabbitAccessor()
-
-
Method Details
-
isChannelTransacted
public boolean isChannelTransacted() -
setChannelTransacted
public void setChannelTransacted(boolean transactional) Flag to indicate that channels created by this component will be transactional.- Parameters:
transactional- the flag value to set
-
setConnectionFactory
Set the ConnectionFactory to use for obtaining RabbitMQConnections.- Parameters:
connectionFactory- The connection factory.
-
getConnectionFactory
- Returns:
- The ConnectionFactory that this accessor uses for obtaining RabbitMQ
Connections.
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceInitializingBean
-
createConnection
Create a RabbitMQ Connection via this template's ConnectionFactory and its host and port values.- Returns:
- the new RabbitMQ Connection
- See Also:
-
getConnection
Fetch an appropriate Connection from the given RabbitResourceHolder.- Parameters:
holder- the RabbitResourceHolder- Returns:
- an appropriate Connection fetched from the holder, or
nullif none found
-
getChannel
Fetch an appropriate Channel from the given RabbitResourceHolder.- Parameters:
holder- the RabbitResourceHolder- Returns:
- an appropriate Channel fetched from the holder, or
nullif none found
-
getTransactionalResourceHolder
-
convertRabbitAccessException
-