ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/core/ConfigurationServant.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/core/ConfigurationServant.java (file contents):
Revision 1.2 by tdb, Thu Nov 9 03:29:13 2000 UTC vs.
Revision 1.9 by tdb, Mon Nov 20 15:49:46 2000 UTC

# Line 1 | Line 1
1   //---PACKAGE DECLARATION---
2  
3   //---IMPORTS---
4 < import core.*;
4 > import uk.ac.ukc.iscream.core.*;
5   import java.util.*;
6   import java.io.*;
7 + import java.text.DateFormat;
8  
9   /**
10   * An implementation of the Configuration IDL
# Line 41 | Line 42 | class ConfigurationServant extends ConfigurationPOA {
42       * @param propertiesStream an InputStream connected to the configuration
43       */
44      ConfigurationServant(File configurationFile, Logger logRef) {
45 +        _lastModified = configurationFile.lastModified();
46          _logRef = logRef;
47 <        _logRef.write(this.toString(), "created");
47 >        
48 >        String date = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM).format(new Date(getLastModified()));
49 >        _logRef.write(this.toString(), Logger.SYSMSG, "created: " + configurationFile.getName() + "(" + date + ")" );
50 >        
51          try {
52              InputStream configurationStream = new FileInputStream(configurationFile);
53              _properties.load(configurationStream);
# Line 68 | Line 73 | class ConfigurationServant extends ConfigurationPOA {
73      }
74      
75      /**
76 <     * Overrides the {@link #java.lang.Object.toString() Object.toString()}
76 >     * Overrides the {@link java.lang.Object#toString() Object.toString()}
77       * method to provide clean logging (every class should have this).
78       *
79       * @return the name of this class and its CVS revision
80       */
81      public String toString() {
82 <        return this.getClass().getName() + ":" + REVISION;
82 >        return this.getClass().getName() + "(" + REVISION.substring(11, REVISION.length() - 2) + ")";
83      }
84  
85   //---PRIVATE METHODS---
86  
87 +    protected void finalize() throws Throwable {
88 +        _logRef.write(this.toString(), Logger.DEBUG, "finalized (ick, us english!)");
89 +    }
90 +
91   //---ACCESSOR/MUTATOR METHODS---
92  
93 +    /**
94 +     * Returns the date stamp of the configuration file
95 +     * this object is using.
96 +     *
97 +     * @return the last modified time for the file
98 +     */
99 +    public long getLastModified() {
100 +        return _lastModified;
101 +    }
102 +
103   //---ATTRIBUTES---
104  
105      /**
# Line 93 | Line 112 | class ConfigurationServant extends ConfigurationPOA {
112       */
113      private Logger _logRef;
114  
115 +    /**
116 +     * The date stamp of the configuration file
117 +     * this object is using
118 +     */
119 +    private long _lastModified;
120 +    
121   //---STATIC ATTRIBUTES---
122  
123   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines