Command Line Setting Override Feature

Command Line Setting Override Feature

Both the Coherence Operational Configuration deployment descriptor and the Coherence Cache Configuration deployment descriptor support the ability to assign java command line option name to any element defined in the descriptor. Some of the elements already have these Command Line Setting Overrides defined. You can create your own or change the ones that are already defined.

This feature is very useful when you need to change the settings just for a single JVM, or be able to start different applications with different settings without making them use different descriptors. The most commonplace application is passing different multicast address and/or port to allow different applications to create separate clusters.

To create a Commmand Line Setting Override all you need to do is add system-property attribute specifying the string you would like to assign as the name for the java command line option to the element you want to create an override to. Then you just need to specify it in the java command line prepended with "-D".

For example:

Let's say that we want to create an override for the IP address of the multi-home server to avoid using the default localhost, and instead specify a specific the IP address of the interface we want Coherence to use (let's say it is 192.168.0.301). We would like to call this override tangosol.coherence.localhost.

In order to do that we first add a system-property to the cluster-config/unicast-listener/address element:

<address>localhost</address>

which will look as follows with the property we added:

<address system-property="tangosol.coherence.localhost">localhost</address>

Then we use it by modifying our java command line:

java -jar coherence.jar

to specify our address 192.168.0.301 (instead of the default localhost specified in the configuration) as follows:

java -Dtangosol.coherence.localhost=192.168.0.301 -jar coherence.jar

The following table details all the preconfigured overrides:

Override Option Setting
tangosol.coherence.clustername Cluster name
tangosol.coherence.localhost Unicast IP address
tangosol.coherence.localport Unicast IP port
tangosol.coherence.localport.adjust Unicast IP port auto assignment
tangosol.coherence.clusteraddress Cluster (multicast) IP address
tangosol.coherence.clusterport Cluster (multicast) IP port
tangosol.coherence.wka Well known IP address
tangosol.coherence.wka.port Well known IP port
tangosol.coherence.ttl Multicast packet time to live (TTL)
tangosol.coherence.tcpring TCP Ring enabled flag
tangosol.coherence.shutdownhook Shutdown listener action
tangosol.coherence.log Logging destination
tangosol.coherence.log.level Logging level
tangosol.coherence.log.limit Log output character limit
tangosol.coherence.cacheconfig Cache configuration descriptor filename
tangosol.coherence.management JMX management mode
tangosol.coherence.management.remote Remote JMX management enabled flag
tangosol.coherence.management.readonly JMX management read-only flag
tangosol.coherence.security Cache access security enabled flag
tangosol.coherence.security.keystore Security access controller keystore file name
tangosol.coherence.security.permissions Security access controller permissions file name