## org.springframework.orm.toplink
Class AbstractSessionFactory

    java.lang.Object
      org.springframework.orm.toplink.AbstractSessionFactory

All Implemented Interfaces:
  SessionFactory

Direct Known Subclasses:
  ServerSessionFactory, SessionBrokerSessionFactory

    public abstract class AbstractSessionFactory

extends Object
implements SessionFactory

Abstract SessionFactory implementation that creates proxies for "managed" client Sessions and transaction-aware Session references.

Delegates to two template methods:

Since:
  1.2.6
Author:
  Juergen Hoeller
See Also:
  `getMasterSession()`, `createClientSession()`

Field Summary
`protected Log` `logger` Logger available to subclasses

Constructor Summary
`AbstractSessionFactory()`

Method Summary
`protected abstract oracle.toplink.sessions.Session` `createClientSession()` Create a new client Session for this factory's master Session.
`oracle.toplink.sessions.Session` `createManagedClientSession()` Create a "managed" client Session reference for an underlying client Session created for this factory.
`oracle.toplink.sessions.Session` `createSession()` Create a plain client Session for this factory's master Session.
`oracle.toplink.sessions.Session` `createTransactionAwareSession()` Create a transaction-aware Session reference for this factory's master Session, expecting transactions to be registered for this SessionFactory.
`oracle.toplink.sessions.Session` `createTransactionAwareSession(SessionFactory sessionFactory)` Create a transaction-aware Session reference for this factory's master Session, expecting transactions to be registered for the given SessionFactory.
`protected abstract oracle.toplink.sessions.Session` `getMasterSession()` Return this factory's "master" Session.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.springframework.orm.toplink.SessionFactory
`close`

Field Detail

### logger

    protected final Log logger

  Logger available to subclasses

Constructor Detail

### AbstractSessionFactory

    public AbstractSessionFactory()

Method Detail

### createSession

    public oracle.toplink.sessions.Session createSession()
                                                  throws oracle.toplink.exceptions.TopLinkException

  Create a plain client Session for this factory's master Session.

  Specified by:
    `createSession` in interface `SessionFactory`
  Returns:
    the new TopLink Session
  Throws:
    `oracle.toplink.exceptions.TopLinkException` - in case of errors
  See Also:
    `createClientSession()`

### createManagedClientSession

    public oracle.toplink.sessions.Session createManagedClientSession()
                                                               throws oracle.toplink.exceptions.TopLinkException

  Create a "managed" client Session reference for an underlying client Session created for this factory.

  Specified by:
    `createManagedClientSession` in interface `SessionFactory`
  Returns:
    the new TopLink Session
  Throws:
    `oracle.toplink.exceptions.TopLinkException` - in case of errors
  See Also:
    `createClientSession()`

### createTransactionAwareSession

    public oracle.toplink.sessions.Session createTransactionAwareSession()
                                                                  throws oracle.toplink.exceptions.TopLinkException

  Create a transaction-aware Session reference for this factory's master Session, expecting transactions to be registered for this SessionFactory.

  Specified by:
    `createTransactionAwareSession` in interface `SessionFactory`
  Returns:
    the new TopLink Session
  Throws:
    `oracle.toplink.exceptions.TopLinkException` - in case of errors
  See Also:
    `getMasterSession()`, `Session.getActiveSession()`, `Session.getActiveUnitOfWork()`

### createTransactionAwareSession

    public oracle.toplink.sessions.Session createTransactionAwareSession(SessionFactory sessionFactory)
                                                                  throws oracle.toplink.exceptions.TopLinkException

  Create a transaction-aware Session reference for this factory's master Session, expecting transactions to be registered for the given SessionFactory.

  This method is public to allow custom SessionFactory facades to access it directly, if necessary.

  Parameters:
    `sessionFactory` - the SessionFactory that transactions are expected to be registered for
  Throws:
    `oracle.toplink.exceptions.TopLinkException`
  See Also:
    `getMasterSession()`, `Session.getActiveSession()`, `Session.getActiveUnitOfWork()`

### getMasterSession

    protected abstract oracle.toplink.sessions.Session getMasterSession()

  Return this factory's "master" Session. For example, a TopLink ServerSession.

  Used for creating transaction-aware Session reference.

### createClientSession

    protected abstract oracle.toplink.sessions.Session createClientSession()
                                                                    throws oracle.toplink.exceptions.TopLinkException

  Create a new client Session for this factory's master Session. For example, a TopLink ClientSession.

  Used for creating plain Sessions and "managed" client Sessions.

  Throws:
    `oracle.toplink.exceptions.TopLinkException` - if creation of a client Session failed

Copyright © 2002-2008 The Spring Framework.