| 1 | HOT RELOAD EXAMPLE |
| 2 | ================== |
| 3 | |
| 4 | This example is a demonstration on how Hot Reload works. |
| 5 | |
| 6 | To run the example, from the current directory type the following command at prompt |
| 7 | |
| 8 | ```console |
| 9 | $ mvn compile exec:java |
| 10 | ``` |
| 11 | |
| 12 | You'll see something like: |
| 13 | |
| 14 | ```console |
| 15 | $ mvn compile exec:java |
| 16 | |
| 17 | [INFO] Scanning for projects... |
| 18 | [INFO] |
| 19 | [INFO] ------------------------------------------------------------------------ |
| 20 | [INFO] Building OWNER :: Examples :: Hot Reload 1.0.7-SNAPSHOT |
| 21 | [INFO] ------------------------------------------------------------------------ |
| 22 | [INFO] |
| 23 | |
| 24 | ## some more maven logs here... |
| 25 | |
| 26 | HOT RELOAD EXAMPLE |
| 27 | |
| 28 | The program is running. |
| 29 | Now you can change the file located at: |
| 30 | |
| 31 | /Users/luigi/foo/bar/baz/target/examples-generated-resources/HotReloadExample.properties |
| 32 | |
| 33 | ...and see the changes reflected below |
| 34 | |
| 35 | |
| 36 | someValue is: 10 |
| 37 | ``` |
| 38 | |
| 39 | As the program explains, you can change the `HotReloadExample.properties` and see that the change is |
| 40 | immediately noticed and the configuration is instantaneously reloaded and printed in the console. |
| 41 | |
| 42 | Set the property someValue to -1, or any other negative value, in the configuration file and the program will |
| 43 | take that value as instruction to terminate. |
| 44 | |
| 45 | Have a look at the source code to see how this has been implemented. |