Chapter 5. Configuration file

Table of Contents

5.1. Introduction
5.2. Configuration
5.2.1. RMI component
5.2.2. Transaction component
5.2.3. JMS component
5.2.4. HSQL database
5.2.5. JDBC pool
5.2.6. SmartServer component
5.3. Advanced configuration
5.3.1. Mapping file
5.3.2. Other configuration file

5.1. Introduction

EasyBeans is configured with the help of an XML configuration file. The XML configuration file is an easy-to-understand configuration file.

Here is an example of a configuration file :

<?xml version="1.0" encoding="UTF-8"?>
<easybeans xmlns="http://org.objectweb.easybeans.server">
    <!-- Define components that will be started at runtime -->
    <components>
        <!-- RMI/JRMP will be used as protocol layer -->
        <rmi>
           <protocol name="jrmp" port="1099" hostname="localhost" />
        </rmi>

        <!-- Start a transaction service -->
        <tm />

        <!-- Start a JMS provider -->
        <jms port="16030" hostname="localhost" />

        <!-- Creates an embedded HSQLDB database -->
        <hsqldb port="9001" dbName="jdbc_1">
            <user name="easybeans" password="easybeans" />
        </hsqldb>

        <!-- Creates a JDBC pool with jdbc_1 JNDI name -->
        <jdbcpool jndiName="jdbc_1" username="easybeans"
            password="easybeans"
            url="jdbc:hsqldb:hsql://localhost:9001/jdbc_1"
            driver="org.hsqldb.jdbcDriver" />

        <!-- Start smartclient server with a link to the rmi component-->
        <smart-server port="2503" rmi="#rmi" />
    </components>
</easybeans>

By default, an easybeans-default.xml file is used. To change the default configuration, user has to provide a file named easybeans.xml which can be found in a classloader/CLASSPATH.