ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/experimental/server/SampleConfigObtainer/SampleConfigObtainer.java
(Generate patch)

Comparing experimental/server/SampleConfigObtainer/SampleConfigObtainer.java (file contents):
Revision 1.1 by ajm, Wed Nov 8 21:24:33 2000 UTC vs.
Revision 1.2 by tdb, Mon Nov 13 16:11:03 2000 UTC

# Line 72 | Line 72 | class SampleConfigObtainer {
72                  }
73              }
74              
75 +            System.out.println("Testing configuration change system.");
76 +            System.out.println("Waiting for configuration change on 1 second intervals");
77 +            
78 +            // get our last modified
79 +            long myLastModified = myConfig.getLastModified();
80 +            
81 +            // get a ref to the last modified of file NOW...
82 +            boolean changed = configurator.isModified(config,myLastModified);
83 +            
84 +            // keep checking, every second until it changes
85 +            while (!changed) {
86 +                Thread.sleep(1000);
87 +                changed = configurator.isModified(config,myLastModified);
88 +            }
89 +            
90 +            // get the config again and print out the new time to compare - just to check ;-)
91 +            myConfig = configurator.getConfiguration(config);
92 +            System.out.println("Configuration changed: " + myLastModified + " -> " + myConfig.getLastModified());
93 +            
94 +            // done testing
95              System.out.println("Finished");
96  
97          } catch (Exception e) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines