Interface ConnectionFactory
-
- All Known Implementing Classes:
AbstractConnectionFactory
,AbstractRoutingConnectionFactory
,CachingConnectionFactory
,LocalizedQueueConnectionFactory
,PooledChannelConnectionFactory
,SimpleRoutingConnectionFactory
,ThreadChannelConnectionFactory
public interface ConnectionFactory
An interface based ConnectionFactory for creatingConnections
.NOTE: The Rabbit API contains a ConnectionFactory class (same name).
- Author:
- Mark Fisher, Dave Syer, Gary Russell
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addConnectionListener(ConnectionListener listener)
void
clearConnectionListeners()
Connection
createConnection()
java.lang.String
getHost()
int
getPort()
default ConnectionFactory
getPublisherConnectionFactory()
Return a separate connection factory for publishers (if implemented).java.lang.String
getUsername()
java.lang.String
getVirtualHost()
default boolean
isPublisherConfirms()
Return true if publisher confirms are enabled.default boolean
isPublisherReturns()
Return true if publisher returns are enabled.default boolean
isSimplePublisherConfirms()
Return true if simple publisher confirms are enabled.boolean
removeConnectionListener(ConnectionListener listener)
default void
resetConnection()
Close any connection(s) that might be cached by this factory.
-
-
-
Method Detail
-
createConnection
Connection createConnection() throws AmqpException
- Throws:
AmqpException
-
getHost
java.lang.String getHost()
-
getPort
int getPort()
-
getVirtualHost
java.lang.String getVirtualHost()
-
getUsername
java.lang.String getUsername()
-
addConnectionListener
void addConnectionListener(ConnectionListener listener)
-
removeConnectionListener
boolean removeConnectionListener(ConnectionListener listener)
-
clearConnectionListeners
void clearConnectionListeners()
-
getPublisherConnectionFactory
@Nullable default ConnectionFactory getPublisherConnectionFactory()
Return a separate connection factory for publishers (if implemented).- Returns:
- the publisher connection factory, or null.
- Since:
- 2.0.2
-
isSimplePublisherConfirms
default boolean isSimplePublisherConfirms()
Return true if simple publisher confirms are enabled.- Returns:
- simplePublisherConfirms
- Since:
- 2.1
-
isPublisherConfirms
default boolean isPublisherConfirms()
Return true if publisher confirms are enabled.- Returns:
- publisherConfirms.
- Since:
- 2.1
-
isPublisherReturns
default boolean isPublisherReturns()
Return true if publisher returns are enabled.- Returns:
- publisherReturns.
- Since:
- 2.1
-
resetConnection
default void resetConnection()
Close any connection(s) that might be cached by this factory. This does not prevent new connections from being opened.- Since:
- 2.4.4
-
-