Class DefaultSessionFactoryLocator<F>
java.lang.Object
org.springframework.integration.file.remote.session.DefaultSessionFactoryLocator<F>
- All Implemented Interfaces:
SessionFactoryLocator<F>
public class DefaultSessionFactoryLocator<F> extends java.lang.Object implements SessionFactoryLocator<F>
The default implementation of
SessionFactoryLocator using a simple map lookup
and an optional default to fall back on.- Since:
- 4.2
-
Constructor Summary
Constructors Constructor Description DefaultSessionFactoryLocator(java.util.Map<java.lang.Object,SessionFactory<F>> factories)DefaultSessionFactoryLocator(java.util.Map<java.lang.Object,SessionFactory<F>> factories, SessionFactory<F> defaultFactory) -
Method Summary
Modifier and Type Method Description voidaddSessionFactory(java.lang.Object key, SessionFactory<F> factory)Add a session factory.voidaddSessionFactory(java.lang.String key, SessionFactory<F> factory)Deprecated.since 5.3 in favor ofaddSessionFactory(Object, SessionFactory)SessionFactory<F>getSessionFactory(java.lang.Object key)Return aSessionFactoryfor the key.SessionFactory<F>removeSessionFactory(java.lang.Object key)Remove a session factory.
-
Constructor Details
-
DefaultSessionFactoryLocator
- Parameters:
factories- A map of factories, keyed by lookup key.
-
DefaultSessionFactoryLocator
public DefaultSessionFactoryLocator(java.util.Map<java.lang.Object,SessionFactory<F>> factories, @Nullable SessionFactory<F> defaultFactory)- Parameters:
factories- A map of factories, keyed by lookup key.defaultFactory- A default to be used if the lookup fails.
-
-
Method Details
-
addSessionFactory
Deprecated.since 5.3 in favor ofaddSessionFactory(Object, SessionFactory)Add a session factory.- Parameters:
key- the lookup key.factory- the factory.
-
addSessionFactory
Add a session factory.- Parameters:
key- the lookup key.factory- the factory.- Since:
- 5.3
-
removeSessionFactory
Remove a session factory.- Parameters:
key- the lookup key.- Returns:
- the factory, if it was present.
-
getSessionFactory
Description copied from interface:SessionFactoryLocatorReturn aSessionFactoryfor the key.- Specified by:
getSessionFactoryin interfaceSessionFactoryLocator<F>- Parameters:
key- the key.- Returns:
- the session factory.
-