A coherence-application.xml Deployment Descriptor Elements

This appendix provides a complete reference for the elements in the Coherence application deployment descriptor coherence-application.xml.

This appendix includes the following sections:

coherence-application.xml Namespace Declaration and Schema Location

The Coherence application deployment descriptor schema is defined in the coherence-application.xsd file, which is located in the root of the coherence.jar library and at the following Web URL:

http://xmlns.oracle.com/coherence/coherence-application/1.0/coherence-application.xsd

The <coherence-application> element is the root element of the descriptor and includes the XSD reference, the namespace reference, and the location of the coherence-application.xsd file. For example:

<?xml version='1.0'?>
<coherence-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns="http://xmlns.oracle.com/coherence/coherence-application"
   xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-application 
   coherence-application.xsd">

application-lifecycle-listener

The application-lifecycle-listener elements specify the fully qualified name of a class or the initialization parameter that is required by the implementation.

The application-lifecycle-listener element specifies the fully qualified name of a class that implements the com.tangosol.application.LifeCycleListener interface. The class allows custom processing before and after the creation and destruction of Coherence cache and clustered services.

The following table describes the elements you can define within an application-lifecycle-listener element.

Table A-1 application-lifecycle-listener Elements

Element Required/ Optional Description

class-name

Required

Specifies the fully qualified name of a class that implements the com.tangosol.application.LifeCycleListener interface.

init-params

Optional

Specifies an initialization parameter that is required by the implementation. Any number of init-params elements may be defined.

cache-configuration-ref

The cache-configuration-ref element specifies the name and location of a Coherence cache configuration file. The location of the file is relative to the root directory within a Coherence Grid Archive (GAR). A URL may also be specified. If the file is not found, or if this element is not specified, then the predefined cache configuration file (coherence-cache-config.xml) that is located in the coherence.jar library on the system classpath is used by default.

Note:

If the configuration file is located in the root directory of the GAR, then it must not use the default file name (coherence-cache-config.xml); otherwise, the configuration file that is included in the coherence.jar file which is located in the system classpath is found first and the configuration file in the GAR is never loaded. An alternative to renaming the file is to place the configuration file in the META-INF directory of the GAR.

coherence-application

The coherence-application element is the root element of the Coherence application deployment descriptor.

The following table describes the elements you can define within a coherence-application element.

Table A-2 coherence-application Elements

Element Required/ Optional Description

cache-configuration-ref

Optional

Specifies the name and location of the Coherence cache configuration file.

pof-configuration-ref

Optional

Specifies the name and location of the Coherence Portable Object Format (POF) configuration file.

application-lifecycle-listener

Optional

Specifies the fully qualified name of a class that implements the com.tangosol.application.LifeCycleListener interface.

configurable-cache-factory-config

Optional

Specifies the fully qualified name of a class that implements the com.tangosol.net.ConfigurableCacheFactory interface.

configurable-cache-factory-config

The configurable-cache-factory-config element specifies the fully qualified name of a class that implements the com.tangosol.net.ConfigurableCacheFactory interface. The default implementation is the com.tangosol.net.ExtensibleConfigurableCacheFactory class.

Using a custom ConfigurableCacheFactory implementation is an advanced use case and is typically used to allow applications that are scoped by different class loaders to use separate cache configuration files.

The following table describes the elements you can define within a configurable-cache-factory-config element.

Table A-3 configurable-cache-factory-config Elements

Element Required/ Optional Description

class-name

Required

Specifies the fully qualified name of a class that implements the com.tangosol.net.ConfigurableCacheFactory interface.

init-params

Optional

Specifies an initialization parameter that is required by the implementation. Any number of init-params elements may be defined.

init-params

The init-params element specifies an initialization parameter. Any number of init-params elements may be defined.

The following table describes the elements you can define within an init-params element.

Table A-4 init-params Elements

Element Required/ Optional Description

param-type

Optional

Specifies the Java type of the initialization parameter.The following standard types are supported:

  • java.lang.String (string)

  • java.lang.Boolean (boolean)

  • java.lang.Integer (int)

  • java.lang.Long (long)

  • java.lang.Double (double)

  • java.math.BigDecimal

  • java.io.File

  • java.sql.Date

  • java.sql.Time

  • java.sql.Timestamp

param-value

Optional

Specifies the value of the initialization parameter. The value is in the format specific to the Java type of the parameter.

For example:

<init-params>
   <param-type>java.lang.String</param-type>
   <param-value>EmployeeTable</param-value>
</init-params>

pof-configuration-ref

The pof-configuration-ref element specifies the name and location of a Coherence POF configuration file. The location of the file is relative to the root directory within a Coherence Grid Archive (GAR). A URL may also be specified. If the file is not found, or if this element is not specified, then the predefined POF configuration file (pof-config.xml) that is located in the coherence.jar library on the system classpath is used by default.

Note:

If the configuration file is located in the root directory of the GAR, then it must not use the default file name (pof-config.xml); otherwise, the configuration file that is included in the coherence.jar file which is located in the system classpath is found first and the configuration file in the GAR is never loaded. An alternative to renaming the file is to place the configuration file in the META-INF directory of the GAR.