Interface SessionFactory


public interface SessionFactory
Factory for Sessions.
Author:
harald
  • Method Details

    • getInstance

      static SessionFactory getInstance()
      The singleton.
      Returns:
      the singleton
    • create

      Session create()
      Creates a session with the default session info.
      Returns:
      the open session
    • create

      Session create(SessionInfo sessionInfo)
      Creates a session.
      Parameters:
      sessionInfo - the session info
      Returns:
      the open session
    • create

      Session create(SessionPool sessionPool, SessionInfo sessionInfo)
      Creates a session for a pool.
      Notice that this method is provided for SessionPool implementations only. Applications must use SessionProvider.getSession() instead.
      Parameters:
      sessionPool - the pool requesting a new session
      sessionInfo - the session info
      Returns:
      the open session
    • registerGlobalCloseHandler

      boolean registerGlobalCloseHandler(SessionCloseHandler closeHandler)
      Registers a global close handler for all sessions.
      Parameters:
      closeHandler - the handler
      Returns:
      true if added, false if already registered
    • unregisterGlobalCloseHandler

      boolean unregisterGlobalCloseHandler(SessionCloseHandler closeHandler)
      Unregisters a global close handler for all sessions.
      Parameters:
      closeHandler - the handler
      Returns:
      true if removed, false if not registered