Package com.iizix.server.app
Class AppDefinition
- java.lang.Object
- com.iizix.server.app.AppDefinition
 
- public class AppDefinition extends java.lang.ObjectApplication definition when loading the applications/projects.- Author:
- Christopher Mindus
 
- Field Summary- Fields - Modifier and Type - Field - Description - java.lang.String- idThe ID of the application.
 - Constructor Summary- Constructors - Constructor - Description - AppDefinition(java.lang.String id, java.lang.String serverEnvironmentName, java.io.File iiziAppFile, boolean doHotDeploy)Constructor.
 - Method Summary- All Methods Instance Methods Concrete Methods - Modifier and Type - Method - Description - void- addModuleDirectory(java.io.File dir)Adds a directory for loading.- void- dispose()Disposes of the application definition.- void- disposeHotDeploy()Disposes of the application's hot deploy.- WSFileProvider- getAppSessionFileProvider()Get the web server file provider for the application session.- AppFactory- getFactory()Gets the application factory.- java.lang.String- getServerEnvironmentName()Returns the Server environment for the application.- boolean- hasAppChanged()Checks if the iiziApp has been changed and needs reload.- boolean- isHotDeployEnabled()Checks if hot deploy is used for this application.- void- loadApplication(ServerShell server)Loads the application.- boolean- reload(ServerShell server, boolean forceReload)Reloads the application if it has changed.
 
- Constructor Detail- AppDefinition- public AppDefinition(java.lang.String id, java.lang.String serverEnvironmentName, java.io.File iiziAppFile, boolean doHotDeploy)Constructor.- Parameters:
- id- The application ID.
- serverEnvironmentName- The server environment name to use, null for default.
- iiziAppFile- The application file.
- doHotDeploy- Hot deploy flag.
 
 
 - Method Detail- dispose- public void dispose() Disposes of the application definition.- This method is intended to be called from the server: DO NOT CALL THIS METHOD. 
 - getFactory- public AppFactory getFactory() Gets the application factory.- Returns:
- The application factory once loaded, null otherwise.
 
 - addModuleDirectory- public void addModuleDirectory(java.io.File dir) throws java.io.IOExceptionAdds a directory for loading.- Parameters:
- dir- The Module directory to load.
- Throws:
- java.io.IOException- if the directory is already added, or if the application definition is a compiled application.
 
 - hasAppChanged- public boolean hasAppChanged() Checks if the iiziApp has been changed and needs reload.- Returns:
- true if app has changed and hot deploy is used, false when not changed or hot deploy is not used.
 
 - getServerEnvironmentName- public java.lang.String getServerEnvironmentName() Returns the Server environment for the application.
 - loadApplication- public void loadApplication(ServerShell server) throws PropException, java.io.IOException, ServerApplicationSetupException Loads the application.- Throws:
- java.io.IOException- For file errors.
- PropException- For property errors.
- ServerApplicationSetupException- In case a plug-in fail to initialize.
 
 - isHotDeployEnabled- public boolean isHotDeployEnabled() Checks if hot deploy is used for this application.- Returns:
- true if hot deploy is enabled, false otherwise.
 
 - reload- public boolean reload(ServerShell server, boolean forceReload) throws PropException, java.io.IOException, ServerApplicationSetupException Reloads the application if it has changed.- Returns:
- true if reloaded, false if not changed or not loaded with hot deploy.
- Throws:
- java.io.IOException- For file errors.
- PropException- For property errors.
- ServerApplicationSetupException- In case a plug-in fail to initialize.
 
 - disposeHotDeploy- public void disposeHotDeploy() Disposes of the application's hot deploy.
 - getAppSessionFileProvider- public WSFileProvider getAppSessionFileProvider() throws java.io.IOException Get the web server file provider for the application session.- Returns:
- The web server file provider.
- Throws:
- java.io.IOException- If the directory for the application session files failed to be created.
- java.lang.IllegalStateException- If the application is not yet loaded or is disposed of.