Spring AMQP

org.springframework.amqp.rabbit.connection
Class AbstractConnectionFactory

java.lang.Object
  extended by org.springframework.amqp.rabbit.connection.AbstractConnectionFactory
All Implemented Interfaces:
ConnectionFactory, DisposableBean
Direct Known Subclasses:
CachingConnectionFactory, SingleConnectionFactory

public abstract class AbstractConnectionFactory
extends Object
implements ConnectionFactory, DisposableBean

Author:
Dave Syer

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
AbstractConnectionFactory(com.rabbitmq.client.ConnectionFactory rabbitConnectionFactory)
          Create a new SingleConnectionFactory for the given target ConnectionFactory.
 
Method Summary
 void addChannelListener(ChannelListener listener)
           
 void addConnectionListener(ConnectionListener listener)
           
protected  Connection createBareConnection()
           
 void destroy()
           
protected  ChannelListener getChannelListener()
          A composite channel listener to be used by subclasses when creating and closing channels.
protected  ConnectionListener getConnectionListener()
          A composite connection listener to be used by subclasses when creating and closing connections.
protected  String getDefaultHostName()
           
 String getHost()
           
 int getPort()
           
 String getVirtualHost()
           
 void setChannelListeners(List<? extends ChannelListener> listeners)
           
 void setConnectionListeners(List<? extends ConnectionListener> listeners)
           
 void setHost(String host)
           
 void setPassword(String password)
           
 void setPort(int port)
           
 void setUsername(String username)
           
 void setVirtualHost(String virtualHost)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.amqp.rabbit.connection.ConnectionFactory
createConnection
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

AbstractConnectionFactory

public AbstractConnectionFactory(com.rabbitmq.client.ConnectionFactory rabbitConnectionFactory)
Create a new SingleConnectionFactory for the given target ConnectionFactory.

Parameters:
rabbitConnectionFactory - the target ConnectionFactory
Method Detail

setUsername

public void setUsername(String username)

setPassword

public void setPassword(String password)

setHost

public void setHost(String host)

getHost

public String getHost()
Specified by:
getHost in interface ConnectionFactory

setVirtualHost

public void setVirtualHost(String virtualHost)

getVirtualHost

public String getVirtualHost()
Specified by:
getVirtualHost in interface ConnectionFactory

setPort

public void setPort(int port)

getPort

public int getPort()
Specified by:
getPort in interface ConnectionFactory

getConnectionListener

protected ConnectionListener getConnectionListener()
A composite connection listener to be used by subclasses when creating and closing connections.

Returns:
the connection listener

getChannelListener

protected ChannelListener getChannelListener()
A composite channel listener to be used by subclasses when creating and closing channels.

Returns:
the channel listener

setConnectionListeners

public void setConnectionListeners(List<? extends ConnectionListener> listeners)

addConnectionListener

public void addConnectionListener(ConnectionListener listener)
Specified by:
addConnectionListener in interface ConnectionFactory

setChannelListeners

public void setChannelListeners(List<? extends ChannelListener> listeners)

addChannelListener

public void addChannelListener(ChannelListener listener)

createBareConnection

protected final Connection createBareConnection()

getDefaultHostName

protected final String getDefaultHostName()

destroy

public void destroy()
Specified by:
destroy in interface DisposableBean

Spring AMQP

Copyright © 2011. All Rights Reserved.