A standalone instance of MozartSpaces can be started using org.xvsm.server.Server class. After downloading MozartSpaces-1.0-SNAPSHOT-all.jar MozartSpaces can be started using
$ java -cp MozartSpaces-1.0-SNAPSHOT-all.jar org.xvsm.server.Server
Optionally, the position of the configuration file can be set as parameter:
$ java -cp MozartSpaces-1.0-SNAPSHOT-all.jar org.xvsm.server.Server /etc/MozartSpacesConfiguratio.properties
MozartSpaces can be configured using a properties files. Per default, the file is called spaces.prop. MozartSpaces tries to find this file in the working directory during start up. If the file can not be found a new one is created containing default values for all properties. The position and the name of the configuration file can be modified as argument to the Server class.
Below some of the most important properties are described:
EnableRemoteAccess=true
Indicates whether the space shall be accessible via the network. This can be set to false if an embedded space shall only be accessible from the applications in the same virtual machine. For stand alone instances this property should always be set to true.
RemoteProtocols=TcpJava|TcpXML
A list of enabled protocols separated by "|". The names listed here will be used by MozartSpaces to find the uri, the listener, the sender and the marshaller for the transport (see below).
TcpJava means that a TCP connection is used to send/receive serialized java objects.
TcpXML means that a TCP connection is used to send/receive XML serialized messages.
TcpJava.uri=tcpjava\://localhost\:0
The uri of the TcpJava transport. This uri (including port) should be set to the host name or the IP address of the machine on which MozartSpaces is running. If the port is set to 0 a random port will be used, i.e., for stand alone instances the port should be set.
TcpJava.listener=org.xvsm.remote.tcpconnection.TcpConnectedTransport
The implementation of the Listener used by TcpJava.
TcpJava.sender=org.xvsm.remote.tcpconnection.TcpConnectedTransport
The implementation of the sender used by TcpJava.
TcpJava.marshaller=org.xvsm.remote.marshaller.JavaMarshaller
The marshaller used to serialize the message before sending and deserialize the received messages.
DefaultAnswerToProtocol=TcpJava
The protocol which shall be used to send answers to requests. This property is important for clients which send requests to a remote XVSM instance.
The following listing depicts an example configuration for a stand alone MozartSpace instance. The instance support TcpXML and TcpJava transports. The machine on which the instance is running has the IP address 192.168.1.1, TcpXML is listing on port 9876 and TcpJava on port 4321. Both transport use The TcpConntectedTransport implementation which implements the listener as well as the sender interface.
EnableRemoteAccess=true RemoteProtocols=TcpJava|TcpXML TcpJava.uri=tcpjava\://192.168.1.1\:4321 TcpJava.listener=org.xvsm.remote.tcpconnection.TcpConnectedTransport TcpJava.sender=org.xvsm.remote.tcpconnection.TcpConnectedTransport TcpJava.marshaller=org.xvsm.remote.marshaller.JavaMarshaller TcpXML.uri=tcpxml\://192.168.1.1\:9876 TcpXML.sender=org.xvsm.remote.tcpconnection.TcpConnectedTransport TcpXML.listener=org.xvsm.remote.tcpconnection.TcpConnectedTransport TcpXML.marshaller=org.xvsm.remote.marshaller.XMLMarshaller DefaultAnswerToProtocol=TcpXML SchedulerTimeoutDelay=500 ReplySenderThreads=100 SchedulerMaxThreads=1 EventProcessingThreads=100
Informations for users of MozartSpaces.