HPSearch

cgl.hpsearch.shell
Class ShellWS

java.lang.Object
  extended bycgl.hpsearch.shell.ShellWS

public class ShellWS
extends Object

ShellWS listens for requests. When a request arrives it runs the request thru the shell. The request is usually a URI of the script to be executed but optionally can also include the actual script.

 
 // Sample Script 
 w = new WSDL("http://localhost:28080/ShellWS?wsdl");
 a = w
 		.invoke(
 				"execute",
 				"a = 5; RETURN_VALUE=\"http://danube.ucs.indiana.edu:6011/deltaP.xyz\"",
 				"");
 
Created on Oct 4, 2004

Author:
Harshawardhan Gadgil (hgadgil@grids.ucs.indiana.edu)

Nested Class Summary
 class ShellWS.ScriptRunner
          A thread for executing scripts
Created on Mar 25, 2005
 
Constructor Summary
ShellWS()
           
 
Method Summary
 String execute(String script, String arguments)
          Executes the script passed as a parameter of the function
 String executeScript(String scriptURI, String arguments)
          Executes a script identified by its URI.
 String submit(String scriptURI, String arguments)
          Similar to executeScript.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShellWS

public ShellWS()
Method Detail

executeScript

public String executeScript(String scriptURI,
                            String arguments)
                     throws Exception
Executes a script identified by its URI. This method reads in the script from the URI and then executes the script. For example
 w = new WSDL("http://localhost:28080/ShellWS?wsdl");
 w.invoke("execute", "file://b\test.js", "1 2");
 

Parameters:
scriptURI - - The URI for the script
Returns:
Result of the script execution
Throws:
Exception

execute

public String execute(String script,
                      String arguments)
               throws Exception
Executes the script passed as a parameter of the function

Parameters:
script - The script
arguments - Optional arguments to the script execution, MUST be empty string if no arguments
Returns:
The result of the script execution
Throws:
Exception

submit

public String submit(String scriptURI,
                     String arguments)
Similar to executeScript. However this function submits a script for execution and returns immediately. The script is executed by a different thread.

Parameters:
scriptURI - - The URI for the script
Returns:
Result of the script execution

HPSearch

For comments and suggestions please send e-mail to Harshawardhan Gadgil
Last updated: June 9 2006