org.nakedobjects.runtime.persistence
Interface PersistenceSession

All Superinterfaces:
Component, DebugInfo, Injectable, NakedObjectTransactionManagerAware, PersistenceSessionAdaptedServiceManager, PersistenceSessionContainer, PersistenceSessionForceReloader, PersistenceSessionHydrator, PersistenceSessionTestSupport, PersistenceSessionTransactionManagement, SessionScopedComponent, SpecificationLoaderAware
All Known Implementing Classes:
PersistenceSessionAbstract, PersistenceSessionLogger, PersistenceSessionObjectStore

public interface PersistenceSession
extends PersistenceSessionContainer, PersistenceSessionForceReloader, PersistenceSessionAdaptedServiceManager, PersistenceSessionTransactionManagement, PersistenceSessionHydrator, PersistenceSessionTestSupport, SpecificationLoaderAware, NakedObjectTransactionManagerAware, SessionScopedComponent, Injectable, DebugInfo


Method Summary
 void close()
           
 AdapterFactory getAdapterFactory()
          The configured AdapterFactory.
 AdapterManager getAdapterManager()
          The configured AdapterManager.
 ObjectFactory getObjectFactory()
          The configured ObjectFactory.
 OidGenerator getOidGenerator()
          The configured OidGenerator.
 PersistenceSessionFactory getPersistenceSessionFactory()
          The PersistenceSessionFactory that created this PersistenceSession.
 ServicesInjector getServicesInjector()
          The configured ServicesInjector.
 NakedObjectTransactionManager getTransactionManager()
          The configured NakedObjectTransactionManager.
 boolean isFixturesInstalled()
          Determine if the object store has been initialized with its set of start up objects.
 void open()
           
 void setSpecificationLoader(SpecificationLoader specificationLoader)
          Inject the SpecificationLoader.
 void setTransactionManager(NakedObjectTransactionManager transactionManager)
          Inject the NakedObjectTransactionManager.
 
Methods inherited from interface org.nakedobjects.runtime.persistence.PersistenceSessionContainer
createInstance, destroyObject, findInstances, findInstances, hasInstances, loadObject, makePersistent, objectChanged, resolveField, resolveImmediately
 
Methods inherited from interface org.nakedobjects.runtime.persistence.PersistenceSessionForceReloader
reload
 
Methods inherited from interface org.nakedobjects.runtime.persistence.PersistenceSessionAdaptedServiceManager
getService, getServices
 
Methods inherited from interface org.nakedobjects.runtime.persistence.PersistenceSessionTransactionManagement
clearAllDirty, objectChangedAllDirty, reload
 
Methods inherited from interface org.nakedobjects.runtime.persistence.PersistenceSessionHydrator
recreateAdapter, recreateAdapter
 
Methods inherited from interface org.nakedobjects.metamodel.commons.component.Injectable
injectInto
 
Methods inherited from interface org.nakedobjects.runtime.persistence.PersistenceSessionTestSupport
testReset
 
Methods inherited from interface org.nakedobjects.metamodel.commons.debug.DebugInfo
debugData, debugTitle
 

Method Detail

getPersistenceSessionFactory

PersistenceSessionFactory getPersistenceSessionFactory()
The PersistenceSessionFactory that created this PersistenceSession.


open

void open()
Specified by:
open in interface SessionScopedComponent

close

void close()
Specified by:
close in interface SessionScopedComponent

isFixturesInstalled

boolean isFixturesInstalled()
Determine if the object store has been initialized with its set of start up objects.

This method is called only once after the ApplicationScopedComponent.init() has been called. If this flag returns false the framework will run the fixtures to initialise the persistor.


getOidGenerator

OidGenerator getOidGenerator()
The configured OidGenerator.


getAdapterFactory

AdapterFactory getAdapterFactory()
The configured AdapterFactory.

Returns:

getObjectFactory

ObjectFactory getObjectFactory()
The configured ObjectFactory.


getServicesInjector

ServicesInjector getServicesInjector()
The configured ServicesInjector.


getAdapterManager

AdapterManager getAdapterManager()
The configured AdapterManager.


setTransactionManager

void setTransactionManager(NakedObjectTransactionManager transactionManager)
Inject the NakedObjectTransactionManager.

This must be injected using setter-based injection rather than through the constructor because there is a bidirectional relationship between the PersistenceSessionHydrator and the NakedObjectTransactionManager.

Specified by:
setTransactionManager in interface NakedObjectTransactionManagerAware
See Also:
getTransactionManager()

getTransactionManager

NakedObjectTransactionManager getTransactionManager()
The configured NakedObjectTransactionManager.

See Also:
setTransactionManager(NakedObjectTransactionManager)

setSpecificationLoader

void setSpecificationLoader(SpecificationLoader specificationLoader)
Inject the SpecificationLoader.

The need to inject the reflector was introduced to support the HibernateObjectStore, which installs its own HibernateClassStrategy to cope with the proxy classes that Hibernate wraps around lists, sets and maps.

Specified by:
setSpecificationLoader in interface SpecificationLoaderAware


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.