commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ola Berg <ola.b...@arkitema.se>
Subject Re: [Configuration] Proposals
Date Thu, 13 Jun 2002 08:12:28 GMT
Interesting.

I have a config-framework myself, and lacks some of the kind of features that you listed.

The features that I have in mine includes:

Bean-driven: sub packages in the system simply throws empty beans into the configuration framework.
The config framework populates the bean from the configuration data. So if you have a bean
with the following properties:

class LoggerConfig{
  public void setLogFile( File f)...
  public void setTimeOutMinutes( int t)...
}

...that bean, when thrown at the configuration framework will be populated, given that the
config file (for now, only properties-files are supported) contains:

logFile=/foo/bar/log.txt
timeOutMinutes=5

My converter framework (not merged with apaches yet) instantiates the File object and the
int value and sets the properties.

This even works recursively, so if you have another subpackage that needs

class FooBarConfig{
  public void setStartUrl( URL url)...
}

...you can integrate them in an outer bean:

class SystemConfig {
  public void setLogger( LoggerConfig l)...
  public void setFooBar( FooBarConfig f)...
}

...and the properties file can look like this:

logger.logFile=/foo/bar/log.txt
logger.timeOutMinutes=5
fooBar.startUrl=http://www.apache.org



Integrated with a factory framework and a pool: Since there is a lot of dynamic instantiation
that takes place within the framework, there is the possibility for the configuration framework
to wait, not instantiating anything until needed. And the factory framework is integrated
with the pool.

Feature next to be implemented is the update feature: the configurator keeps a reference to
all the object it has populated. Given a notice that some data has changed, the data will
be changed. So as long as the sub systems keeps a reference to the config bean, and grabs
the value from there, whenever it is needed, automatic reconfig at runtime is supported. 

It seems like these features could be merged with yours and existing features.

/O

--------------------
ola.berg@arkitema.se
0733 - 99 99 17

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message