Skip navigation
Toggle Sidebar

Project Documentation

Roadmap

Future plans:

  • Make use of XAP 6.5's built in scripting support
  • Make use of configuration via Spring
  • More specific types of examples for various use cases/proof of concept

Installation Instructions

1) Copy the groovy-all-1.5.0.jar to your gshome lib/ext directory.
(This is just temporary until I work out why it was not found in the pu's lib or until I create a XAP 6.5 version).

2) Edit the setenv.bat file found in bin directory
3) Run bin\setenv.bat
4) Run bin\startSpace.bat
5) Start up  a GSM
6) Start up 3 or 4 GSCs
7) Type: build build
8) Type: build deploy

Usage Instructions

After you have edited the setenv.bat to match your configuration:

1) Run bin\setenv.bat
2) Run bin\startSpace.bat
3) Start up  a GSM
4) Start up 3 or 4 GSCs
5) Start up several puinstances of deploy\simpleScriptWorker 

Examples

For each command shell you start, run "bin\setenv.bat" and try the following examples. 

SumOfRange Demo (Groovy Script Compute Farm)

bin\sumofrange

The SumOfRange demo generates a set of tasks (a combination of input arguments and a script) for the SimpleWorker to perform and then collects those results and combines them into the final result.  The script to be executed is sent in the form of a string, allowing new tasks to be generated at run time if necessary. The specific task performed is the sum of numbers over the range of 1 to 500.

The SimpleWorker is a Java program which runs in the processing unit, waiting for Groovy scripts to be sent to it through the space, which it executes and returns the results. It uses Groovy's GroovyShell class to evaluate it. The results are passed in and out via Maps, allowing plain Java processing units and scripts to use the SimpleWorker without needing any special Groovy methods.

Screenshots
(view as slideshow)
   
 
 

JDBC Demo

The jdbcDemo is a Groovy script, which uses the Gigaspaces JDBC driver to write, read, and delete entries from the space. Given the scripting nature of Groovy, it's easy to use SQL and file access mechanisms, variations of this script would be useful in test environments for loading and extracting test data to and from the space, either with static data from files or dynamically generated data.

Additional Scripts

In addition, to these scripts, two additional batch files are in included in the bin directory, groovyspaceconsole.bat and groovyspaceshell.bat, which setup the environment variables and then call groovyconsole and groovyshell, respectively. This is more of a convenience, which allows you to interactively work on your Groovy scripts, while giving you access to the Gigaspaces classes.

bin\groovyspaceconsole starts up a groovy console, with all of the Gigaspaces classes in the classpath, to allow for
easy testing and experimentation

bin\groovyspaceshell starts up a groovy console, with all of the Gigaspaces classes in the classpath, to allow for
easy testing and experimentation

Adaptavist Theme Builder Powered by Atlassian Confluence