Class DelegatingSessionFactory<F>
java.lang.Object
org.springframework.integration.file.remote.session.DelegatingSessionFactory<F>
- All Implemented Interfaces:
SessionFactory<F>
public class DelegatingSessionFactory<F> extends Object implements SessionFactory<F>
- Since:
- 4.2
- Author:
- Gary Russell
-
Constructor Summary
Constructors Constructor Description DelegatingSessionFactory(Map<Object,SessionFactory<F>> factories, SessionFactory<F> defaultFactory)
Construct an instance with aDefaultSessionFactoryLocator
using the supplied factories and default key.DelegatingSessionFactory(SessionFactoryLocator<F> factoryLocator)
Construct an instance using the supplied factory. -
Method Summary
Modifier and Type Method Description void
clearThreadKey()
Clear the key for this thread.Message<?>
clearThreadKey(Message<?> message)
Messaging-friendly version ofclearThreadKey()
that can be invoked from a service activator.SessionFactoryLocator<F>
getFactoryLocator()
Return this factory's locator.Session<F>
getSession()
Session<F>
getSession(Object key)
void
setThreadKey(Object key)
Set a key to be used forgetSession()
on this thread.Message<?>
setThreadKey(Message<?> message, Object key)
Messaging-friendly version ofsetThreadKey(Object)
that can be invoked from a service activator.
-
Constructor Details
-
DelegatingSessionFactory
public DelegatingSessionFactory(Map<Object,SessionFactory<F>> factories, SessionFactory<F> defaultFactory)Construct an instance with aDefaultSessionFactoryLocator
using the supplied factories and default key.- Parameters:
factories
- the factories.defaultFactory
- the default to use if the lookup fails.
-
DelegatingSessionFactory
Construct an instance using the supplied factory.- Parameters:
factoryLocator
- the factory.
-
-
Method Details
-
getFactoryLocator
Return this factory's locator.- Returns:
- the locator.
-
setThreadKey
Set a key to be used forgetSession()
on this thread.- Parameters:
key
- the key.
-
clearThreadKey
public void clearThreadKey()Clear the key for this thread. -
setThreadKey
Messaging-friendly version ofsetThreadKey(Object)
that can be invoked from a service activator.- Parameters:
message
- the message.key
- the key.- Returns:
- the message (unchanged).
-
clearThreadKey
Messaging-friendly version ofclearThreadKey()
that can be invoked from a service activator.- Parameters:
message
- the message.- Returns:
- the message (unchanged).
-
getSession
- Specified by:
getSession
in interfaceSessionFactory<F>
-
getSession
-