Host Configuration

Overview

This document describes the process of changing host specific settings in a step-by-step fashion.

Prerequisites

Before working on configuration of the Gateway it is recommended to have a local copy of all modules. This is because various modules read in the configurations during their build process. Therefore it is a good idea to utilize the gwbuild.bash script to refresh all modules once configuration has taken place. This will insure that the changes made will be reflected when the application is deployed.

Getting Started

The easiest way to get started with a new host configuration is to copy one of the default host directories:

  • config\host\localhost - Contains example .xml configurations for using an in-memory Hibernate database.
  • config\host\prod01 - Contains example .xml configurations for using an independent MySQL database.

    These configuration files can then be modified and saved in the config directory under config/host/(hostname) .

gateway-ds.xml

To provide a simple idea of how the Gateway datasource is configured for Hibernate, the gateway-ds.xml is listed below:

<?xml version="1.0" encoding="UTF-8"?>
<datasources>
        <local-tx-datasource>
                <jndi-name>GatewayDS</jndi-name>
                <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}gateway-hsql${/}localDB</connection-url>
                <driver-class>org.hsqldb.jdbcDriver</driver-class>
                <user-name>sa</user-name>
                <password></password>
                <min-pool-size>5</min-pool-size>
                <max-pool-size>20</max-pool-size>
                <idle-timeout-minutes>5</idle-timeout-minutes>
                <track-statements/>
        </local-tx-datasource>
</datasources>

jboss-service.xml

To provide a simple idea of how JBoss is configured for Hibernate, the jboss-service.xml is listed below:

<mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Hibernate">
        <attribute name="DatasourceName">java:/GatewayDS</attribute>
        <attribute name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>
        <attribute name="Dialect">org.hibernate.dialect.HSQLDialect</attribute>
        <attribute name="Hbm2ddlAuto">update</attribute>
</mbean>

Loading configuration

Configuration directories are currently loaded using Maven profiles, information on this is contained here.