avalon-phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@apache.org>
Subject Re: Configurable
Date Sun, 12 May 2002 01:39:18 GMT
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/ClassicConfigurer.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