What is a Server Application?
In Loom, a Server Application is a set of Blocks that act in concert to provide a unified user service. Example Server Applications include a Mail Server, File Server, Web Server etc. The Server Application is a high level component that contains a set of Block components.
A Server Application requires a number of components other than Blocks to be complete. A Server Application requires configuration files to define Server Application wide settings (threading, security, logging), to define how blocks are wired together, and to define configuration data for the Block instances. A Block can also require other resources that are application specific.
Creating a Server Application
- Select the blocks you wish to assemble
- Write the config.xml file
- Write the assembly.xml file
- Write the environment.xml file
- Package the component and related resources into a sar
Select the blocks you wish to assembly
As a assembler it is your responsibility to select the particular Blocks required to build your application. You may aquire the Blocks from a number of sources depending on your resources. You may use the core Blocks supplied with Loom, contract someone to build the component or download the Block from an online repository.
Write the assembly.xml file
The next stage is to write the assembly.xml file. The assembly.xml specifies the instances of Blocks that are part of the Server Application. Each Block has a name. Each block may also have dependencies that need to be satisfied and this can be done via the 'provide' sub-elements. The provide element maps block instances from the Server Application namespace to the Block role namespace specified in BlockInfo files. For more detail on the format of assembly.xml see its information page
Write the environment.xml file
The next stage is to write the environment.xml file. The environment.xml is used to configure the code-based security policy, log management and thread pooling. For more detail on the format of environment.xml see its information page
The sar file format is the standard distribution format of Loom Server Applications. It is a standard Jar file with a specific directory layout. The config.xml, environment.xml and assembly.xml file must be stored in SAR-INF/ directory of the archive. All jar files, including both those that contain blocks and those that contain support classes should be stored in the SAR-INF/ directory.