1    /*
2     * Copyright 2005 :torweg free software group
3     *
4     * This program is free software: you can redistribute it and/or modify
5     * it under the terms of the GNU General Public License as published by
6     * the Free Software Foundation, either version 3 of the License, or
7     * (at your option) any later version.
8     * 
9     * This program is distributed in the hope that it will be useful,
10    * but WITHOUT ANY WARRANTY; without even the implied warranty of
11    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    * GNU General Public License for more details.
13    * 
14    * You should have received a copy of the GNU General Public License
15    * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16    *
17    */
18   package org.torweg.pulse.configuration;
19   
20   import java.io.Serializable;
21   
22   import org.jdom.Element;
23   
24   /**
25    * Interface for {@code ConfigBean}s.
26    * 
27    *<p>
28    * {@code ConfigBean}s are configurations parsed into
29    * JavaBeans<sup>TM</sup> which are usually managed by the local
30    * {@code PoorMansCache} (see:{@link PoorMansCache#getConfig(Class)},
31    * {@link PoorMansCache#getBundleConfig(Class, org.torweg.pulse.bundle.Bundle)}
32    * ).
33    * </p>
34    * 
35    * @author Thomas Weber
36    * @version $Revision: 1387 $
37    */
38   public interface ConfigBean extends Serializable {
39   
40       /**
41        * returns the time that the configuration file associated by this
42        * ConfigBean was last modified.
43        * 
44        * @return the last modified time in milliseconds since the epoch
45        */
46       long lastModified();
47   
48       /**
49        * sets or updates the time that the configuration file associated by this
50        * ConfigBean was last modified.
51        * 
52        * @param t
53        *            the last modified time in milliseconds since the epoch
54        */
55       void setLastModified(long t);
56   
57       /**
58        * configures the bean from the given JDOM element.
59        * 
60        * @param conf
61        *            the relevant part of the config XML
62        */
63       void init(Element conf);
64   
65   }
66