2 MozartSpaces core configuration:
3 - loaded from a file named mozartspace1.xml or the file specified with the system property
4 "mozartspaces.configurationFile"
5 - the system property can be set with "java -Dmozartspaces.configurationFile=<configfile> ..."
6 - the search order for the configuration file is (only relevant if only the file name or a relative path is
9 b) user's home directory (user.home)
12 <mozartspacesCoreConfig>
13 <!-- This default configuration is also contained in the code and used when no configuration file is found -->
15 <!-- Determines whether the core has an embedded space or is just a client -->
16 <embeddedSpace>true</embeddedSpace>
18 <!-- Core Processor (XP) configuration -->
21 The number of threads for the XP thread pool - supported values are:
22 > 0: a fixed thread pool with the specified number of threads is used.
23 Use the values below with caution!
24 0: a synchronous executor service without a thread pool is used.
25 < 0: a cached thread pool (unbounded number of threads) is used.
30 <!-- Serializer configuration, multiple serializers are supported -->
33 Serializer name - the supported values are:
34 * javabuiltin: built-in binary serialization
35 Serializers below are not in the core but extra modules:
36 * jaxb: XML marshalling with JAXB, compliant with XVSMP schema
37 (Cannot be used for copying entries!)
38 This serializer requires the module mozartspaces-xvsmp-jaxb!
39 * kryo: fast binary serialization
40 (entry classes need to have a no-arg constructur which may be private)
41 This serializer requires the module mozartspaces-xvsmp-kryo!
42 * xstream-json: XStream serializer with JSON driver (Jettison)
43 This serializer requires the module mozartspaces-xvsmp-xstream!
44 * xstream-xml: XStream serializer with default XML driver
45 This serializer requires the module mozartspaces-xvsmp-xstream!
47 * specify the name of the serializer class which needs to have a public no-arg
48 constructor and implement org.mozartspaces.core.util.Serializer
50 <serializer>javabuiltin</serializer>
53 <!-- Remoting configuration -->
55 <!-- the default scheme, used to select the sender if no scheme is specified in the destination's space URI -->
56 <defaultScheme>xvsm</defaultScheme>
57 <!-- Host name or IP address to bind to (resolved with InetAddress.getByName) -->
58 <bindHost>0.0.0.0</bindHost>
59 <!-- Configuration of transport handlers with senders and receivers -->
61 <!-- multiple transports can be used concurrently (identified by the scheme) -->
63 TCP Socket transport, with scheme (used to distinguish transports)
64 standard synchronous socket I/O (java.io)
66 <tcpsocket scheme="xvsm">
68 The number of threads for the receiver/sender thread pool:
69 * The configuration values are as for the XP thread pool.
70 * The default configuration (1000 threads) allows 500 open connections.
71 * Adjust, when more connections should be supported!
72 * You need at least 2 threads for each (open) connection.
74 <threads>1000</threads>
75 <!-- exclusive port to listen for incoming connections -->
76 <receiverPort>9876</receiverPort>
77 <!-- the serializer to use, can be a serializer ID or an Apache Commons configuration as below -->
78 <serializer>${serializers.serializer(0)}</serializer>
80 <!-- REST transport (EXPERIMENTAL!) -->
82 This transport requires the module mozartspaces-transport-rest-common and mozartspaces-transport-rest-jetty!
88 other transports could be added, e.g. NIO (with Netty)
93 <!-- Configuration of the Space URI, identifier and also locator of a space -->
94 <spaceURI>${remoting.defaultScheme}://localhost:${remoting.transports.tcpsocket.receiverPort}</spaceURI>
95 <!-- example above with variables, expanded to "xvsm://localhost:9876" -->
97 <!-- Security configuration (EXPERIMENTAL!) -->
99 <!-- check authentication (credentials, SSO token) of requests with an aspect (RequestAuthenticationAspect) -->
100 <authentication enabled="false">
101 <!-- The (enabled) authentication requires the module mozartspaces-security-openam! -->
102 <!-- TODO add name for different types of authentication (SSO token, credentials) -->
103 <!-- cache SSO token validity and attributes -->
104 <!-- <cacheResults>true</cacheResults> -->
105 <!-- TODO: configure caching timeout or use token timeout? -->
107 <!-- enable authorization (create policy container) -->
108 <authorization enabled="false">
109 <!-- whether all requests should be authorized with an aspect (RequestAuthorizationAspect) -->
110 <authorizeRequests>false</authorizeRequests>
114 <!-- Persistence profile configuration -->
117 The following profiles are supported:
118 * in-memory: actually no persistence, just collections in RAM
119 * berkeleydb-lazy: database log is asynchronously written to disk (NO_SYNC)
120 * berkeleydb-transactional: database log is synchronously written to disk on TX commit (WRITE_NO_SYNC)
121 * berkeleydb-transactional-sync: as above, and additionally flushes the log (SYNC)
122 The difference between the Berkeley DB profiles is the configured sync policy
123 (com.sleepycat.je.Durability.SyncPolicy)
124 The Berkeley-DB profiles requires the module mozartspaces-capi3-berkeleydb!
125 * sqlite-android: built-in SQLite database of Android
126 This profile works only on MozartSpaces for Android!
128 <profile>in-memory</profile>
129 <!-- the serializer to use, can be a serializer ID or an Apache Commons configuration as below -->
130 <serializer>${serializers.serializer(0)}</serializer>
131 <!-- the size of the serializer cache, requires mozartspaces-core-cache for values > 0 -->
132 <serializerCacheSize>0</serializerCacheSize>
134 <property key="berkeley-location">/tmp/xvsm4</property>
136 Properties for Berkeley DB:
137 * berkeley-location: path to the database files folder
138 default value: System.getProperty("java.io.tmpdir") + File.separator + "xvsm";
139 <property key="berkeley-location">/path/to/db/files</property>
140 * berkeley-cache-size: size of the Berkeley DB cache in bytes
141 <property key="berkeley-cache-size">10000000</property>
142 Properties for SQLite Android:
143 * sqlite-db-name: name of the SQLite database
144 <property key="sqlite-db-name">mozart-spaces</property>
149 <!-- Configuration of the entry copier -->
150 <!-- copyContext: should the request context also be copied? -->
151 <entryCopier copyContext="false">
153 <!-- supported elements are one of the following elements: -->
155 <!-- No entry copier, is the default and can be omitted -->
158 <!-- Serializing entry copier, uses a serializer to copy objects -->
159 <!-- <serializing>${serializers.serializer(0)}</serializing> -->
160 <!-- the element value can be a serializer ID or a variable as below -->
162 <!-- Cloning entry copier, entries need to implement MzsCloneable -->
166 <!-- Configuration of custom coordinators -->
168 <!-- This is an example for illustration. The AnyCoordinator is a predefined, integrated coordinator -->
170 <!-- The coordinator API class (must implement Coordinator) -->
171 <apiClass>org.mozartspaces.capi3.AnyCoordinator</apiClass>
172 <!-- The selector API class (must implement Selector) -->
173 <apiSelectorClass>org.mozartspaces.capi3.AnyCoordinator$AnySelector</apiSelectorClass>
174 <!-- The CAPI-3 coordinator translator class (must implement CoordinatorTranslator) -->
175 <capi3TranslatorClass>org.mozartspaces.capi3.javanative.coordination.DefaultAnyCoordinator$AnyCoordinatorTranslator</capi3TranslatorClass>
176 <!-- The CAPI-3 selector translator class (must implement SelectorTranslator) -->
177 <capi3SelectorTranslatorClass>org.mozartspaces.capi3.javanative.coordination.DefaultAnyCoordinator$AnySelectorTranslator</capi3SelectorTranslatorClass>
178 <!-- Custom coordinators are currently not supported by the JAXB serializer! -->
179 <!-- The elements below are currently not supported! -->
181 <jaxbCreator>org.mozartspaces.xvsmp.util.AnyCoordinatorMapper$AnyCoordinatorCreator</jaxbCreator>
182 <jaxbSelectorCreator>org.mozartspaces.xvsmp.util.AnyCoordinatorMapper$AnySelectorCreator</jaxbSelectorCreator>
183 <jaxbCoordDataCreator>org.mozartspaces.xvsmp.util.AnyCoordinatorMapper$AnyDataCreator</jaxbCoordDataCreator>
189 CAPI-3 implementation to use, the supported values are:
190 * javanative: implementation using only JDK classes (collections)
191 In previous internal development versions a now abandoned database implementation ("db") was supported.
193 <capi3>javanative</capi3>
195 </mozartspacesCoreConfig>