Home > Articles > Programming

  • Print
  • + Share This
This chapter is from the book

Packaging the LoanApplication Composite

SCA specifies one interoperable packaging format for composite files and associated artifacts such as Java classes, XSDs, and WSDLs: the ZIP archive. However, to accommodate the diverse range of packaging formats used by various programming languages, SCA allows runtimes to support other formats in addition to the ZIP archive. A C++ runtime may accept DLLs; a runtime may also support various specializations of the ZIP format. Fabric3 also supports JARs and Web Archives (WARs).

SCA ZIP archives include a metadata file, sca-contribution.xml, in the META-INF directory. The sca-contribution.xml file provides SCA-specific information about the contents of the archive, most notably the composites available for deployment. In general, one deployable composite will be packaged in an archive, although in some cases (which we discuss in later chapters), no deployable composites or multiple deployable composites may be present.

The name sca-contribution.xml derives from SCA terminology: A contribution is an application artifact that is “contributed” or made available to a domain. A contribution can be a complete composite and all the artifacts necessary to execute it, or it might just contain artifacts to be used by composites from other contributions, such as a library, XSDs, or WSDLs. LoanApplication is packaged as a complete composite. Its sca-contribution.xml is shown in Listing 2.13.

Listing 2.13. A Contribution Manifest

<contribution xmlns=http://www.osoa.org/xmlns/sca/1.0

xmlns:bb="http://www.bigbank.com/xmlns/lending/composites/1.0">

    <deployable composite="bb:LoanApplication"/>

</contribution>

The <deployable> element identifies a composite available for deployment contained in the archive. In this case, it points to the name of the LoanApplication composite, as defined in the <composite> element of its .composite file:

<composite  xmlns="http://www.osoa.org/xmlns/sca/1.0"

targetNamespace="http://www.bigbank.com/xmlns/lending/composites/1.0"
              name="LoanApplication"...>

Unlike sca-contribution.xml, SCA does not specify a location for composite files; they can be included in any archive directory. However, as a best practice, it is recommended that deployable composite files be placed alongside sca-contribution.xml in the META-INF directory so they can be easily found.

  • + Share This
  • 🔖 Save To Your Account