Package com.iizix.app.builder
Class ApplicationDistributor
java.lang.Object
com.iizix.app.builder.ApplicationDistributor
- All Implemented Interfaces:
- IAppLoader,- Serializable
- Direct Known Subclasses:
- EclipseApplicationDistributor
Class used to produce a distribution of an iiziApp file from module projects. This class is used either from inside Eclipse, or externally from a command line wrapper.
- Author:
- Christopher Mindus
- See Also:
- Field SummaryFieldsModifier and TypeFieldDescription- protected AppPropCnrThe Application container.- static final StringThe Jar "Created-By" version = "a.b.c.buildnr (com.iizigo)".- protected ServerAppDistributionPropsThe distribution property.- static final StringThe Application distribution file name located under the Module root.- protected ModuleProjectPropCnr[]The modules to process.- protected final PropFactoryThe property factory to use when creating the distribution, null for the Designer.
- Constructor SummaryConstructorsConstructorDescription- ApplicationDistributor- (PropFactory propFactory, PropMgr propMgr, PluginLoader pluginLoader, ExecutorService executorService, boolean isVerbose) Constructs the application compiler for the target file.
- Method SummaryModifier and TypeMethodDescription- voidAdds a new operation to the target.- protected void- checkCanceled- (Object monitor) Checks if the monitor is canceled.Creates the Jar file.- int- createResourceOperations- (Object monitor) Process all resource operations, i.e.- void- dispose()Disposes of the instance when done.- getDestinationJar- (File projectDir) Gets the destination Jar file.Gets the parallel loader ExecutorService.The property manager to use when creating the distribution.Initializes the license system because app registration is requested.Initializes the license system because app registration is requested.- void- loadApplicationDefinition- (File project) Loads the application definition and all required Modules into memory in Command Line mode.- protected <PC extends PropCnr>
 PCLoads a property file.Loads a property file.- loadFile- (String fileName, InputStream inputStream) Loads a property file.- protected void- loadModule- (IIDirectory iidir) Loads the entire Module application using the "Server code" with parallel thread load of all files.- loadPlugins- (String names) Loads required plug-in's.- void- resolveReferences- (List<String> warnings, List<String> errors) Resolves all references and then checks for property errors.Verifies the Modules.- protected voidTicks units of work from progress.
- Field Details- FILENAMEThe Application distribution file name located under the Module root.- See Also:
 
- CREATED_BYThe Jar "Created-By" version = "a.b.c.buildnr (com.iizigo)".
- distThe distribution property.
- appCnrThe Application container.
- modulesThe modules to process.
- propFactoryThe property factory to use when creating the distribution, null for the Designer.
 
- Constructor Details- ApplicationDistributorpublic ApplicationDistributor- (PropFactory propFactory, PropMgr propMgr, PluginLoader pluginLoader, ExecutorService executorService, boolean isVerbose) Constructs the application compiler for the target file.- Parameters:
- propFactory- The Property Factory.
- propMgr- The Property Manager.
- pluginLoader- The plug-in loader.
- executorService- The executor service.
- isVerbose- Verbose output.
 
 
- Method Details- initializeLicenseSystemInitializes the license system because app registration is requested.- Returns:
- null for success, otherwise an error message. If an error is returned, it has already been logged as a severe error.
 
- initializeLicenseSystemInitializes the license system because app registration is requested.- Parameters:
- licCB- The license callback, null for none. This parameter is used for the Designer.
- Returns:
- null for success, otherwise an error message. If an error is returned, it has already been logged as a severe error.
 
- disposepublic void dispose()Disposes of the instance when done.
- getPropertyManagerThe property manager to use when creating the distribution.- Specified by:
- getPropertyManagerin interface- IAppLoader
 
- loadApplicationDefinitionpublic void loadApplicationDefinition- (File project) throws IOException, PropException, CancelException Loads the application definition and all required Modules into memory in Command Line mode.- Parameters:
- project- The project directory.
- Throws:
- IOException- For file errors.
- PropException- For property errors.
- CancelException- If operation is canceled by user.
 
- getDestinationJarGets the destination Jar file.- Parameters:
- projectDir- The project directory.
- Returns:
- The absolute file, perhaps resolved from the project directory if the name is relative. null is returned if the Jar file name is not specified!
 
- resolveReferencesResolves all references and then checks for property errors.- The returned list contains the property path in warning/error, a Tab character, then followed by the error message. - Parameters:
- warnings- Warnings list to fill.
- errors- Errors list to fill.
 
- verifyModulesVerifies the Modules. This includes verifying the classpath and dependencies to other non-included Modules in the distribution.- Returns:
- Error message string, or null for OK.
 
- createResourceOperationsProcess all resource operations, i.e. directories and file operations.- Parameters:
- monitor- The progress monitor.
- Returns:
- The count of resource operations to perform.
- Throws:
- FileNotFoundException- If a file is not found.
- IOException- For file errors.
- CancelException- If operation is canceled by user.
 
- getExecutorServiceGets the parallel loader ExecutorService.- Specified by:
- getExecutorServicein interface- IAppLoader
 
- loadFileLoads a property file.- Specified by:
- loadFilein interface- IAppLoader
- Parameters:
- fileName- The file name for logging.
- inputStream- The file input stream.
- Returns:
- A Property container.
- Throws:
- IOException- For file errors.
- PropException- For property errors.
 
- loadFileLoads a property file.- Specified by:
- loadFilein interface- IAppLoader
- Parameters:
- file- The file to load.
- Returns:
- A Property container.
- Throws:
- IOException- For file errors.
- PropException- For property errors.
 
- loadPluginsLoads required plug-in's.- Each plug-in must have a class called "name.server.Descriptor" that implement the interface - com.iizix.IPluginDescriptoravailable.- The plug-in definition should be found at the "name/schema/properties.xml", but the iiziGo modules have the "iizigo" module instead of "iizix". To figure out translation of names, a class called "name.server.Descriptor" is loaded and should implement the interface - Specified by:
- loadPluginsin interface- IAppLoader
- Parameters:
- names- The plug-in name, e.g. "com.iizigo.db,com.iizigo.term,com.iizigo.ws".
- Throws:
- IOException- If a plug-in failed to load.
 
- loadFileprotected <PC extends PropCnr> PC loadFile- (IIFile iifile, Class<PC> propClass, Object monitor) throws IOException, PropException Loads a property file.- Parameters:
- iifile- The file to load.
- Returns:
- A Property container.
- Throws:
- IOException- For file errors.
- PropException- For property errors.
 
- addOperationAdds a new operation to the target.- Parameters:
- op- The operation.
 
- loadModuleLoads the entire Module application using the "Server code" with parallel thread load of all files.- Parameters:
- iidir- The directory where the Module project is located.
- Throws:
- IOException- For file errors.
- PropException- For property errors.
 
- createJarCreates the Jar file.- Parameters:
- monitor- The Eclipse progress monitor, or null for none.
- Returns:
- The temp-file for the Jar.
- Throws:
- IOException- For I/O errors.
 
- checkCanceledChecks if the monitor is canceled.- Parameters:
- monitor- The progress monitor, or null for none.
- Throws:
- CancelException- If the operation is canceled.
 
- workedTicks units of work from progress.- Parameters:
- monitor- The progress monitor, or null for none.
- work- The work units count.