Spring AMQP

org.springframework.amqp.rabbit.core
Class RabbitAdmin

java.lang.Object
  extended by org.springframework.amqp.rabbit.core.RabbitAdmin
All Implemented Interfaces:
AmqpAdmin, ApplicationContextAware, Lifecycle, Phased, SmartLifecycle

public class RabbitAdmin
extends Object
implements AmqpAdmin, ApplicationContextAware, SmartLifecycle

RabbitMQ implementation of portable AMQP administrative operations for AMQP >= 0.9.1

Author:
Mark Pollack, Mark Fisher, Dave Syer

Field Summary
protected  org.apache.commons.logging.Log logger
          Logger available to subclasses
 
Constructor Summary
RabbitAdmin(ConnectionFactory connectionFactory)
           
RabbitAdmin(RabbitTemplate rabbitTemplate)
           
 
Method Summary
 void declareBinding(Binding binding)
          Declare a binding of a queue to an exchange.
 void declareExchange(Exchange exchange)
          Declare an exchange
 Queue declareQueue()
          Declares a server-named exclusive, autodelete, non-durable queue.
 void declareQueue(Queue queue)
          Declare the given queue
 boolean deleteExchange(String exchangeName)
          Delete an exchange.
 boolean deleteQueue(String queueName)
          Delete a queue, without regard for whether it is in use or has messages on it
 void deleteQueue(String queueName, boolean unused, boolean empty)
          Delete a queue
 int getPhase()
           
 RabbitTemplate getRabbitTemplate()
           
 boolean isAutoStartup()
           
 boolean isRunning()
           
 void purgeQueue(String queueName, boolean noWait)
          Purges the contents of the given queue.
 void removeBinding(Binding binding)
          Remove a binding of a queue to an exchange.
 void setApplicationContext(ApplicationContext applicationContext)
           
 void setAutoStartup(boolean autoStartup)
           
 void setPhase(int phase)
           
 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

logger

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

Constructor Detail

RabbitAdmin

public RabbitAdmin(ConnectionFactory connectionFactory)

RabbitAdmin

public RabbitAdmin(RabbitTemplate rabbitTemplate)
Method Detail

setAutoStartup

public void setAutoStartup(boolean autoStartup)

setPhase

public void setPhase(int phase)

setApplicationContext

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

getRabbitTemplate

public RabbitTemplate getRabbitTemplate()

declareExchange

public void declareExchange(Exchange exchange)
Description copied from interface: AmqpAdmin
Declare an exchange

Specified by:
declareExchange in interface AmqpAdmin
Parameters:
exchange - the exchange to declare.

deleteExchange

@ManagedOperation
public boolean deleteExchange(String exchangeName)
Description copied from interface: AmqpAdmin
Delete an exchange. Look at implementation specific subclass for implementation specific behavior, for example for RabbitMQ this will delete the exchange without regard for whether it is in use or not.

Specified by:
deleteExchange in interface AmqpAdmin
Parameters:
exchangeName - the name of the exchange
Returns:
true if the exchange existed and was deleted

declareQueue

@ManagedOperation
public void declareQueue(Queue queue)
Description copied from interface: AmqpAdmin
Declare the given queue

Specified by:
declareQueue in interface AmqpAdmin
Parameters:
queue - the queue to declare

declareQueue

@ManagedOperation
public Queue declareQueue()
Declares a server-named exclusive, autodelete, non-durable queue.

Specified by:
declareQueue in interface AmqpAdmin

deleteQueue

@ManagedOperation
public boolean deleteQueue(String queueName)
Description copied from interface: AmqpAdmin
Delete a queue, without regard for whether it is in use or has messages on it

Specified by:
deleteQueue in interface AmqpAdmin
Parameters:
queueName - the name of the queue
Returns:
true if the queue existed and was deleted

deleteQueue

@ManagedOperation
public void deleteQueue(String queueName,
                                         boolean unused,
                                         boolean empty)
Description copied from interface: AmqpAdmin
Delete a queue

Specified by:
deleteQueue in interface AmqpAdmin
Parameters:
queueName - the name of the queue
unused - true if the queue should be deleted only if not in use
empty - true if the queue should be deleted only if empty

purgeQueue

@ManagedOperation
public void purgeQueue(String queueName,
                                        boolean noWait)
Description copied from interface: AmqpAdmin
Purges the contents of the given queue.

Specified by:
purgeQueue in interface AmqpAdmin
Parameters:
queueName - the name of the queue
noWait - true to not await completion of the purge

declareBinding

@ManagedOperation
public void declareBinding(Binding binding)
Description copied from interface: AmqpAdmin
Declare a binding of a queue to an exchange.

Specified by:
declareBinding in interface AmqpAdmin
Parameters:
binding - a description of the binding to declare.

removeBinding

@ManagedOperation
public void removeBinding(Binding binding)
Description copied from interface: AmqpAdmin
Remove a binding of a queue to an exchange. Note unbindQueue/removeBinding was not introduced until 0.9 of the specification.

Specified by:
removeBinding in interface AmqpAdmin
Parameters:
binding - a description of the binding to remove.

isAutoStartup

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

getPhase

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

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

Spring AMQP

Copyright © 2011. All Rights Reserved.