Hi,
I reinvented some class for configuration, may be it will be interesting for
anybody.
----- Original Message -----
From: "Peter Donald" <[EMAIL PROTECTED]>
To: "Avalon-Phoenix Developers List" <[email protected]>
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:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

Attachment: AbstractConfigurable.java
Description: Binary data

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to