org.nakedobjects.runtime.system.installers
Class NakedObjectsSystemUsingInstallers

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

public class NakedObjectsSystemUsingInstallers
extends NakedObjectsSystemAbstract


Field Summary
static org.apache.log4j.Logger LOG
           
 
Constructor Summary
NakedObjectsSystemUsingInstallers(DeploymentType deploymentType, InstallerLookup installerLookup)
           
 
Method Summary
protected  NakedObjectSessionFactory createSessionFactory(DeploymentType deploymentType, UserProfileLoader userProfileLoader, PersistenceSessionFactory persistenceSessionFactory)
          Overloaded version designed to be called by subclasses that need to explicitly specify different persistence mechanisms.
 NakedObjectSessionFactory doCreateSessionFactory(DeploymentType deploymentType)
          Hook method; the returned implementation is expected to use the same general approach as the subclass itself.
 NakedObjectConfiguration getConfiguration()
          Returns a snapshot of the configuration held by the installer lookup.
 InstallerLookup getInstallerLookup()
          As per constructor.
 void lookupAndSetAuthenticatorAndAuthorization(boolean isProduction)
           
 void lookupAndSetFixturesInstaller()
           
 void lookupAndSetUserProfileFactoryInstaller()
           
protected  AuthenticationManager obtainAuthenticationManager(DeploymentType deploymentType)
           
protected  AuthorizationManager obtainAuthorizationManager(DeploymentType deploymentType)
           
protected  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  PersistenceSessionFactory obtainPersistenceSessionFactory(DeploymentType deploymentType)
           
protected  NakedObjectReflector obtainReflector(DeploymentType deploymentType)
           
protected  java.util.List<java.lang.Object> obtainServices()
           
protected  TemplateImageLoader obtainTemplateImageLoader()
          Uses the TemplateImageLoader configured in InstallerLookup, if available, else falls back to that of the superclass.
protected  UserProfileStore obtainUserProfileStore()
           
 void setAuthenticationInstaller(AuthenticationManagerInstaller authenticationManagerInstaller)
          Set the type of connection to used to access the server.
 void setAuthorizationInstaller(AuthorizationManagerInstaller authorizationManagerInstaller)
          Set the type of connection to used to access the server.
 void setFixtureInstaller(FixturesInstaller fixtureInstaller)
           
 void setPersistenceMechanismInstaller(PersistenceMechanismInstaller persistenceMechanismInstaller)
           
 void setReflectorInstaller(NakedObjectReflectorInstaller reflectorInstaller)
           
 void setServicesInstaller(ServicesInstaller servicesInstaller)
           
 void setUserProfileStoreInstaller(UserProfileStoreInstaller userProfilestoreInstaller)
           
 
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
 

Field Detail

LOG

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

NakedObjectsSystemUsingInstallers

public NakedObjectsSystemUsingInstallers(DeploymentType deploymentType,
                                         InstallerLookup installerLookup)
Method Detail

getInstallerLookup

public InstallerLookup getInstallerLookup()
As per constructor.


doCreateSessionFactory

public 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

createSessionFactory

protected final NakedObjectSessionFactory createSessionFactory(DeploymentType deploymentType,
                                                               UserProfileLoader userProfileLoader,
                                                               PersistenceSessionFactory persistenceSessionFactory)
                                                        throws NakedObjectSystemException
Overloaded version designed to be called by subclasses that need to explicitly specify different persistence mechanisms.

This is not a hook method, rather it is designed to be called from the hook method.

Throws:
NakedObjectSystemException

getConfiguration

public NakedObjectConfiguration getConfiguration()
Returns a snapshot of the configuration held by the installer lookup.

Specified by:
getConfiguration in interface NakedObjectsSystem
Specified by:
getConfiguration in class NakedObjectsSystemAbstract
See Also:
InstallerLookup.getConfiguration()

lookupAndSetAuthenticatorAndAuthorization

public void lookupAndSetAuthenticatorAndAuthorization(boolean isProduction)

setAuthenticationInstaller

public void setAuthenticationInstaller(AuthenticationManagerInstaller authenticationManagerInstaller)
Set the type of connection to used to access the server.

Note that the NakedObjectSessionFactoryUsingInstallers also checks the ClientConnectionInstaller twice over: to see if a PersistenceSessionProxy should be used as a persistor, and for any FacetDecoratorInstallers.


setAuthorizationInstaller

public void setAuthorizationInstaller(AuthorizationManagerInstaller authorizationManagerInstaller)
Set the type of connection to used to access the server.

Note that the NakedObjectSessionFactoryUsingInstallers also checks the ClientConnectionInstaller twice over: to see if a PersistenceSessionProxy should be used as a persistor, and for any FacetDecoratorInstallers.


obtainAuthenticationManager

protected AuthenticationManager obtainAuthenticationManager(DeploymentType deploymentType)
Specified by:
obtainAuthenticationManager in class NakedObjectsSystemAbstract

obtainAuthorizationManager

protected AuthorizationManager obtainAuthorizationManager(DeploymentType deploymentType)

lookupAndSetFixturesInstaller

public void lookupAndSetFixturesInstaller()

setFixtureInstaller

public void setFixtureInstaller(FixturesInstaller fixtureInstaller)

obtainFixturesInstaller

protected FixturesInstaller obtainFixturesInstaller()
                                             throws NakedObjectSystemException
Description copied from class: NakedObjectsSystemAbstract
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.

Specified by:
obtainFixturesInstaller in class NakedObjectsSystemAbstract
Throws:
NakedObjectSystemException

obtainTemplateImageLoader

protected TemplateImageLoader obtainTemplateImageLoader()
Uses the TemplateImageLoader configured in InstallerLookup, if available, else falls back to that of the superclass.

Overrides:
obtainTemplateImageLoader in class NakedObjectsSystemAbstract

setReflectorInstaller

public void setReflectorInstaller(NakedObjectReflectorInstaller reflectorInstaller)

obtainReflector

protected NakedObjectReflector obtainReflector(DeploymentType deploymentType)
                                        throws NakedObjectSystemException
Specified by:
obtainReflector in class NakedObjectsSystemAbstract
Throws:
NakedObjectSystemException

setServicesInstaller

public void setServicesInstaller(ServicesInstaller servicesInstaller)

obtainServices

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

lookupAndSetUserProfileFactoryInstaller

public void lookupAndSetUserProfileFactoryInstaller()

setUserProfileStoreInstaller

public void setUserProfileStoreInstaller(UserProfileStoreInstaller userProfilestoreInstaller)

obtainUserProfileStore

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

setPersistenceMechanismInstaller

public void setPersistenceMechanismInstaller(PersistenceMechanismInstaller persistenceMechanismInstaller)

obtainPersistenceSessionFactory

protected PersistenceSessionFactory obtainPersistenceSessionFactory(DeploymentType deploymentType)
                                                             throws NakedObjectSystemException
Specified by:
obtainPersistenceSessionFactory in class NakedObjectsSystemAbstract
Throws:
NakedObjectSystemException


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