org.nakedobjects.runtime.system
Class NakedObjectsSystemSimple

java.lang.Object
  extended by org.nakedobjects.runtime.system.NakedObjectsSystemAbstract
      extended by org.nakedobjects.runtime.system.NakedObjectsSystemSimple
All Implemented Interfaces:
ApplicationScopedComponent, Component, DebugSelection, NakedObjectsSystem

public abstract class NakedObjectsSystemSimple
extends NakedObjectsSystemAbstract

A simple implementation of NakedObjectsSystem, intended for use by Spring (dependency injection) or for testing.

Constructor injection is used for non-defaulted, mandatory components. Setter-based injection can be used for components that will otherwise by defaulted or are optional.


Field Summary
 
Fields inherited from class org.nakedobjects.runtime.system.NakedObjectsSystemAbstract
LOG
 
Constructor Summary
NakedObjectsSystemSimple(DeploymentType deploymentType, NakedObjectConfiguration configuration)
          Dependency injection of NakedObjectConfiguration.
 
Method Summary
protected abstract  NakedObjectSessionFactory doCreateSessionFactory(DeploymentType deploymentType)
          Hook method; the returned implementation is expected to use the same general approach as the subclass itself.
 NakedObjectConfiguration getConfiguration()
          As specified in the constructor.
 NakedObjectReflector getReflector()
           
 TemplateImageLoader getTemplateImageLoader()
           
protected  AuthenticationManager obtainAuthenticationManager(DeploymentType deploymentType)
          The AuthenticationManager, if any.
protected  FixturesInstaller obtainFixturesInstaller()
          The FixturesInstaller, if any.
protected  PersistenceSessionFactory obtainPersistenceSessionFactory(DeploymentType deploymentType)
          The injected PersistenceSessionFactory.
protected  NakedObjectReflector obtainReflector(DeploymentType deploymentType)
          The injected NakedObjectReflector.
protected  java.util.List<java.lang.Object> obtainServices()
           
protected  TemplateImageLoader obtainTemplateImageLoader()
          The TemplateImageLoader, if any.
protected  UserProfileStore obtainUserProfileStore()
           
 void setAuthenticationManager(AuthenticationManager authenticationManager)
          Optionally specify the AuthenticationManager.
 void setFixturesInstaller(FixturesInstaller installer)
          Optionally specify the FixturesInstaller.
 void setPersistenceSessionFactory(PersistenceSessionFactory persistenceSessionFactory)
           
 void setReflector(NakedObjectReflector reflector)
           
 void setServiceList(java.util.List<java.lang.Object> serviceList)
           
 void setTemplateImageLoader(TemplateImageLoader templateImageLoader)
          Optionally specify the TemplateImageLoader.
 void setUserProfileStore(UserProfileStore userProfileStore)
           
 
Methods inherited from class org.nakedobjects.runtime.system.NakedObjectsSystemAbstract
debugSection, debugSectionNames, getDeploymentType, getFixturesInstaller, getLogonFixture, getSessionFactory, init, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NakedObjectsSystemSimple

public NakedObjectsSystemSimple(DeploymentType deploymentType,
                                NakedObjectConfiguration configuration)
Dependency injection of NakedObjectConfiguration. All other components are either optional or defaulted.

Method Detail

doCreateSessionFactory

protected abstract NakedObjectSessionFactory doCreateSessionFactory(DeploymentType deploymentType)
                                                             throws NakedObjectSystemException
Description copied from class: NakedObjectsSystemAbstract
Hook method; the returned implementation is expected to use the same general approach as the subclass itself.

So, for example, NakedObjectsSystemUsingInstallers uses the InstallerLookup mechanism to find its components. The corresponding ExecutionContextFactoryUsingInstallers object returned by this method should use InstallerLookup likewise.

Specified by:
doCreateSessionFactory in class NakedObjectsSystemAbstract
Throws:
NakedObjectSystemException

getConfiguration

public NakedObjectConfiguration getConfiguration()
As specified in the constructor.

Specified by:
getConfiguration in interface NakedObjectsSystem
Specified by:
getConfiguration in class NakedObjectsSystemAbstract

obtainAuthenticationManager

protected AuthenticationManager obtainAuthenticationManager(DeploymentType deploymentType)
The AuthenticationManager, if any.

Specified by:
obtainAuthenticationManager in class NakedObjectsSystemAbstract

setAuthenticationManager

public void setAuthenticationManager(AuthenticationManager authenticationManager)
Optionally specify the AuthenticationManager.

It will otherwise be null.


obtainFixturesInstaller

protected FixturesInstaller obtainFixturesInstaller()
The FixturesInstaller, if any.

Specified by:
obtainFixturesInstaller in class NakedObjectsSystemAbstract

setFixturesInstaller

public void setFixturesInstaller(FixturesInstaller installer)
Optionally specify the FixturesInstaller.

It will otherwise be null.


obtainTemplateImageLoader

protected TemplateImageLoader obtainTemplateImageLoader()
The TemplateImageLoader, if any.

Overrides:
obtainTemplateImageLoader in class NakedObjectsSystemAbstract

setTemplateImageLoader

public void setTemplateImageLoader(TemplateImageLoader templateImageLoader)
Optionally specify the TemplateImageLoader.

It will otherwise be defaulted.


getTemplateImageLoader

public TemplateImageLoader getTemplateImageLoader()

obtainReflector

protected NakedObjectReflector obtainReflector(DeploymentType deploymentType)
                                        throws NakedObjectSystemException
The injected NakedObjectReflector.

Specified by:
obtainReflector in class NakedObjectsSystemAbstract
Throws:
NakedObjectSystemException
See Also:
setReflector(NakedObjectReflector)

setReflector

public void setReflector(NakedObjectReflector reflector)

getReflector

public NakedObjectReflector getReflector()

obtainPersistenceSessionFactory

protected PersistenceSessionFactory obtainPersistenceSessionFactory(DeploymentType deploymentType)
                                                             throws NakedObjectSystemException
The injected PersistenceSessionFactory.

Specified by:
obtainPersistenceSessionFactory in class NakedObjectsSystemAbstract
Throws:
NakedObjectSystemException
See Also:
setPersistenceSessionFactory(PersistenceSessionFactory)

setPersistenceSessionFactory

public void setPersistenceSessionFactory(PersistenceSessionFactory persistenceSessionFactory)

setUserProfileStore

public void setUserProfileStore(UserProfileStore userProfileStore)

obtainUserProfileStore

protected UserProfileStore obtainUserProfileStore()
Specified by:
obtainUserProfileStore in class NakedObjectsSystemAbstract

setServiceList

public void setServiceList(java.util.List<java.lang.Object> serviceList)

obtainServices

protected java.util.List<java.lang.Object> obtainServices()
Specified by:
obtainServices in class NakedObjectsSystemAbstract


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