org.objectweb.jonas.management
Class ReconfiguratorProp

java.lang.Object
  extended by org.objectweb.jonas.management.AbsReconfigurator
      extended by org.objectweb.jonas.management.ReconfiguratorProp
All Implemented Interfaces:
Reconfigurator

public class ReconfiguratorProp
extends AbsReconfigurator

This class allows for persistent reconfiguration of a JOnAS service or of a JOnAS resource being configured by a .properties file.

Author:
Adriana Danes

Field Summary
 
Fields inherited from class org.objectweb.jonas.management.AbsReconfigurator
configFileName, lastSequence, logger, name
 
Constructor Summary
ReconfiguratorProp(java.lang.String name, java.lang.String configFileName, java.util.Properties config)
          Construct a reconfigurator for a JOnAS service or a JOnAS resource
 
Method Summary
 void saveConfig(long sequence)
          Saves the updated configuration
 void updateConfig(java.lang.String key, java.lang.String value, long sequence)
          Updates the configuration file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReconfiguratorProp

public ReconfiguratorProp(java.lang.String name,
                          java.lang.String configFileName,
                          java.util.Properties config)
Construct a reconfigurator for a JOnAS service or a JOnAS resource

Parameters:
name - the name of the .properties configuration file to be updated. It may be 'jonas.properties' if the Reconfigurator is associated to a JOnAS service, or a 'resource.properties' if the Reconfigurator is associated to a data source or a mail factory.
conf - the initial content of the .properties configuration file
Method Detail

updateConfig

public void updateConfig(java.lang.String key,
                         java.lang.String value,
                         long sequence)
Updates the configuration file

Parameters:
key - the modified property name
value - the new value
sequence - the sequence number of management notification producing the update

saveConfig

public void saveConfig(long sequence)
                throws ReconfigException
Saves the updated configuration

Specified by:
saveConfig in interface Reconfigurator
Specified by:
saveConfig in class AbsReconfigurator
Parameters:
sequence - the sequence number of management notification producing the save (in fact store) operation
Throws:
ReconfigException - if the saveConfig could not be done