Thomas L. Kjeldsen | 30 Jun 17:17

SimpleConfiguration and system properties

Hello,

I have a suggestion which I think could improve the current
jPOS-EE/QBean configuration scheme.

When I deploy a jPOS-EE application it usually goes through three
different environments: development, staging and production. With
the current configuration scheme this means that I have to modify
the QBean XML configuration files for each environment. I would
like to avoid this, and would prefer to have a single unix-style
configuration file on each environment instead. 

I recently came across the Jetty webserver and noticed how system
properties is used in jetty configuration files.

Snip from http://jetty.mortbay.org/jetty5/tut/Server.html

  <New class="org.mortbay.http.SocketListener">
    <Set name="Port">
      <SystemProperty name="jetty.port" default="8080"/>
    </Set>
  </New>

Using system properties this way I would be able to modify the
service wrapper to pass settings from a unix-style configuration
file to the java environment using java -Dsetting=value.

What do you think about this? I believe it would require only
minor changes to org.jpos.core.SimpleConfiguration.

(Continue reading)

Alejandro Revilla | 30 Jun 21:17

Re: SimpleConfiguration and system properties

Thomas,

We have a similar problem and we use the build system 'target'
configuration that expands everything inside '@...@', so we can build a
'devel', 'test', or 'production' system.

The benefit of this approach is that we can configure not only QBean
properties but also attributes, and other components configuration as
well such as hibernate.cfg.xml and jetty.xml

We define simple properties like:

 port=8000
 host=xxxx

and then use @port@ and @host@ inside any part of the configuration.

The downside is that you need to call ant -Dtarget=xxx to build the
system, you can't change that configuration at runtime, so I guess we
could benefit from your suggestion as well.

--Alejandro

PS.- Sorry for the short message, I'm on the go this week. 

On Mon, Jun 30, 2008 at 05:18:58PM +0200, Thomas L. Kjeldsen wrote:
> Hello,
> 
> I have a suggestion which I think could improve the current
> jPOS-EE/QBean configuration scheme.
(Continue reading)


Gmane