0 Replies Latest reply on Apr 1, 2009 6:59 AM by Andy Taylor

    config files and where the deployers get them from

    Andy Taylor Master

      Currently all the config files are obtained from the classloader via getResources with a harcoded filename. By default we have as a minimum jbm-configuration.xml, jbm-security.xml and jbm-jms.xml altho an optional jbm-queues.xml canbe used.

      When we run from within a distro, i.e. './run.sh', all these config files are conatined in the config dir which is added to the classpath by the run.sh script.

      We need to be able to specify different config files on starting the server, this is for running clustered and running examples withdifferent configurations.

      There are a few ways of doing this.

      1. simply specify a different config directory on startup, the script will change the classpath and the config files will be loaded from a different directory using the same filenames. i.e.

      ./run.sh -cjbm-config,dir=../examples/common/config

      2. Specify a different filename for each file. This way in the code we use the default filenames or use the system property if set. i.e.

      ./run.sh -Djbm.conf=foo -Djbm.jms.conf=bar -Djbm.security.conf=foobar

      We just have to make sure that the location of the alternative config files is in the classpath or the user specifies a full path.

      3. Inject the config filenames into the deployers via thebean descriptor. so the default beans file would contain something like:

       <bean name="Configuration" class="org.jboss.messaging.core.config.impl.FileConfiguration">
       <property name="config">${JBM_HOME}/config/jbm-configuration.xml</property>

      the to run an example we run
      ./run.sh ../examples/common/config/jbm-example-beans.xml

      and we change the configuration in that to

       <bean name="Configuration" class="org.jboss.messaging.core.config.impl.FileConfiguration">
       <property name="config">${JBM_HOME}../examples/common/config/example-configuration.xml</property>

      Or whatever the user wants. This is also easier when deploying multiple instances within the AS., with 1 and 2 you couldn't do this

      My option is for the latter