Upload
darcy-owen
View
219
Download
7
Embed Size (px)
Citation preview
Requesting Geometry ServiceClara-2.x
Tutorial-4
By V. Gyurjyan
GeometryServiceTester class
package javaservices;
import org.jlab.clas12.tools.property.JProperty;import org.jlab.clas12.tools.property.JPropertyList;import org.jlab.coda.clara.core.JioSerial;import usr.JOrchestrator;
public class GeomServiceTester extends JOrchestrator {
/** * Constructor * @param name of this orchestrator */ public GeomServiceTester(String name){ super(name); }
GeometryServiceTester class
public static void main(String[] args){
// create an instance of this class GeomServiceTester gt = new GeomServiceTester(args[0]);
// create input transient data for the Geometry Service // Request property JProperty req = new JProperty("requesting_service", "gemc");
// system property JProperty sys = new JProperty("system", "dc");
GeometryServiceTester class
// property list creation JProperty[] arry = {req, sys}; JPropertyList pList = new JPropertyList(arry);
// create input data for the geometry service JioSerial inputData = new JioSerial(pList);
// sync request the service by sending the created input data JioSerial output = gt.syncRunService("CLAS12GeometryService", inputData, 10000);
// print the response from the geometry service System.out.println(output);
Compiling
javac -cp $CLARA_SERVICES/lib/Clara.jar:$CLARA_SERVICES/lib/jtools-1.0.jar:$CLARA_SERVICES/lib/cMsg-3.3.jar GeomServiceTester.java -d $CLARA_SERVCIES/
Running
java -cp "$CLARA_SERVICES/.:$CLARA_SERVICES/lib/*" javaservices.GeomServiceTester