# Coherence Tooling: Configuring Projects for Coherence

This section describes how to configure the Coherence facet, how to edit the Coherence launch configuraiton, how to edit the Coherence operational configuration, and how to edit the Coherence cache configuration.

## Configuring Coherence Facet

Oracle Coherence provides replicated and distributed data management and caching services on top of a peer-to-peer clustering protocol. OEPE provides a project facet that allows you to configure your dynamic Web projects to use Coherence.

To configure your project for Coherence:

1. Either add the Coherence facet when you create a project, or add the facet to an existing project by right-clicking your project in the Project Explorer and selecting Properties from the drop-down menu. This opens the Properties dialog, as Figure 1 shows.

2. In the Properties dialog, select Project Facets on the left panel, and then select Oracle Coherence from the Project Facet list.

   Click Further configuration required to open the Modify Faceted Project > Coherence dialog.

   If the Coherence library is listed as a user library, proceed as follows:

   - Select the Coherence library from the list.

   - Accept default settings.

   - Click OK.

   If you are using Oracle WebLogic Server 12c (12.1.2 or 12.1.3) runtime in your project, Coherence might already be installed on your machine if you chose this option at the server install time. In this case, the Coherence Library in Fusion Middleware Install option is available in the Library > Type list.

   If the Coherence library is not listed, you need to either point to an existing installation, or download the library.

   To point to an already downloaded Oracle Coherence library:

   1. Click the Manage User Library icon to open the Preferences > User Libraries dialog.

   2. Select a Java user library in the form of the coherence.jar, which represents the entire library.

      Note that the Coherence JAR files reside in the `\coherence\lib` directory of the Oracle Coherence installation. Also note that the same dialog allows you to fine-tune your Coherence library configuration.

   3. To obtain the Coherence library, click Download Library icon. This will open the Download Library dialog. To use this dialog to download the Coherence library, make appropriate selections, and then click Next to accept the terms of the library license, after which click Finish to trigger the download.

3. Click OK on the Modify Faceted Project > Coherence dialog.

4. By clicking Apply > OK on the Properties dialog, you will complete the configuration of the Coherence library for your project.

## Editing Coherence Launch Configuration

You use the Coherence launch configuration editor to set the most commonly used Coherence command line arguments.

To modify the Coherence launch configuration for your project configured with the Coherence facet:

1. Right-click your project in the Project Explorer, and then select Run As > Run Configurations from the drop-down menu to open the Run Configurations dialog.

2. Select Coherence Launch Configuration from the list. The right pane of the Run Configurations dialog displays instructions on how to use this dialog to configure Coherence launch settings. You follow these instructions by right-clicking the configuration node on the left pane and making an appropriate choice.

3. When a new configuration is created and selected, you can edit settings from the right pane as follows:

   - On the Main tab, define your project and its main class. Note that the Project and Main class fields are populated with default values and cannot be left empty.

   - On the Coherence tab, define all the general, XML, and other system properties:

     - The General subtab lets you define properties related to topology, logging, and network configurations.

     - The XML subtab lets you set the management type (such as local or remote), as well as configure JMX RMI, HTTP, and the refresh options.

     - The Other subtab lets you set a variety of properties.

     The Coherence launch configuration is populated with default settings from the `tangosol-coherence.xml` file in the `coherence.jar` file merged with the `tangosol-coherence-override.xml` file currently in the classpath, and, finally, with the VM arguments.

   - Complete the remaining tabs of the Run Configurations dialog.

   - Click Apply > Run on the Run Configurations dialog to complete the procedure. The Console view will display the Coherence run output.

The created Coherence XML files, such as `coherence-cache-config.xml`, `pof-config.xml`, and `tangosol-coherence-override.xml`, reside in your project's `src` directory.

## Editing Coherence Operational Configuration

OEPE provides an editor that you can use to modify the generated tangosol-coherence-override.xml Oracle Coherence deployment descriptor.

To modify operational configuration elements defined in the `tangosol-coherence-override.xml` file:

1. In the Project Explorer, right-click `src/tangosol-coherence-override.xml`, and select Open With > Coherence Override to open the Coherence Override editor.

2. In the editor, whose fields are populated with default settings, select the following types of settings to modify:

   - Cluster

   - Logging

   - Configurable Cache Factory

   - Management

   - Security

For information on Oracle Coherence operational configuration deployment descriptors and their elements, see "Operational Configuration Elements" in the Coherence Developer's Guide.

## Editing Coherence Cache Configuration

OEPE provides an editor that you can use to modify the generated `coherence-cache-config.xml` Oracle Coherence deployment descriptor.

To modify cache configuration elements defined in the `coherence-cache-config.xml` file:

1. In the Project Explorer, right-click `coherence-cache-config.xml`, and select Open With > Coherence Cache Configuration to open the Coherence Cache Configuration editor.

2. In the Coherence Cache Configuration editor, you can select the following types of cache configuration elements to modify:

   - General

   - Cache Scheme Mappings

   - Caching Schemes

For more information on Oracle Coherence cache configuration elements, see "Cache Configuration Elements" in the Oracle Coherence Developer's Guide.