]> git.somenet.org - pub/jan/sbc.git/blob - src/main/resources/mozartspace4.xml
[XVSM] Add theoretic persistence+recovery support.
[pub/jan/sbc.git] / src / main / resources / mozartspace4.xml
1 <!--
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
7       specified):
8       a) current directory
9       b) user's home directory (user.home)
10       c) classpath
11 -->
12 <mozartspacesCoreConfig>
13 <!-- This default configuration is also contained in the code and used when no configuration file is found -->
14
15     <!-- Determines whether the core has an embedded space or is just a client -->
16     <embeddedSpace>true</embeddedSpace>
17     
18     <!-- Core Processor (XP) configuration -->
19     <coreProcessor>
20         <!--
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.
26         -->
27         <threads>10</threads>
28     </coreProcessor>
29
30     <!-- Serializer configuration, multiple serializers are supported -->
31     <serializers>
32         <!-- 
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!
46             Custom serializers:
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
49         -->
50         <serializer>javabuiltin</serializer>
51     </serializers>
52
53     <!-- Remoting configuration -->
54     <remoting>
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 -->
60         <transports>
61             <!-- multiple transports can be used concurrently (identified by the scheme) -->
62             <!-- 
63                 TCP Socket transport, with scheme (used to distinguish transports)
64                 standard synchronous socket I/O (java.io)
65             -->
66             <tcpsocket scheme="xvsm">
67                 <!-- 
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.
73                 -->
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>
79             </tcpsocket>
80             <!-- REST transport (EXPERIMENTAL!) -->
81             <!--
82             This transport requires the module mozartspaces-transport-rest-common and mozartspaces-transport-rest-jetty!
83             <rest scheme="http">
84                 <port>9877</port>
85             </rest> 
86             -->      
87             <!-- 
88                 other transports could be added, e.g. NIO (with Netty)                
89             -->
90         </transports>
91     </remoting>
92
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" -->
96
97     <!-- Security configuration (EXPERIMENTAL!) -->
98     <security>
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? -->
106         </authentication>
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>
111         </authorization>
112     </security>
113     
114     <!-- Persistence profile configuration -->
115     <persistence>
116         <!--
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!
127          -->
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>
133         <properties>
134             <property key="berkeley-location">/tmp/xvsm4</property>
135             <!-- 
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>
145             -->
146         </properties>
147     </persistence>
148     
149     <!-- Configuration of the entry copier -->
150     <!-- copyContext: should the request context also be copied? -->
151     <entryCopier copyContext="false">
152         
153         <!-- supported elements are one of the following elements: -->
154         
155         <!-- No entry copier, is the default and can be omitted -->
156         <!-- <none /> -->
157         
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 -->
161         
162         <!-- Cloning entry copier, entries need to implement MzsCloneable -->
163         <!-- <cloning /> -->
164     </entryCopier>
165
166     <!-- Configuration of custom coordinators -->
167     <coordinators>
168         <!-- This is an example for illustration. The AnyCoordinator is a predefined, integrated coordinator -->
169         <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! -->
180             <!-- 
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>
184              -->
185         </coordinator>
186     </coordinators>
187     
188     <!-- 
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.
192     -->
193     <capi3>javanative</capi3>
194
195 </mozartspacesCoreConfig>