avalon-phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juozas Baliuka" <bali...@mail.lt>
Subject Re: Configurable
Date Sun, 12 May 2002 07:23:55 GMT
Hi,
I reinvented some class for configuration, may be it will be interesting for
anybody.
----- Original Message -----
From: "Peter Donald" <peter@apache.org>
To: "Avalon-Phoenix Developers List" <avalon-phoenix-dev@jakarta.apache.org>
Sent: Sunday, May 12, 2002 3:39 AM
Subject: Re: Configurable


On Sat, 11 May 2002 21:46, Juozas Baliuka wrote:
> Is it possible to configure Block without Configurable implementation.
> My configuration attributes are dynamic (not known at codding time ) and I
> am going to implement  "configure" this way:
>
>   configuration = configuration.getChild("class");
>
>   Object instance = Class.forName(
> configuration.getAttribute("name"),true,loader ) .newInstance();
>
> Configuration[]   properties = configuration.getChildren();
>
>  for (int i = 0; i <= properties.length; i++  ){
>
>   // use intospection and reflection to set properties
>   ...........................................................
>
>  }
>
> Doe's some phoenix service can do this for me ?
> It is very usual and don't want to reinvent this way of configuration.

Theres no phoenix I know of that does this but there is something similar in
the ant project. Check out the jakarta-ant-myrmidon CVS and have a look at
the classes

container/src/java/org/apache/myrmidon/components/configurer/ClassicConfigur
er.java
container/src/java/org/apache/myrmidon/interfaces/configurer/Configurer.java

Which do what you want to do I believe. They basically use the "ant1.x"
patterns to map Configuration object onto an object.

--
Cheers,

Peter Donald


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


Mime
View raw message