5.3. Advanced configuration

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

5.3.1. Mapping file

In order to know that rmi is the CarolComponent, tm the JOTM component, jms the Joram component, there is a mapping file. This file is named easybeans-mapping.xml and it is located in the org.objectweb.easybeans.server package.

Here 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 by 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 use their own mapping by providing a file in a package. The name of the the file needs to be xxx-mapping.xml with xxx being the name of the element which 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 file

EasyBeans could be configured through other configuration files as it uses a POJO configuration. then, you could configure it with the Spring Framework component or other frameworks/tools.