Once everything is ready, we need to build, package and deploy the application.

The following JAR files need to be in your classpath, all of which reside in the <GigaSpaces Root>\lib directory or its subfolders:

  • JSpaces.jar
  • openspaces/openspaces.jar
  • spring/spring.jar
  • jini/jsk-platform.jar
  • jini/jsk-lib.jar

In order to deploy the application, we need to deploy each of the three Processing Units separately. To do this, every Processing Unit must be placed in the <GigaSpaces Root>\deploy directory. Every Processing Unit is actually a folder (whose name is the name of the Processing Unit later used for deployment) with several subfolders. Here's a typical Processing Unit directory as it resides under the <GigaSpaces Root>\deploy directory:

As the image shows, under the deploy folder of the product, we've put the pp-oms-client folder, which is in fact the application's Client Processing Unit. The folder name states the name of the Processing Unit.

Under META-INF\spring is our pu.xml file, relevant for the feeder Processing Unit. Also, directly under the deploy folder is our compiled code, with its appropriate package structure (the com folder in the image above).

Finally, the shared-lib folder includes all libraries that are used globally by this Processing Unit and potentially other Processing Units. In this case, shared-lib holds a JAR file that includes our domain model object. The same JAR is placed under the shared-lib folder of each of the Processing Units in our application.

To summarize the building and packaging process:

  1. Compile your code.
  2. Create a common JAR file for your shared libraries.
  3. Create a folder of the Processing Unit that complies with the structure shown in the image, and copy all the necessary files into it accordingly. Give the folder any name you want for this Processing Unit.
  4. Copy the created folder into the <GigaSpaces Root>\deploy directory.
  5. Repeat for every Processing Unit in the application.

The full example package also includes two prepared automated ways to build and compile the application:

Using supplied batch scripts for Windows/Unix:

  1. Run <Example Folder>\bin\compile.bat/.sh – compiles the modules and arranges their structure for deployment.
  2. Run <Example Folder>\bin\copy_to_deploy_folder.bat/.sh – copies the ready-to-deploy modules to the <GigaSpaces Root>\deploy folder.

Using supplied build.xml file and ant:

  1. Running build compiles all the different modules. In the case of the Client, Validator and Processor modules, build compiles the classes directly into their respective Processing Unit structure.
  2. Running dist finalizes the structure of all Processing Units by copying the common module JAR into the shared-lib directory in the Processing Unit structure.
    For example, in the client module, dist copies the JAR to client/pu/pp-oms-client/shared-lib, and makes client/pu/pp-oms-client a ready-to-use Processing Unit.
  3. Running copy-local-client, copy-local-validator and copy-local-processor copies the finalized Processing Units to the <GigaSpaces Root>\deploy folder, ready to be deployed into the Service Grid.
GigaSpaces.com - Legal Notice - 3rd Party Licenses - Site Map - API Docs - Forum - Downloads - Blog - White Papers - Contact Tech Writing - Gen. by Atlassian Confluence