You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by mi...@nl.abnamro.com on 2002/06/17 10:30:19 UTC

DOMConfigurator and the Observe pattern.

Hi all,

I'm working on al little project to create an observer pattern around the DOMConfigurator of log4j. (I'm using 1.2.3 b.t.w.)
To do this I've created an ObservableDOMConfigurator which extends DOMConfigurator. It has extra methods to make it a subject. (addObserver,
removeObserver, getObservers and inform)
To inform all observers the subject has changed I overrided the doConfigure(String filename, LoggerRepository hierarchy) which does a
super.doConfigure() and next a this.inform().
Since this didn't work I looked into the log4j code to see what actually happens. I found the following code is called when a change to the config
file is noticed:

public
void doOnChange() {
    new DOMConfigurator().doConfigure(filename,
        LogManager.getLoggerRepository());
  }

This code makes it impossible to override the doConfigure method. I'm pretty sure this is done for a reason, but can anyone explain me why this is
done and not the following is done:

public
void doOnChange() {
    doConfigure(filename,
        LogManager.getLoggerRepository());
  }

Regards,

Misja Heuveling.
---------------------------------------------------------------------------
This message (including any attachments) is confidential and may be privileged. If you have received it by mistake please notify the sender by return
e-mail and delete this message from your system. Any unauthorised use or dissemination of this message in whole or in part is strictly prohibited.
Please note that e-mails are susceptible to change.
ABN AMRO Bank N.V. (including its group companies) shall not be liable for the improper or incomplete transmission of the information contained in
this communication nor for any delay in its receipt or damage to your system. ABN AMRO Bank N.V. (or its group companies) does not guarantee that the
integrity of this communication has been maintained nor that this communication is free of viruses, interceptions or interference.
---------------------------------------------------------------------------





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>