coffeemeetsbagel review

3.4.2 Using the POF Configuration File System Property

3.4.2 Using the POF Configuration File System Property

The default pof-config.xml POF configuration file is located in the root of the coherence.jar library. Coherence is configured out-of-box to use the first pof-config.xml file that is found on the classpath. To use a different pof-config.xml file, the file must be located on the classpath and must precede the coherence.jar library; otherwise, the default pof-config.xml file that is located in the coherence.jar library is used.

The POF configuration file should be customized for a particular application. The default POF configuration file references the coherence-pof-config.xml file. This is where the Coherence specific user types are defined and should always be included when creating a POF configuration file.

The tangosol.pof.config system property is used to specify a custom POF configuration deployment descriptor to be used instead of the default pof-config.xml file. The system property provides an easy way to switch between different configurations and is convenient during development and testing.

Enter the name of the file as a value of the tangosol.pof.config system property. This is typically done as a -D Java option when starting a Coherence node. If the file is not located in the classpath, enter the full (or relative) path to the file and the name. The system property also supports the use of a URL when specifying the location of a POF configuration file.

The following example starts a cache server and specifies a POF configuration deployment descriptor called MyPOF.xml that is located in COHERENCE_HOME .