Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 65772 invoked from network); 15 Feb 2011 06:36:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Feb 2011 06:36:40 -0000 Received: (qmail 69044 invoked by uid 500); 15 Feb 2011 06:36:39 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 68606 invoked by uid 500); 15 Feb 2011 06:36:36 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 68598 invoked by uid 99); 15 Feb 2011 06:36:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Feb 2011 06:36:35 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of moein.enayati@gmail.com designates 209.85.212.43 as permitted sender) Received: from [209.85.212.43] (HELO mail-vw0-f43.google.com) (209.85.212.43) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Feb 2011 06:36:26 +0000 Received: by vws17 with SMTP id 17so3494646vws.30 for ; Mon, 14 Feb 2011 22:36:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=YFtnEhm9hYXyTGrxBIO/r1jPUu+DJij4OI1QEYGt14g=; b=b9GkXYj0zMU1hU/Ln43SeytSJgsI5Fv01Q3PP342mbYnC88+di5HRiHaUR7jIF0TBF p9hLAV59vWAl89mwxQfv7C0dlECYUlWJyWirADFWgq+iZbEDlpImEXr46o4XNhYetImR hkHGm3u/jKWyGb3lkpho+jq3TySdk+rlEOYOk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=TiaeMlrjeQnczf7DSGSN7KkSzDabuUNUdPUusQ1aZyavao06odZ+FuOQKwxSbW7OMr QONJ5THoPjJtiqTTWCduC+i3z6seW4/Riej1AinQDbLMjeI2rZWELrS8KvLXdGyfcnbd av3AxBQIQusUJi75NEsA7cmncqww0QYNpfO0E= Received: by 10.220.188.4 with SMTP id cy4mr400220vcb.43.1297751765739; Mon, 14 Feb 2011 22:36:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.182.202 with HTTP; Mon, 14 Feb 2011 22:35:45 -0800 (PST) From: Moein Enayati Date: Tue, 15 Feb 2011 10:05:45 +0330 Message-ID: Subject: [Configuration] Problem in using FileChangedReloadingStrategy events ... To: Commons Users List Content-Type: multipart/alternative; boundary=90e6ba53b05e00e848049c4c610e X-Virus-Checked: Checked by ClamAV on apache.org --90e6ba53b05e00e848049c4c610e Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Dear All I=92ve just have an XMLConfiguration object initialized like this : * * * this.xmlConfig =3D new XMLConfiguration("preferences.xml");* * this.xmlConfig.setAutoSave(true);* * this.xmlConfig.setReloadingStrategy(new FileChangedReloadingStrategy());* and a bean implements ConfigurationListener Interface like this : *public abstract class DefaultBean implements Serializable,ConfigurationListener {* *protected PropertyChangeSupport propertyChangeSupport =3D new PropertyChangeSupport(this);* * public abstract String getXmlBeanPropertyAddress();* * public void configurationChanged(ConfigurationEvent event) {* *System.out.println(=93Event Type Value is 20 ! >> =94+event.getType());* *}* *}* Also I=92ve registered my bean and the XMLConfigoration as listeners : * this.xmlConfig.addConfigurationListener(myBeanInstance);* * myBeanInstance.addPropertyChangeListener(getPropertyChangeListener());* To test the AutoReloadEvents , simply I used a timer which gets a property of my XMLConfiguration object each 2 Seconds and it seems working . *myBeanInstance. configurationChanged() * is invoked about two minutes after any change in the source *preferences.xml*. * * *But there is a small problem! * The *event.getType()* returns a value of *20* which I could not find it i= n *XMLConfiguration.EVENT_* constants. Would you please help me to find the mistake I=92ve probably done or is the= re any way to have a trace line? I could find only these EVENT_ constants : *XMLConfiguration.EVENT_ADD_NODES =3D 11* *XMLConfiguration.EVENT_ADD_PROPERTY =3D 1* *XMLConfiguration.EVENT_CLEAR =3D 4* *XMLConfiguration.EVENT_CLEAR_PROPERTY =3D 2* *XMLConfiguration.EVENT_CLEAR_TREE =3D10* *XMLConfiguration.EVENT_READ_PROPERTY =3D5* *XMLConfiguration.EVENT_SET_PROPERTY =3D3* *XMLConfiguration.EVENT_SUBNODE_CHANGED =3D12* Thanks / Moein --90e6ba53b05e00e848049c4c610e--