8.10. Integrating Your Package With CCM Tools

The WAF environment includes a set of tools for loading and configuring software such as our example application. In order to integrate with those tools, your application needs to supply some information in the right places.

The CCM package loader, part of the ccm command line tool, takes a package and loads its initial configuration, schema, and data. ccm is documented in the Red Hat Web Application Framework Installation Guide.

$ ccm load --interactive binder

This command will ultimately run a Loader, a class that loads a package's schema and data. So that the CCM tool can invoke the correct loader, a file of the form ${package-key}.load is required directly under your application's src/ directory.

<?xml version="1.0" encoding="utf-8"?>
<load>
  <provides>
    <table name="binders"/>
    <table name="notes"/>
    <initializer class="com.example.binder.Initializer"/>
  </provides>
  <scripts>
    <schema directory="binder"/>
    <data class="com.example.binder.Loader"/>
  </scripts>
</load>

Example 8-12. binder/src/binder.load

The table names in the <provides> block will be checked to ensure they exist when the package tool prepares to load the binder package. The initializer classname dictates what initializer will be run when the CCM runtime starts up. The schema directory given in the <scripts> block tells the base Loader implementation where to find the schema it will load. The optional data class allows you to use a Loader implementation specific to your package.