Project

General

Profile

Offline Mode » History » Version 4

Henning Blohm, 07.09.2016 21:21

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 4 Henning Blohm
			throw new OfflineModeException("Running in offline mode");
17 2 Henning Blohm
		}
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 3 Henning Blohm
* Initially the property is assumed as @false@ and should only be specified otherwise in @runtime.properties@.
25
* The system property status is backed in a JMX MBean attribute of the newly created Foundation MBean. 
26
* We use the internal JMX implementation to broadcast attribute changes to all worker processes.
27
* There is a toggle checkbox in the GUI.