5.3. Advanced Configuration

This configuration file can be extended to create and set properties on other classes.

5.3.1. Mapping File

A mapping file named easybeans-mapping.xml provides the information that rmi is the CarolComponent, tm is the JOTM component, and jms is the Joram component. This file is located in the org.objectweb.easybeans.server package.

The following is an extract of the easybeans-mapping.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<easybeans-mapping xmlns="http://easybeans.objectweb.org/xml/ns/mapping">

    <class name="org.objectweb.easybeans.component.Components"
        alias="components" />

    <package name="org.objectweb.easybeans.component.carol">
        <class name="CarolComponent" alias="rmi">
            <attribute name="portNumber" alias="port" />
        </class>
        <class name="Protocol" alias="protocol" />
    </package>

    ...

</easybeans-mapping>
[Note]Note

This mapping file is referenced by the easybeans configuration file using the XML namespace : xmlns="http://org.objectweb.easybeans.server".

Each element configured within this namespace will use the mapping done in the org.objectweb.easybeans.server package.

Users can define their own mapping by providing a file in a package. The name of the the file must be xxx-mapping.xml, where xxx is the name of the element that will use this namespace.

Example: For the element <easybeans xmlns="http://org.objectweb.easybeans.server">, the resource searched in the classloader is org/objectweb/easybeans/server/easybeans-mapping.xml.

5.3.2. Other Configuration Files

EasyBeans can be configured through other configuration files as it uses a POJO configuration. If done this way, it can be configured using the Spring Framework component or other frameworks/tools.