Class DelegatingSessionFactory<F>

java.lang.Object
org.springframework.integration.file.remote.session.DelegatingSessionFactory<F>
Type Parameters:
F - the target system file type.
All Implemented Interfaces:
SessionFactory<F>

public class DelegatingSessionFactory<F> extends Object implements SessionFactory<F>
SessionFactory that delegates to a SessionFactory retrieved from a SessionFactoryLocator.
Since:
4.2
Author:
Gary Russell
  • Constructor Details

    • DelegatingSessionFactory

      public DelegatingSessionFactory(Map<Object,SessionFactory<F>> factories, SessionFactory<F> defaultFactory)
      Construct an instance with a DefaultSessionFactoryLocator using the supplied factories and default key.
      Parameters:
      factories - the factories.
      defaultFactory - the default to use if the lookup fails.
    • DelegatingSessionFactory

      public DelegatingSessionFactory(SessionFactoryLocator<F> factoryLocator)
      Construct an instance using the supplied factory.
      Parameters:
      factoryLocator - the factory.
  • Method Details

    • getFactoryLocator

      public SessionFactoryLocator<F> getFactoryLocator()
      Return this factory's locator.
      Returns:
      the locator.
    • setThreadKey

      public void setThreadKey(Object key)
      Set a key to be used for getSession() on this thread.
      Parameters:
      key - the key.
    • clearThreadKey

      public void clearThreadKey()
      Clear the key for this thread.
    • setThreadKey

      public Message<?> setThreadKey(Message<?> message, Object key)
      Messaging-friendly version of setThreadKey(Object) that can be invoked from a service activator.
      Parameters:
      message - the message.
      key - the key.
      Returns:
      the message (unchanged).
    • clearThreadKey

      public Message<?> clearThreadKey(Message<?> message)
      Messaging-friendly version of clearThreadKey() that can be invoked from a service activator.
      Parameters:
      message - the message.
      Returns:
      the message (unchanged).
    • getSession

      public Session<F> getSession()
      Specified by:
      getSession in interface SessionFactory<F>
    • getSession

      public Session<F> getSession(Object key)