ConnectionFactory implementation that routes
create() calls to one of various target
factories based on a lookup key.
The latter is typically (but not necessarily) determined from some
subscriber context.
Allows to configure a default target ConnectionFactory as a fallback.
Calls to getMetadata() are routed to the
default ConnectionFactory
if configured.
setTargetConnectionFactories, setDefaultTargetConnectionFactory, determineCurrentLookupKey()
| Modifier and Type | Field and Description |
|---|---|
| private ConnectionFactoryLookup | |
| private Object | |
| private static final Object | |
| private boolean | |
| private Map | |
| private ConnectionFactory | |
| private Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | afterPropertiesSet()
Implements org. Delegates to |
| public Mono | |
| protected abstract Mono | Returns: Mono emitting the lookup key. May complete without emitting a value
if no lookup key availableDetermine the current lookup key. |
| protected Mono | |
| public ConnectionFactoryMetadata | getMetadata()
Implements io. Returns the |
| public void | initialize()
Initialize the internal state of this |
| protected ConnectionFactory | resolveSpecifiedConnectionFactory(Object
the connection factory value object as specified in the
connectionFactory)targetConnectionFactories mapResolve the specified connection factory object into a
|
| protected Object | Returns: the lookup key as needed for matching.the lookup key object as specified by the user lookupKey)Resolve the given lookup key object, as specified in the
|
| public void | setConnectionFactoryLookup(ConnectionFactoryLookup connectionFactoryLookup)
Set the |
| public void | setDefaultTargetConnectionFactory(Object defaultTargetConnectionFactory)
Specify the default target |
| public void | setLenientFallback(boolean lenientFallback)
Specify whether to apply a lenient fallback to the default |
| public void | setTargetConnectionFactories(Map<?, ?> targetConnectionFactories)
Specify the map of target |
| connectionFactoryLookup | back to summary |
|---|---|
| private ConnectionFactoryLookup connectionFactoryLookup | |
| defaultTargetConnectionFactory | back to summary |
|---|---|
| private Object defaultTargetConnectionFactory
| |
| FALLBACK_MARKER | back to summary |
|---|---|
| private static final Object FALLBACK_MARKER | |
| lenientFallback | back to summary |
|---|---|
| private boolean lenientFallback | |
| resolvedConnectionFactories | back to summary |
|---|---|
| private Map<Object, ConnectionFactory> resolvedConnectionFactories
| |
| resolvedDefaultConnectionFactory | back to summary |
|---|---|
| private ConnectionFactory resolvedDefaultConnectionFactory
| |
| targetConnectionFactories | back to summary |
|---|---|
| private Map<?, ?> targetConnectionFactories
| |
| AbstractRoutingConnectionFactory | back to summary |
|---|---|
| public AbstractRoutingConnectionFactory() | |
| afterPropertiesSet | back to summary |
|---|---|
| public void afterPropertiesSet() Implements org. Delegates to
| |
| create | back to summary |
|---|---|
| public Mono Implements io. Doc from io. Creates a new
| |
| determineCurrentLookupKey | back to summary |
|---|---|
| protected abstract Mono Determine the current lookup key. This will typically be implemented to check a
subscriber context. Allows for arbitrary keys. The returned key needs to match the
stored lookup key type, as resolved by the | |
| determineTargetConnectionFactory | back to summary |
|---|---|
| protected Mono Retrieve the current target
| |
| getMetadata | back to summary |
|---|---|
| public ConnectionFactoryMetadata getMetadata() Implements io. Doc from io. Returns the
| |
| initialize | back to summary |
|---|---|
| public void initialize() Initialize the internal state of this
| |
| resolveSpecifiedConnectionFactory | back to summary |
|---|---|
| protected ConnectionFactory resolveSpecifiedConnectionFactory(Object connectionFactory) throws IllegalArgumentException Resolve the specified connection factory object into a
The default implementation handles
| |
| resolveSpecifiedLookupKey | back to summary |
|---|---|
| protected Object resolveSpecifiedLookupKey(Object lookupKey) Resolve the given lookup key object, as specified in the
The default implementation simply returns the given key as-is. | |
| setConnectionFactoryLookup | back to summary |
|---|---|
| public void setConnectionFactoryLookup(ConnectionFactoryLookup connectionFactoryLookup) Set the | |
| setDefaultTargetConnectionFactory | back to summary |
|---|---|
| public void setDefaultTargetConnectionFactory(Object defaultTargetConnectionFactory) Specify the default target The mapped value can either be a corresponding This | |
| setLenientFallback | back to summary |
|---|---|
| public void setLenientFallback(boolean lenientFallback) Specify whether to apply a lenient fallback to the default Default is Switch this flag to | |
| setTargetConnectionFactories | back to summary |
|---|---|
| public void setTargetConnectionFactories(Map<?, ?> targetConnectionFactories) Specify the map of target The key can be of arbitrary type; this class implements the generic lookup
process only. The concrete key representation will be handled by
| |