Spring AMQP

org.springframework.amqp.config
Class AbstractAmqpConfiguration

java.lang.Object
  extended by org.springframework.amqp.config.AbstractAmqpConfiguration
All Implemented Interfaces:
ApplicationContextAware, Lifecycle, Phased, SmartLifecycle
Direct Known Subclasses:
AbstractRabbitConfiguration

@Configuration
public abstract class AbstractAmqpConfiguration
extends Object
implements ApplicationContextAware, SmartLifecycle

Abstract base class for code based configuration of Spring managed AMQP infrastructure, i.e. Exchanges, Queues, and Bindings.

Subclasses are required to provide an implementation of AmqpAdmin and randomNameQueueDefinition.

There are several convenience 'declare' methods to make the configuration in subclasses more terse and readable.

The BindingBuilder class can be used to provide a fluent API to declare bindings.

Author:
Mark Pollack, Mark Fisher
See Also:
AbstractExhange, Queue, Binding, BindingBuilder

Field Summary
protected  AmqpAdmin amqpAdmin
           
 
Constructor Summary
AbstractAmqpConfiguration()
           
 
Method Summary
abstract  AmqpAdmin amqpAdmin()
           
 DirectExchange defaultExchange()
          Provides convenient access to the default exchange which is always declared on the broker.
 int getPhase()
           
 boolean isAutoStartup()
           
 boolean isRunning()
           
 void setApplicationContext(ApplicationContext applicationContext)
           
 void start()
           
 void stop()
           
 void stop(Runnable callback)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

amqpAdmin

protected volatile AmqpAdmin amqpAdmin
Constructor Detail

AbstractAmqpConfiguration

public AbstractAmqpConfiguration()
Method Detail

amqpAdmin

@Bean
public abstract AmqpAdmin amqpAdmin()

defaultExchange

public DirectExchange defaultExchange()
Provides convenient access to the default exchange which is always declared on the broker.


setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
Specified by:
setApplicationContext in interface ApplicationContextAware

isAutoStartup

public boolean isAutoStartup()
Specified by:
isAutoStartup in interface SmartLifecycle

isRunning

public boolean isRunning()
Specified by:
isRunning in interface Lifecycle

start

public void start()
Specified by:
start in interface Lifecycle

stop

public void stop()
Specified by:
stop in interface Lifecycle

stop

public void stop(Runnable callback)
Specified by:
stop in interface SmartLifecycle

getPhase

public int getPhase()
Specified by:
getPhase in interface Phased

Spring AMQP

Copyright © 2010. All Rights Reserved.