- Page restrictions apply
- Added by Rob Misek, last edited by David Guy on Sep 13, 2011 (view change)
| The Java example must be built (and run) even for .NET and C++ because the cache server runs in Java. In order to run the example, see How to Build the Examples. |
First, unzip the example source into an "examples" directory.
Prerequisites
In order to build the example, you must have Coherence version 3.7 and a Java
development kit (JDK) 1.6 or greater.
$COHERENCE_HOME
Make sure that the COHERENCE_HOME environment variable points to the location of the unpacked Coherence 3.7
directory.
$JAVA_HOME
Make sure that the JAVA_HOME environment variable points to the location of a 1.6 or greater JDK before
building the example. A Java runtime 1.6 or greater is needed to run the example.
Directory Structure
The directory structure described below is relative to the "examples" directory.
java/bin
Scripts for building and executing the example. There are two sets of scripts. Scripts with no file extension
are bash scripts. Scripts with a .cmd file extension are Windows command scripts. The following description
refers to the script names without specifying the file extension.
| script name | purpose |
|---|---|
| build | builds an example |
java/src
All example source. The examples are in the com.tangosol.examples.<example name> package. The classes
for objects stored in the cache are in the com.tangosol.examples.pof package.
java/classes
The class files output from a build. This directory will not exist until the build
script is executed.
java/resource/config
The common coherence configuration files required by the examples.
java/resource/<example name>
If an example has configuration that is required instead of the common configuration, it will
have its own directory. The security example uses configuration files from java/resource/security.
$COHERENCE_HOME/lib
Coherence libraries used for compiling and running the example.
Build Instructions
Execute the build script with the name of the example collection: "bin/build contacts" or "bin/build security".
The script will build the POF package files and then the files for the particular example. On Windows, change directories to the /bin directory then run the scripts.
Prerequisites
In order to build the example, you must have Coherence version 3.7 or later for .NET and Visual Studio 2008
or later or Visual Studio 2008 Express or later.
To run the example, you will need the Java version of Coherence 3.7 or later and a Java
development kit (JDK) 1.6 or greater. The Java version is required because the Coherence*Extend proxy and
cache servers require Java. Also, the examples depend on Java example classes that must be built before running
the proxy and cache server. See the Java example readme.txt for instructions on how to build and run. Note that
the Java run-proxy script must be executed; the Java run-cache-server is optional because the proxy is storage
enabled.
Directory Structure
The directory structure described below is relative to the "examples" directory.
dotnet\src
All example source. The examples are in the Tangosol.Examples.<example name> namespace. The classes
for objects stored in the cache are in the angosol.Examples.Pof namespace.
The examples are in the Visual Studio 2008 examples solution. Each example has its own Visual Studio 2008
project in the src directory. For example, src contains projects for the contacts and security examples
The coherence configuration files required by the example.
The coherence configuration files required by the example.
src\pof\config
The common coherence configuration files required by the examples.
src\<example name>\config
If an example has configuration that is required instead of the common configuration, it will
have its own directory. The security example uses configuration files from security\config.
Build Instructions
Open the examples project from the examples\dotnet\src\contacts.csproj directory with Visual Studio
When installing Coherence 3.7 for the .NET Framework, the installer registers the coherence.dll library with the assembly registry. The included Visual Studio projects have a reference to coherence.dll in the default location. If another version of the library is desired or it was not installed in the default location, the Coherence reference can be overridden when configuring the reference, be sure to set the "local copy" attribute to true. This setting will copy and register the correct coherence.dll in the bin\debug directory.
After the desired Coherence 3.7 for .NET is configured, in Visual Studio select Build->Build Solution from
the menu, "Build Solution (F6)", etc to build the solution.
The build for the contacts example will copy resource\contacts.csv to the build output directory (examples\dotnet\src\bin\Debug).
Prerequisites
To run the examples, you will need the Java version of Coherence 3.7 or later and a Java
development kit (JDK) 1.6 or greater. The Java version is required because the Coherence*Extend proxy and
cache servers require Java. Also, the examples depend on Java example classes that must be built before running
the proxy and cache server. See the Java examples readme.txt for instructions on how to build and run. Note that
the Java run-proxy script must be executed; the Java run-cache-server is optional because the proxy is storage
enabled.
%COHERENCE_HOME%
Make sure that the COHERENCE_HOME environment variable points to the location of the unpacked Coherence 3.7
(or later) directory.
%JAVA_HOME%
Make sure that the JAVA_HOME environment variable points to the location of a 1.6 or greater JDK before
building the examples. A Java runtime 1.6 or greater is needed to run the examples.
%COHERENCE_CPP_HOME%
Make sure that the COHERENCE_CPP_HOME environment variable points to the location of the unpacked C++
development environment.
Compiler enviroments supported.
Directory Structure
The directory structure described below is relative to the "examples" directory.
cpp\bin
Scripts for building and executing the examples. Scripts with no file extension
are bash scripts. Scripts with a .cmd file extension are Windows command scripts. The following description
refers to the script names without specifying any file extension.
cpp
All example source organized under the <example name> (such as contacts and security) and pof directories.
cpp\contacts
The contacts example source. The examples are in the coherence::examples namespace. The next level of the name after examples represents a related set of example classes. "Driver" in coherence::examples::LoaderExample is the Loader for the contacts example. In other words, the name of the example is the name after coherence::examples.
cpp\security
The security example source. The examples are in the coherence::examples namespace.
cpp\pof
The data model is represented in this directory plus any classes that are serialized. The rationale is to show how to utilize an already existing data model and exposing it in Coherence. The model classes do not contain any Coherence specific code to prove this point. However there is a serializer that is associated with each model type. For example the Contact has a ContactSerializer class which purpose is to create register the model type with Coherence and serialization operations.
The generated output will be in the form of a dynamic library.
cpp\config
The common coherence configuration files required by the examples.
cpp\config\<example name?
If an example has configuration that is required instead of the common configuration, it will
have its own directory. The security example uses configuration files from config/security.
cpp\<example name>\out
The object files output from a build. This directory will not exist until the build script is executed.
%COHERENCE_CPP_HOME%\include
Contains the Coherence header files.
%COHERENCE_CPP_HOME%\lib
Contains the coherence library.
Build Instructions
For Windows
Open a development environment command prompt. This should have been installed with Visual Studio or the platform SDK. Go to the C++ examples directory and type "bin\build.cmd <example name>". This will build both the pof (model) and the example executable. For example, "bin\build.cmd contacts" or
"bin\build.cmd security"
The model will put the pof.lib and pof.dll file under cpp\pof\out. These are needed for building and running the contacts and security examples
The executable contacts.exe will be generated in cpp\contacts\out directory. The executable security.exe will be generated in cpp\security\out directory.
To run the contacts example type "bin\run.cmd contacts" after starting a proxy server - "java\bin\run-proxy" and and additional cache server - "java\bin\run-cache-server".
As an alternative, in any command window you can cd to the C++ bin directory and run vcvars32.bat before trying to build the examples. With a default install of Visual Studio, the bin dir is "C:\Program Files\Mircorsoft Visual Studio 9.0\vc\bin". Then follow the previous instructions for running the build script.
For Linux/Mac and Solaris
Open a command shell. Go to the C++ examples directory and type "bin/build <example name>". This will build both the pof (model) and the contacts examples executable.
The model dynamic library and lib file will be put in cpp/pof/out. These are needed for building and running the contacts and security examples.
The executable contacts, will be generated in cpp/contacts/out or cpp/security/out.