Hi,

To change the Configuration at runtime we need a ModifiableConfiguration (I
know that there were some discussions about this) in this way I can have the
management written against a interface not a class. I guess the interface is
straight forward since this functionality is implemented by the
DefaultConfiguration:

public interface ModifiableConfiguration extends Configuration
{
    void addChild( final Configuration configuration );

    void removeChild( final Configuration configuration );

    void setAttribute( final String name, final String value );

    void setValue( final String value );

    void makeReadOnly();
}


The next issue on *the list* is that I'm not sure how should I implement the
configuration management, until now I have two solutions:

1) Have a Dynamic that wraps each Configuration object and makes it
available for management. For a Configuration object the MBean would have
actions and attributes like:

Configuration:
--------------
<repository
class="org.apache.avalon.cornerstone.blocks.masterstore.File_Persistent_Obje
ct_Repository">
 <protocols>
  <protocol>file</protocol>
 </protocols>
 <types>
  <type>OBJECT</type>
  </types>
 <models>
  <model>SYNCHRONOUS</model>
  <model>ASYNCHRONOUS</model>
  <model>CACHE</model>
 </models>
</repository>
---------------

*MBean ---------
Avalon:block=objectstorage,entry=repositories,entry=repository

*attributes ----

Class =
"org.apache.avalon.cornerstone.blocks.masterstore.File_Persistent_Object_Rep
ository"
Value = ""

Children

Avalon:block=objectstorage,entry=repositories,entry=repository,entry=protoco
ls
 Avalon:block=objectstorage,entry=repositories,entry=repository,entry=types
 Avalon:block=objectstorage,entry=repositories,entry=repository,entry=models

*actions -------

addChild ($name)
removeChild ($name)
setAttribute ($name, $value)
---------------

This solution is very verbose and pretty difficult to use but allows maximum
of flexibility. Also, forces you to put your values in the attributes in
order to facilitate the management.

2) Second solution would be to use XPath to manage (set/get/add/remove) your
configuration. This is prone to errors and its difficult to use from an
administrator perspective.


I prefer the first solution but I'm not convinced that it's the best
approach.
Any thoughts are very welcomed!

Mircea


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

Reply via email to