Offline Mode » History » Version 2
Henning Blohm, 17.07.2016 21:52
1 | 1 | Henning Blohm | h1. Offline Mode |
---|---|---|---|
2 | 2 | Henning Blohm | |
3 | The purpose of the offline mode is to avoid long synchronisation times when developing in a situation poor network connectivity. The expected behavior is that of having no network connectivity at all - without imposing this on other applications. |
||
4 | |||
5 | The offline mode can be turned on and off via a system property and interactively on the GUI. |
||
6 | |||
7 | h2. Design |
||
8 | |||
9 | * Component Repository use @AbstractRepository.checkOffline()@ whenever a connection is normally required. |
||
10 | |||
11 | The method looks essentially like this: |
||
12 | |||
13 | <pre><code class="java"> |
||
14 | protected void checkOfflineMode() { |
||
15 | if (Foundation.isOffline()) { |
||
16 | throw new IllegalStateException("Running offline"); |
||
17 | } |
||
18 | } |
||
19 | </code></pre> |
||
20 | |||
21 | where @Foundation.isOffline()* checks for the boolean String value of the system property *com.zfabrik.offline*. |
||
22 | |||
23 | * Changing the system property can happen any time |
||
24 | * The system property status is reflected in a JMX MBean attribute of TBD. We use the internal JMX implementation to broadcast attribute changes to all worker processes. |