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.3 by tdb, Mon Nov 13 16:36:03 2000 UTC

# Line 1 | Line 1
1   //---PACKAGE DECLARATION---
2  
3   //---IMPORTS---
4 < import core.*;
4 > import uk.ac.ukc.iscream.core.*;
5   import org.omg.CORBA.*;
6   import org.omg.CosNaming.*;
7  
# 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