org.nakedobjects.runtime.installers
Class InstallerLookupDefault

java.lang.Object
  extended by org.nakedobjects.runtime.installers.InstallerLookupDefault
All Implemented Interfaces:
ApplicationScopedComponent, Component, Injectable, ConfigurationBuilderAware, InstallerLookup, InstallerRepository

public class InstallerLookupDefault
extends java.lang.Object
implements InstallerLookup

This class retrieves named Installers from those loaded at creation, updating the NakedObjectConfiguration as it goes.

A list of possible classes are read in from the resource file installer-registry.properties. Each installer has a unique name (with respect to its type) that will be compared when one of this classes methods are called. These are instantiated when requested.

Note that it is possible to use an Installer implementation even if it has not been registered in installer-registry.properties : just specify the Installer's fully qualified class name.


Field Summary
 java.lang.String INSTALLER_REGISTRY_FILE
           
 
Constructor Summary
InstallerLookupDefault(java.lang.Class<?> cls)
           
 
Method Summary
 AuthenticationManagerInstaller authenticationManagerInstaller(java.lang.String requested, boolean isProduction)
           
 AuthorizationManagerInstaller authorizationManagerInstaller(java.lang.String requested, boolean isProduction)
           
 ClientConnectionInstaller clientConnectionInstaller(java.lang.String requested)
          Client-side of remoting, specifying how to access the server.
 EmbeddedWebServerInstaller embeddedWebServerInstaller(java.lang.String requested)
           
 FixturesInstaller fixturesInstaller(java.lang.String requested)
           
 NakedObjectConfiguration getConfiguration()
          Returns a snapshot of the current NakedObjectConfiguration.
 ConfigurationBuilder getConfigurationBuilder()
          Injected.
<T extends Installer>
T
getInstaller(java.lang.Class<T> installerCls)
           
<T extends Installer>
T
getInstaller(java.lang.Class<T> cls, java.lang.String implName)
           
 Installer getInstaller(java.lang.String implClassName)
           
 Installer[] getInstallers(java.lang.Class<?> cls)
          This method (and only this method) may be called prior to initialization.
 void init()
           
<T> T
injectDependenciesInto(T candidate)
          Injects self into candidate
 void injectInto(java.lang.Object candidate)
           
 void mergeConfigurationFor(Installer installer)
           
 PersistenceMechanismInstaller persistenceMechanismInstaller(java.lang.String requested, DeploymentType deploymentType)
           
 NakedObjectReflectorInstaller reflectorInstaller(java.lang.String requested)
           
 ServicesInstaller servicesInstaller(java.lang.String requestedImplementationName)
           
 void setConfigurationBuilder(ConfigurationBuilder configurationLoader)
           
 void shutdown()
           
 TemplateImageLoaderInstaller templateImageLoaderInstaller(java.lang.String requested)
           
 UserProfileStoreInstaller userProfilePersistenceMechanismInstaller(java.lang.String requested, DeploymentType deploymentType)
           
 NakedObjectsViewerInstaller viewerInstaller(java.lang.String name)
           
 NakedObjectsViewerInstaller viewerInstaller(java.lang.String name, java.lang.String defaultName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTALLER_REGISTRY_FILE

public final java.lang.String INSTALLER_REGISTRY_FILE
See Also:
Constant Field Values
Constructor Detail

InstallerLookupDefault

public InstallerLookupDefault(java.lang.Class<?> cls)
Method Detail

getInstallers

public Installer[] getInstallers(java.lang.Class<?> cls)
This method (and only this method) may be called prior to initialization.

Specified by:
getInstallers in interface InstallerRepository

init

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

shutdown

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

authenticationManagerInstaller

public AuthenticationManagerInstaller authenticationManagerInstaller(java.lang.String requested,
                                                                     boolean isProduction)
Specified by:
authenticationManagerInstaller in interface InstallerLookup

authorizationManagerInstaller

public AuthorizationManagerInstaller authorizationManagerInstaller(java.lang.String requested,
                                                                   boolean isProduction)
Specified by:
authorizationManagerInstaller in interface InstallerLookup

fixturesInstaller

public FixturesInstaller fixturesInstaller(java.lang.String requested)
Specified by:
fixturesInstaller in interface InstallerLookup

templateImageLoaderInstaller

public TemplateImageLoaderInstaller templateImageLoaderInstaller(java.lang.String requested)
Specified by:
templateImageLoaderInstaller in interface InstallerLookup

persistenceMechanismInstaller

public PersistenceMechanismInstaller persistenceMechanismInstaller(java.lang.String requested,
                                                                   DeploymentType deploymentType)
Specified by:
persistenceMechanismInstaller in interface InstallerLookup

userProfilePersistenceMechanismInstaller

public UserProfileStoreInstaller userProfilePersistenceMechanismInstaller(java.lang.String requested,
                                                                          DeploymentType deploymentType)
Specified by:
userProfilePersistenceMechanismInstaller in interface InstallerLookup

reflectorInstaller

public NakedObjectReflectorInstaller reflectorInstaller(java.lang.String requested)
Specified by:
reflectorInstaller in interface InstallerLookup

embeddedWebServerInstaller

public EmbeddedWebServerInstaller embeddedWebServerInstaller(java.lang.String requested)
Specified by:
embeddedWebServerInstaller in interface InstallerLookup

clientConnectionInstaller

public ClientConnectionInstaller clientConnectionInstaller(java.lang.String requested)
Client-side of remoting, specifying how to access the server.

This lookup is called in three different contexts:

In addition to the usual merging of any Installer -specific configuration files, this lookup also merges in any remote properties available.

Specified by:
clientConnectionInstaller in interface InstallerLookup

viewerInstaller

public NakedObjectsViewerInstaller viewerInstaller(java.lang.String name,
                                                   java.lang.String defaultName)
Specified by:
viewerInstaller in interface InstallerLookup

viewerInstaller

public NakedObjectsViewerInstaller viewerInstaller(java.lang.String name)
Specified by:
viewerInstaller in interface InstallerLookup

servicesInstaller

public ServicesInstaller servicesInstaller(java.lang.String requestedImplementationName)
Specified by:
servicesInstaller in interface InstallerLookup

getInstaller

public <T extends Installer> T getInstaller(java.lang.Class<T> cls,
                                            java.lang.String implName)
Specified by:
getInstaller in interface InstallerLookup

getInstaller

public Installer getInstaller(java.lang.String implClassName)
Specified by:
getInstaller in interface InstallerLookup

getInstaller

public <T extends Installer> T getInstaller(java.lang.Class<T> installerCls)
Specified by:
getInstaller in interface InstallerLookup

getConfiguration

public NakedObjectConfiguration getConfiguration()
Description copied from interface: InstallerLookup
Returns a snapshot of the current NakedObjectConfiguration.

The NakedObjectConfiguration could subsequently be appended to if further Installers are loaded.

Specified by:
getConfiguration in interface InstallerLookup

mergeConfigurationFor

public void mergeConfigurationFor(Installer installer)

injectDependenciesInto

public <T> T injectDependenciesInto(T candidate)
Description copied from interface: InstallerLookup
Injects self into candidate

Specified by:
injectDependenciesInto in interface InstallerLookup

injectInto

public void injectInto(java.lang.Object candidate)
Specified by:
injectInto in interface Injectable

getConfigurationBuilder

public ConfigurationBuilder getConfigurationBuilder()
Description copied from interface: InstallerLookup
Injected.

Specified by:
getConfigurationBuilder in interface InstallerLookup

setConfigurationBuilder

public void setConfigurationBuilder(ConfigurationBuilder configurationLoader)
Specified by:
setConfigurationBuilder in interface ConfigurationBuilderAware


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