JBoss.org Community Documentation

21.1. Deployment Descriptors

Deployment descriptors are files containing configuration information for deployments. They are detected using the FileStructure class by matching the file suffix or using a FileMatcher . Default file suffixes include:

  • -beans.xml - contains bean definitions

  • -aop.xml - contains aspect definitions

  • -service.xml - contains mbean definitions

  • -ds.xml - contains JCA datasource definitions

Each FileMatcher must implement the following interface:


public interface FileMatcher
{
   boolean isDeployable(VirtualFile file);
}

Default implementations are:

  • BshFileMatcher - checks whether the filename ends with .bsh (Bean Shell)

The purpose of the FileStructure class is to detect deployments that consist of a single deployment descriptor. As such it creates a single ContextInfo object when a known file is found and adds this to the StructureMetaData . Since no classes are present the list of classpaths within the ContextInfo is set to null.

Warning

Currently any top-level deployment that consists of a single file is always identified as a known deployment descriptor. This is done to avoid having to specify all of the known file suffixes in a configuration file. The file suffix and FileMatcher checks are only performed for nested deployments.

As the FileStructure class has a relative order of Integer.MAX_VALUE it is always called after any other StructureDeployer implementations such as JARStructure. This means that a deployment consisting of a single JAR file will be detected correctly.

Deployment descriptors that form part of a deployment together with other files, such as classes or resources are detected by other implementations of StructureDeployer such as JARStructure which is described next.