org.nakedobjects.runtime.system
Class NakedObjectsSystemAbstract

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

public abstract class NakedObjectsSystemAbstract
extends java.lang.Object
implements NakedObjectsSystem


Field Summary
static org.apache.log4j.Logger LOG
           
 
Constructor Summary
NakedObjectsSystemAbstract(DeploymentType deploymentType)
           
NakedObjectsSystemAbstract(DeploymentType deploymentType, NakedObjectsLocaleInitializer localeInitializer, NakedObjectsTimeZoneInitializer timeZoneInitializer)
           
 
Method Summary
 DebugInfo debugSection(java.lang.String selectionName)
           
 java.lang.String[] debugSectionNames()
           
protected abstract  NakedObjectSessionFactory doCreateSessionFactory(DeploymentType deploymentType)
          Hook method; the returned implementation is expected to use the same general approach as the subclass itself.
abstract  NakedObjectConfiguration getConfiguration()
          Returns a snapshot of the configuration (although once the NakedObjectsSystem is completely initialized, will effectively be immutable).
 DeploymentType getDeploymentType()
           
 FixturesInstaller getFixturesInstaller()
           
 LogonFixture getLogonFixture()
          The LogonFixture, if any, obtained by running fixtures.
 NakedObjectSessionFactory getSessionFactory()
          Populated after init().
 void init()
           
protected abstract  AuthenticationManager obtainAuthenticationManager(DeploymentType deploymentType)
           
protected abstract  FixturesInstaller obtainFixturesInstaller()
          This is the only Installer that is used by any (all) subclass implementations, because it effectively is the component we need (as opposed to a builder/factory of the component we need).
protected abstract  PersistenceSessionFactory obtainPersistenceSessionFactory(DeploymentType deploymentType)
           
protected abstract  NakedObjectReflector obtainReflector(DeploymentType deploymentType)
           
protected abstract  java.util.List<java.lang.Object> obtainServices()
           
protected  TemplateImageLoader obtainTemplateImageLoader()
          Just returns a TemplateImageLoaderAwt; subclasses may override if required.
protected abstract  UserProfileStore obtainUserProfileStore()
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.log4j.Logger LOG
Constructor Detail

NakedObjectsSystemAbstract

public NakedObjectsSystemAbstract(DeploymentType deploymentType)

NakedObjectsSystemAbstract

public NakedObjectsSystemAbstract(DeploymentType deploymentType,
                                  NakedObjectsLocaleInitializer localeInitializer,
                                  NakedObjectsTimeZoneInitializer timeZoneInitializer)
Method Detail

getDeploymentType

public DeploymentType getDeploymentType()
Specified by:
getDeploymentType in interface NakedObjectsSystem

init

public void init()
Specified by:
init in interface ApplicationScopedComponent

shutdown

public void shutdown()
Specified by:
shutdown in interface ApplicationScopedComponent

doCreateSessionFactory

protected abstract NakedObjectSessionFactory doCreateSessionFactory(DeploymentType deploymentType)
                                                             throws NakedObjectSystemException
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.

Throws:
NakedObjectSystemException

getSessionFactory

public NakedObjectSessionFactory getSessionFactory()
Populated after init().

Specified by:
getSessionFactory in interface NakedObjectsSystem

getConfiguration

public abstract NakedObjectConfiguration getConfiguration()
Description copied from interface: NakedObjectsSystem
Returns a snapshot of the configuration (although once the NakedObjectsSystem is completely initialized, will effectively be immutable).

Specified by:
getConfiguration in interface NakedObjectsSystem

obtainTemplateImageLoader

protected TemplateImageLoader obtainTemplateImageLoader()
Just returns a TemplateImageLoaderAwt; subclasses may override if required.


obtainReflector

protected abstract NakedObjectReflector obtainReflector(DeploymentType deploymentType)
                                                 throws NakedObjectSystemException
Throws:
NakedObjectSystemException

obtainPersistenceSessionFactory

protected abstract PersistenceSessionFactory obtainPersistenceSessionFactory(DeploymentType deploymentType)
                                                                      throws NakedObjectSystemException
Throws:
NakedObjectSystemException

obtainFixturesInstaller

protected abstract FixturesInstaller obtainFixturesInstaller()
                                                      throws NakedObjectSystemException
This is the only Installer that is used by any (all) subclass implementations, because it effectively is the component we need (as opposed to a builder/factory of the component we need).

The fact that the component is an installer (and therefore can be InstallerLookup looked up} is at this level really just an incidental implementation detail useful for the subclass that uses InstallerLookup to create the other components.

Throws:
NakedObjectSystemException

obtainAuthenticationManager

protected abstract AuthenticationManager obtainAuthenticationManager(DeploymentType deploymentType)
                                                              throws NakedObjectSystemException
Throws:
NakedObjectSystemException

obtainUserProfileStore

protected abstract UserProfileStore obtainUserProfileStore()

obtainServices

protected abstract java.util.List<java.lang.Object> obtainServices()

getFixturesInstaller

public FixturesInstaller getFixturesInstaller()

getLogonFixture

public LogonFixture getLogonFixture()
The LogonFixture, if any, obtained by running fixtures.

Intended to be used when for exploration (instead of an ExplorationSession) or prototype deployments (saves logging in). Should be ignored in other DeploymentTypes.

Specified by:
getLogonFixture in interface NakedObjectsSystem

debugSection

public DebugInfo debugSection(java.lang.String selectionName)
Specified by:
debugSection in interface DebugSelection

debugSectionNames

public java.lang.String[] debugSectionNames()
Specified by:
debugSectionNames in interface DebugSelection


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