PRODUCTS AND SERVICES INDUSTRIES SUPPORT PARTNERS COMMUNITIES ABOUT
  The Coherence Incubator
  Coherence Incubator Examples
Added by Noah Arliss, last edited by Rob Misek on Oct 23, 2009  (view change)

Labels

 
(None)

Coherence Incubator Examples

The Coherence Incubator Examples project provides a collection of examples that demonstrate how to use various Incubator patterns. The 1.0.0 version of the examples project includes:

Dependencies

This project only depends on the required coherence versions and the underlying incubator patterns. All current patterns will ship with the Incubator Example project.

Outline

Release Name: Version 1.0.0: October 28th, 2009
Target Platforms: Java Standard Edition 5+
Requires Coherence Version:
(not included)
3.3.1+, 3.4+ or 3.5.2+
Dependencies:
(all included)
Coherence Common 1.5.0
Command Pattern 2.5.0
Functor Pattern 1.2.0
Messaging Pattern 2.5.0
Push Replication Pattern 2.5.0
Processing Pattern 1.1.0
Download:
(includes source code)
coherence-incubator-examples-1.0.0-src.zip
MD5:a37e09aa52afb36f1aaf11690398a3ed
Previous Releases: (none)

Incubator Examples Overview

The Incubator examples project provides a set of in depth examples relating to individual projects along with the infrastructure to easily execute them. The distribution ships with 4 main directories:

  • bin - Location of all scripts needed to build and execute the examples.
  • docs - Location of all the javadoc generated for the examples.
  • lib - Location of all the incubator jars that the examples depend on.
  • resource - Location of all the configuration and properties files used to execute the examples.
  • src - Location of all the source files for the examples.

NOTE: On Windows, the Incubator examples directory must not have spaces in the path. Unzip the examples zip file into a directory that doesn't have spaces in the path.

Setting the environment for the examples

The Incubator examples have to requirements in order to build or run. A supported copy of Coherence and Java 1.5+. Edit the set-env.sh or set-env.bat scripts in the bin directory to set:

  • COHERENCE_HOME - The location of your Coherence installation.
  • JAVA_HOME - The location of your Java 1.5+ installation.

With the environment variable set, run the set-env scripts in your environment (for example from the coherence-incubator-examples directory run . ./bin/set-env.sh)

Building the examples

Each set of examples is built individually based on the packages being built. From the command line you use the build-incubator scripts to build them. The scripts will build the examples and output the results into a classes directory. To build the examples you need to run build-incubator.(sh/cmd) <package-name> for example (bin/build-incubator.sh pushreplication).

Running the examples

Each set of examples will have a number of applications and cache servers that need to be run. Each individual process required for an example will have a corresponding properties file which will provide the set of configuration parameters required to start. The available configuration parameters are:

  • MAIN_CLASS - The main class to execute.
  • CACHE_CONFIGURATION_FILE - The cache configuration file to use.
  • CLUSTER_PORT - The cluster port to start a coherence server with.
  • MAIN_CLASS_ARGS - Quoted set of arguments to pass to the main class.
  • LOCAL_STORAGE - True to enable local storage.
  • COH_OPTS - Additional Java options that you want to set for Coherence.

Properties files for each example will be provided out of the box. The run-incubator.(sh|bat) scripts default the search location for properties files to being with the resource directory. To run an example you specify the relative path to the properties file from the resources directory. To run the command pattern proxy server you would run run-incubator.(sh|bat) commandpattern/proxy.properties.

The directory containing a properties file is included in the classpath when running an example. This means that all the configuration files in this directory are available at runtime.

Note that the scripts currently expect you to run them from the root directory of the examples project.