org.nakedobjects.runtime.persistence
Class PersistenceMechanismInstallerAbstract

java.lang.Object
  extended by org.nakedobjects.runtime.installers.InstallerAbstract
      extended by org.nakedobjects.runtime.persistence.PersistenceMechanismInstallerAbstract
All Implemented Interfaces:
ApplicationScopedComponent, Component, Installer, ConfigurationBuilderAware, InstallerLookupAware, PersistenceMechanismInstaller, PersistenceSessionFactoryDelegate
Direct Known Subclasses:
ObjectStorePersistenceMechanismInstallerAbstract

public abstract class PersistenceMechanismInstallerAbstract
extends InstallerAbstract
implements PersistenceMechanismInstaller, InstallerLookupAware

An abstract implementation of PersistenceMechanismInstaller that will lookup the AdapterFactory and ObjectFactory from the supplied NakedObjectConfiguration.

If none can be found, then will default to the PojoAdapterFactory and ObjectFactoryBasic respectively.


Field Summary
 
Fields inherited from interface org.nakedobjects.runtime.persistence.PersistenceMechanismInstaller
TYPE
 
Constructor Summary
PersistenceMechanismInstallerAbstract(java.lang.String name)
           
PersistenceMechanismInstallerAbstract(java.lang.String type, java.lang.String name)
          For subclasses that need to specify a different type.
 
Method Summary
protected  AdapterFactory createAdapterFactory(NakedObjectConfiguration configuration)
          Hook method to allow subclasses to specify a different implementation of AdapterFactory.
protected  AdapterManagerExtended createAdapterManager(NakedObjectConfiguration configuration)
          Hook method to return AdapterManagerExtended.
protected  DomainObjectContainer createContainer(NakedObjectConfiguration configuration)
          Hook method to return a DomainObjectContainer.
protected  ObjectFactory createObjectFactory(NakedObjectConfiguration configuration)
          Hook method to allow subclasses to specify a different implementation of ObjectFactory.
protected  OidGenerator createOidGenerator(NakedObjectConfiguration configuration)
          Hook method to allow subclasses to specify a different implementation of OidGenerator
 PersistenceSession createPersistenceSession(PersistenceSessionFactory persistenceSessionFactory)
          Creates a PersistenceSession that is initialized with the various hook methods.
protected abstract  PersistenceSession createPersistenceSession(PersistenceSessionFactory persistenceSessionFactory, AdapterManagerExtended adapterManager, AdapterFactory adapterFactory, ObjectFactory objectFactory, OidGenerator oidGenerator, ServicesInjector servicesInjector)
          Mandatory hook method called by createPersistenceSession(PersistenceSessionFactory), passing the components created by the other (optional) hooks.
protected  RuntimeContext createRuntimeContext(NakedObjectConfiguration configuration)
          Hook method to return a RuntimeContext.
protected  ServicesInjector createServicesInjector(NakedObjectConfiguration configuration)
          Hook method to allow subclasses to specify a different implementation of ServicesInjector
protected  InstallerLookup getInstallerLookup()
           
 void setInstallerLookup(InstallerLookup installerLookup)
          By virtue of being InstallerLookupAware.
 
Methods inherited from class org.nakedobjects.runtime.installers.InstallerAbstract
addConfigurationResources, getConfiguration, getConfigurationResources, getName, getType, init, setConfiguration, setConfigurationBuilder, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nakedobjects.runtime.persistence.PersistenceMechanismInstaller
createPersistenceSessionFactory
 
Methods inherited from interface org.nakedobjects.metamodel.commons.component.Installer
getConfigurationResources, getName, getType
 
Methods inherited from interface org.nakedobjects.metamodel.commons.component.ApplicationScopedComponent
init, shutdown
 

Constructor Detail

PersistenceMechanismInstallerAbstract

public PersistenceMechanismInstallerAbstract(java.lang.String name)

PersistenceMechanismInstallerAbstract

public PersistenceMechanismInstallerAbstract(java.lang.String type,
                                             java.lang.String name)
For subclasses that need to specify a different type.

Method Detail

createPersistenceSession

public PersistenceSession createPersistenceSession(PersistenceSessionFactory persistenceSessionFactory)
Creates a PersistenceSession that is initialized with the various hook methods.

Specified by:
createPersistenceSession in interface PersistenceSessionFactoryDelegate
See Also:
createPersistenceSession(PersistenceSessionFactory, AdapterManagerExtended, AdapterFactory, ObjectFactory, OidGenerator, ServicesInjector), createAdapterFactory(NakedObjectConfiguration), createAdapterManager(NakedObjectConfiguration), createContainer(NakedObjectConfiguration), createOidGenerator(NakedObjectConfiguration), createRuntimeContext(NakedObjectConfiguration), createServicesInjector(NakedObjectConfiguration)

createPersistenceSession

protected abstract PersistenceSession createPersistenceSession(PersistenceSessionFactory persistenceSessionFactory,
                                                               AdapterManagerExtended adapterManager,
                                                               AdapterFactory adapterFactory,
                                                               ObjectFactory objectFactory,
                                                               OidGenerator oidGenerator,
                                                               ServicesInjector servicesInjector)
Mandatory hook method called by createPersistenceSession(PersistenceSessionFactory), passing the components created by the other (optional) hooks.

See Also:
createPersistenceSession(PersistenceSessionFactory)

createAdapterFactory

protected AdapterFactory createAdapterFactory(NakedObjectConfiguration configuration)
Hook method to allow subclasses to specify a different implementation of AdapterFactory.

By default, looks up implementation from provided NakedObjectConfiguration using PersistenceConstants.ADAPTER_FACTORY_CLASS_NAME. If no implementation is specified, then defaults to .


createObjectFactory

protected ObjectFactory createObjectFactory(NakedObjectConfiguration configuration)
Hook method to allow subclasses to specify a different implementation of ObjectFactory.

By default, looks up implementation from provided NakedObjectConfiguration using PersistenceConstants.OBJECT_FACTORY_CLASS_NAME. If no implementation is specified, then defaults to .


createServicesInjector

protected ServicesInjector createServicesInjector(NakedObjectConfiguration configuration)
Hook method to allow subclasses to specify a different implementation of ServicesInjector

By default, looks up implementation from provided NakedObjectConfiguration using PersistenceConstants.SERVICES_INJECTOR_CLASS_NAME. If no implementation is specified, then defaults to .


createOidGenerator

protected OidGenerator createOidGenerator(NakedObjectConfiguration configuration)
Hook method to allow subclasses to specify a different implementation of OidGenerator

By default, looks up implementation from provided NakedObjectConfiguration using PersistenceConstants.OID_GENERATOR_CLASS_NAME. If no implementation is specified, then defaults to .


createAdapterManager

protected AdapterManagerExtended createAdapterManager(NakedObjectConfiguration configuration)
Hook method to return AdapterManagerExtended.

By default returns an AdapterManagerDefault.


createRuntimeContext

protected RuntimeContext createRuntimeContext(NakedObjectConfiguration configuration)
Hook method to return a RuntimeContext.

By default, returns a RuntimeContextFromSession.


createContainer

protected DomainObjectContainer createContainer(NakedObjectConfiguration configuration)
Hook method to return a DomainObjectContainer.

By default, looks up implementation from provided NakedObjectConfiguration using PersistenceConstants.DOMAIN_OBJECT_CONTAINER_CLASS_NAME. If no implementation is specified, then defaults to .


setInstallerLookup

public void setInstallerLookup(InstallerLookup installerLookup)
By virtue of being InstallerLookupAware.

Specified by:
setInstallerLookup in interface InstallerLookupAware

getInstallerLookup

protected InstallerLookup getInstallerLookup()
See Also:
setInstallerLookup(InstallerLookup)


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