public abstract class RabbitAccessor extends Object implements org.springframework.beans.factory.InitializingBean
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
logger
Logger available to subclasses.
|
Constructor and Description |
---|
RabbitAccessor() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected RuntimeException |
convertRabbitAccessException(Exception ex) |
protected Connection |
createConnection()
Create a RabbitMQ Connection via this template's ConnectionFactory and its host and port values.
|
protected com.rabbitmq.client.Channel |
getChannel(RabbitResourceHolder holder)
Fetch an appropriate Channel from the given RabbitResourceHolder.
|
protected Connection |
getConnection(RabbitResourceHolder holder)
Fetch an appropriate Connection from the given RabbitResourceHolder.
|
ConnectionFactory |
getConnectionFactory() |
protected RabbitResourceHolder |
getTransactionalResourceHolder() |
boolean |
isChannelTransacted() |
void |
setChannelTransacted(boolean transactional)
Flag to indicate that channels created by this component will be transactional.
|
void |
setConnectionFactory(ConnectionFactory connectionFactory)
Set the ConnectionFactory to use for obtaining RabbitMQ
Connections . |
protected final org.apache.commons.logging.Log logger
public boolean isChannelTransacted()
public void setChannelTransacted(boolean transactional)
transactional
- the flag value to setpublic final void setConnectionFactory(ConnectionFactory connectionFactory)
Connections
.connectionFactory
- The connection factory.public ConnectionFactory getConnectionFactory()
Connections
.public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
protected Connection createConnection() throws IOException
IOException
- if thrown by RabbitMQ API methodsConnectionFactory.createConnection()
protected Connection getConnection(RabbitResourceHolder holder)
holder
- the RabbitResourceHoldernull
if none foundprotected com.rabbitmq.client.Channel getChannel(RabbitResourceHolder holder)
holder
- the RabbitResourceHoldernull
if none foundprotected RabbitResourceHolder getTransactionalResourceHolder()
protected RuntimeException convertRabbitAccessException(Exception ex)