Access Keys:
Skip to content (Access Key - 0)

An application definition file identifies several elements that comprise a fabric application. The fabric_pkg utility uses this file to bundle all the application files into one package. Only one version of an application can exist on the fabric at a time.

App Packaging with FAR Dependency. When packaging an application with a reference to a FAR, one should take care to provide the location of the .far to fabric_pkg. By default, fabric_pkg will look in $FABRIC_HOME/fars for any FAR files it needs for packaging; the FAR lookup directory can be changed by using the -fars-dir option in fabric_pkg. If, for some reason, a FAR file listed in App XML is not present, fabric_pkg will print a warning message, but will continue to try packaging the application. In the case that the CLASSPATH or LD_LIBRARY_PATH/PATH are already set properly on the user's development environment, the application should package. Otherwise, errors will occur later in the packaging process due to unsatisfied dependencies. Once the application is deployed, however, the application will refuse to start unless its FAR dependencies are met and the correct FARs are deployed.

Download

Schemas and DTDs provide the syntax for acceptable XML files. However, there are additional semantic rules in place which affect packaging. Appistry highly recommends referencing the documentation while writing XML files.

Download FabricApp.dtd.

Element Cardinality Description
app 1 This is the root element of the fabric application description: one application is defined per XML file.

Attribute Use Description
name required The name of the fabric application. This element is required and should take the form of a FabricIdentifier.
version required The version of the fabric application. The fabric uses the version value to ensure the most current version of a file is maintained. All version numbers are right justified and zero filled. When comparing version 1.2 with 1.19, the fabric actually compares 1.02 with 1.19. Version 1.19 is considered newer than version 1.2, but 1.20 is considered to be newer than 1.19. Also, when comparing version 1.0.0 with 1.0 and 1, 1.0.0 is considered newer than version 1.0 and 1.0 is considered newer than version 1.
display-name optional Used for display purposes only.
description optional Used for display/informational purposes only.

The app element defines the following child elements. The elements are listed in the order that they must appear in the XML:

Element Cardinality Description
group-access 0...1 Controls access to the application during execution.
tasks 0...1 The list of task definition files to include in the application.
spring 0...1 Defines a scope for Spring related elements.
components 0...1 The list of component definition files to include in the application.
process-flows 0...1 The list of process flow definition files to include in the application.
fars 0...1 The list of FARs on which the application will depend.
java-libs 0...1 The list of java libraries to include in the application.
libs 0...1 The list of native libraries to include in the application.
assemblies 0...1 The list of .NET assemblies to include in the application.
support-files 0...1 The list of additional files of any type to include in the application.

Sample Application XML:

<?xml version="1.0"?>
<!DOCTYPE app SYSTEM "FabricApp.dtd">
<app name="order-app" version="1.0">
   <components>
      <!-- component files go here -->
   </components>
   <java-libs>
      <!-- java lib files go here -->
   </java-libs>
</app>
   
<?xml version="1.0"?>
<!DOCTYPE app SYSTEM "FabricApp.dtd">
<app name="sample_app" version="1.0">
   <tasks>
      <file name="my_java_task.xml"/>
   </tasks>
   <process-flows>
      <file name="my_proc_flow.xml"/>
   </process-flows>
</app>
   

Application XML Elements

Element Cardinality Description
group-access 0...1 Identifies the list of groups authorized to run the application. If the group-access element is not present, all users have authorization to run the application. For more information on group members and group names, consult Application Security.

The group-access element defines a single child element:
Element Cardinality Description
group 1..n Identifies the name of a group that is authorized to run the application.

Sample group-acceess element:

<group-access>
   <group name="my-group"/>
</group-access>
   

tasks 0...1 Identifies the list of task definition files to include in the application.

The tasks element defines a single child element:
Element Cardinality Description
file 1..n Includes a task definition file in this application.

Sample tasks element:

<tasks>
   <file name="my_tasks.xml"/>
</tasks>
   

spring 0...1 Defines the scope of Spring related elements within the application.

The spring element defines a single child element:
Element Cardinality Description
bean-factory-locator 1..n Identifies a Spring bean factory or application context to use in the application.

Sample spring element:

<spring>
   <!-- Spring related stuff goes here
   (currently just bean-factory-locator). -->
</spring>
   


Example application definition with Spring:

<?xml version="1.0"?>
<!DOCTYPE app SYSTEM "FabricApp.dtd">
<app name="touchless_app" version="1.0">
   <spring>
      <bean-factory-locator bean="myBeanFactory"
            resource-location="classpath:beanRefFactory.xml"/>
   </spring>
   <components>
      <file name="pojo_component.xml"/>
   </components>
   <process-flows>
      <file name="spring_add_integers_flow.xml"/>
   </process-flows>
   <fars>
      <far name="my-spring"/>
   </fars>
</app>
   

components 0...1 Identifies the list of Component Definition XML files to include in the application.

The components element defines a single child element:
Element Cardinality Description
file 1..n Includes a Component Definition XML file in the application.

Sample components element:

<components>
   <file name="my_component.xml"/>
</components>
   


Example application definition with components:

<?xml version="1.0"?>
<!DOCTYPE app SYSTEM "FabricApp.dtd">
<app name="app_with_components" version="1.0">
   <components>
      <file name="pojo_component.xml"/>
   </components>
   <process-flows>
      <file name="add_integers_flow.xml"/>
   </process-flows>
</app>
   

process-flows 0...1 Identifies the list of Process Flow Definition XML files to include in the application.

The process-flows element defines a single child element:
Element Cardinality Description
file 1..n Includes a process flow definition file in this application.

Sample process-flows element:

<process-flows>
   <file name="my_process_flow.xml"/>
</process-flows>
   

fars 0...1 Identifies a list of FAR files that can be referenced by this application.

The fars element defines the following child elements:
Element Cardinality Description
far 1..n Includes a FAR in the application.

Sample fars element:

<fars>
   <far name="my-far"/>
</fars>
   

java-libs 0...1 Identifies the list of Java libraries (e.g. JARs) to include in the application. The files in this list are added to the application class loader that is used by fabric_pkg and when the application is loaded within the fabric.

The java-libs element defines a single child element:
Element Cardinality Description
file 1..n Includes a Java library in this application. It will also be added to the application class loader when the application is packaged and run in the fabric.


Sample java-libs element:

<java-libs>
   <file name="my_java.jar"/>
</java-libs>
   

libs 0...1 Identifies the list of native shared libraries to include in the application. This tag affects the search order used by the OS when loading applications: the directories of the files are added to the PATH environment variable in Windows and the LD_LIBRARY_PATH environment variable in Linux; they will appear in the order that they appear in the XML.

The libs element defines a single child element:
Element Cardinality Description
file 1..n Includes a native shared library in this application. The libraries are made available to the application at package and run time.

Sample libs element:

<libs>
   <file name="my_lib.dll"/>
</libs>
   

assemblies 0...1 Identifies the .NET assembly files that are to be included in the fabric application. Each file will be included in the fabric package when the application is packaged. Pathnames are allowed, but must be to a directory under the fabric application XML file. These folders will be added to the probing path of the .NET AppDomain of the fabric application.

The closure of your .NET component code (the assemblies containing the classes that implement the .NET fabric component plus any assemblies that they depend) must be available when the fabric application is loaded. To do so, those assemblies must be included in the assemblies tag of the application, a dependent far, or preinstalled in the .NET Global Assembly Cache (GAC).



The assemblies element defines a single child element:

Element Cardinality Description
file 1..n The .NET assembly to include in the application, and whose directory will be added to the AppDomain probing path.

Sample assemblies element:

<assemblies >
   <file name="my_dotnet_assembly.dll"/>
</assemblies >
   

support-files 0...1 The support-files element identifies a list of files of any type to include in the application.

Java libraries and native shared libraries required by your application should be included in either java-libs or libs to ensure that they are properly added to the application class loader or native library path. JARs listed under support-files will be added to the application class loader but this behavior is deprecated.



The support-files element defines a single child element:

Element Cardinality Description
file 1..n Includes a file of any type in this application.

Sample support-files element:

<support-files>
   <file name="my_data.dat"/>
</support-files>
   

Application XML Sub-Elements

Element Cardinality Description
group 1...n Identifies the name of a group that is authorized to run the application. See group-access.

Attribute Use Description
name required The name of a group that is authorized to run the application.

Sample group element:

<group name="my-group"/>
   

file 1...n Identifies the name of a file to be included in the element set. See components, tasks, process-flows, libs, java-libs, or support-files.

The file element defines a single attribute:
Attribute Use Description
name required The name of the file to be included.

Sample file element:

<file name="my_java_task.xml"/>
   

bean-factory-locator 1...n This element is used to provide the fabric application with a Spring bean factory or application context. The bean factory is used to provide instances of Java objects to the fabric at runtime. The fabric obtains an object (Spring bean) by calling the "getBean(String beanName)" method on the bean factory. The bean name that is used during the call to getBean method is determined by a Component definition.

The bean-factory-locator element defines the following attributes:
Attribute Use Description
bean required The name or id of the Spring bean that defines the bean factory or application context.
resource-location optional Specifies where to locate the spring configuration file that contains the bean definition. If not specified the value will default to classpath:beanRefFactory.xml.

The resource-location attribute uses an extended URL syntax:

Type Description Example Attribute
file location on the file system resource-location="file:beanFactory.xml"
http online resource resource-location="http://www.domain.com/beanFactory.xml"
classpath file on the classpath resource-location="classpath:beanFactory.xml"

Sample bean-factory-locator element:

<bean-factory-locator
      bean="my-bean-factory" 
      resource-location="classpath:my-bean-factory.xml" />
   

far 1...n Identifies the name of a FARs on which the application will depend. Java libraries and native shared libraries listed in the FAR will be added to the application's class loader or the native library path.

Attribute Use Description
name required The name of the FAR. This attribute is a FabricIdentifier.

Sample far element:

<far name="my-far"/>