##################################################################### # launchAppMan.py (Jython) # # Launches an Application Manager, uploads and runs printenv.py. # Version 1: XML uses JavaComp.sh. # # Example code by Albert L. Rossi, IU Extreme! Computing # December 2001 ##################################################################### import sys import cca from java.lang import * from jarray import * machine = "k2.extreme.indiana.edu" print "\ncreating component wrapper\n" xmlpath = "../xml/appMan.xml" componentProxy = cca.createComponent (xmlpath) print "\ninstantiating component on", machine, "\n" cca.setMachineName (componentProxy, machine) cca.setCreationMechanism (componentProxy, "gram") cca.createInstance (componentProxy) usesPortClassName = "samples.idl.scriptPort.UsesScriptPort" usesPortType = "http://www.extreme.indiana.edu/xcat/samples/wsdl#scriptPort" providesPortName = "scriptPortProvidesPort" print "\nuploading script\n" file = open("./printenv.py", "r") code = file.read() methodName = "runScript" methodParams = zeros(1, Object) methodParams[0] = code print "\nrunning script\n" cca.invokeMethodOnComponent(componentProxy, usesPortClassName, usesPortType, providesPortName, methodName, methodParams) print "\ndone\n" ## comment this out if you are running from a portal System.exit(0)