BlueSpray - Help
© SchoonerTurtles, Inc. 2012-2015

Introduction
Contents
Getting Started
Download
Navigating
Tutorials
Scripting
Advanced
About

Controlling BlueSpray from the Command Line

Launching BlueSpray

BlueSpray is launched under the Java Virtual Machine (JVM) by specifying the command "java" on a computer that has the "JVM" installed. You'll typically want to specify the minimum amount of memory for BlueSpray with the "-XmsXXXm" parameter where "XXX" is the amount of memory in megabytes. You'll also want to specify the maximum amount of memory with "-XmxXXXm" where "XXX" is the amount of memory in megabytes. We recommend you set the minimum to about 512 unless you are running with a very small amount of memory (i.e. less than 1Gig) and set the maximum to less than the available amount of RAM available. On MS-Windows machines you may need to leave about between one and two Gig for the operating system and dedicate what remains as the maximum for BlueSpray. This will keep BlueSpray and it's data in RAM rather than swapping it out to disk and then back again. BlueSpray will swap out data as needed so setting the maximum memory too high will actually slow down BlueSpray.

After you specify the amount of memory, you specify the java program to run with "-jar". An example of launching BlueSpray on a computer with 2 Gig of RAM is:

java -Xms512m -Xmx1024m -jar BlueSpray.jar

By default, BlueSpray will launch it's graphical user interface (GUI) without any server support.

BlueSpray Execution Model

BlueSpray can run in three different ways:

  1. Graphical User Interface (GUI)
  2. Command Line Script
  3. HTTP Server

In theory, you could combine these (i.e. have the GUI up while having an HTTP server running in the background. However, this is only recommended for development.

Command Line Parameters

  • nogui – launches in command line mode (no GUI).
  • port=XXXX - opens an http port for server processing where 'XXXX' is the port number. This can be from script sent through HTTP with "jscript=ActualScriptContents" or sent as a regular HTTP request to process a file on the same server as BlueSpray (i.e. http://website.com/BlueSprayScript.js).
  • jsscript=C:/MyScripts/Script.js - runs a JavaScript right away. Needs to be full path to the script.
  • logfile=C:/Logs/log.txt - redirects BlueSpray's standard output stream to a file

Below is an example of launching BlueSpray to execute a script called "test.js".

java -Xms512m -Xmx1024m - jar BlueSpray.jar nogui jsscript=C:/test.js 

Running BlueSpray as an HTTP Server

BlueSpray can run as a "mini-web server" and will return static content such as HTML pages and images. This is really only recommended for development. In a ready environment we'd suggest using a standard web server such as Apache or Internet Information Server. BlueSpray as a server is really meant to be there behind the server to execute GIS web services and render a wide variety of data.

See the page on Running BlueSpray as a Server for more information.