awips2/edexOsgi/build.edex/opt/esb/js/HelloWorld.js
root 8e80217e59 Initial revision of AWIPS2 11.9.0-7p5
Former-commit-id: a02aeb236c [formerly 9f19e3f712] [formerly 06a8b51d6d [formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]
Former-commit-id: 06a8b51d6d
Former-commit-id: 3360eb6c5f
2012-01-06 08:55:05 -06:00

38 lines
No EOL
1 KiB
JavaScript

/**
* uEngine implementation of the clasic "Hello World" program.
* When executed by the uEngine, the message set but the client
* is logged to the Mule system log as an "info" level log entry.
* The message is also eche'd back to the client as part of the
* response message.
*
* This class represents the mid tier of the 3-tier scripting
* model used by uEngine.
*
* Usage:
* include("HelloWorld.js");
* var runner = new HelloWorld();
* runner.setMessage("Hello World from Omaha.");
* runner.execute();
*
*/
/* the class constructor */
function HelloWorld() {
this.message = "";
}
/* class methods */
function _execute() {
var logger = new SystemLog();
logger.log("info",this.message);
/* empty response */
var response = new MakeResponseGeneric(this.message);
return response.execute();
}
function _setMessage(text) {
this.message = text;
}
/* attach methods to class - w/aliases */
HelloWorld.prototype.execute = _execute;
HelloWorld.prototype.setMessage = _setMessage;