System properties are a way of communicating values from the runtime environment to Java; they are effectively Java's answer to environment variables. JSAMP defines some system properties which you can set to alter the way that it behaves.
If you are starting java from the command line, you can specify
these using java's
-D flag with the syntax
-Dname=value. Note that any such flags must occur
-jar flag on the command line.
For example, to request that JSAMP opens its default HTTP server
to listen on port 2112, you could invoke a JSAMP-using application
java -Djsamp.server.port=2112 -jar foo.jar
They will work the same way for JSAMP's command line tools, and for third-party applications which use the JSAMP library for SAMP communications.
System properties can also be set programmatically from within Java code. Note that in this case you may need to set these property values near the start of the application; in most cases they are only read once.
The following system properties may be used to affect JSAMP's behaviour. Listed alongside the property name is a link to the static public class member which may be used to refer to this property name in code: the javadocs so linked may provide more detail on use.
[hostname]: uses the host's fully qualified domain name
[hostnumber]: uses the host's IP number
internal: normal internal implementation
xml-log: internal implementation which logs all incoming and outgoing XML-RPC messages by writing their full XML form to standard output
rpc-log: internal implementation which logs all incoming and outgoing XML-RPC messages by writing an abbreviated form of their content to standard output
apache: implementation using Apache's XML-RPC library version 1.2; this requires the Apache xmlrpc-1.2b classes to be on the classpath
internalif this property is not specified. The implementations ought to behave the same as far as communications go, though there may be performance differences (the logging ones will be slower for sure). The logging implementations can be useful for debugging.
.samp" in the user's home directory, as defined by the SAMP Standard Profile, but if this property is set, it gives a different location to use. Note that any clients and hubs using a given non-standard value of this parameter will only be able to communicate with other clients/hubs using the same non-standard value.
standard" the SAMP Standard Profile will be used, and any other value will be interpreted as the name of a class which implements the ClientProfile interface.