6
Requesting Geometry Service Clara-2.x Tutorial-4 By V. Gyurjyan

Requesting Geometry Service Clara-2.x Tutorial-4 By V. Gyurjyan

Embed Size (px)

Citation preview

Page 1: Requesting Geometry Service Clara-2.x Tutorial-4 By V. Gyurjyan

Requesting Geometry ServiceClara-2.x

Tutorial-4

By V. Gyurjyan

Page 2: Requesting Geometry Service Clara-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); }

Page 3: Requesting Geometry Service Clara-2.x Tutorial-4 By V. Gyurjyan

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");

Page 4: Requesting Geometry Service Clara-2.x Tutorial-4 By V. Gyurjyan

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);

Page 5: Requesting Geometry Service Clara-2.x Tutorial-4 By V. Gyurjyan

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/

Page 6: Requesting Geometry Service Clara-2.x Tutorial-4 By V. Gyurjyan

Running

java -cp "$CLARA_SERVICES/.:$CLARA_SERVICES/lib/*" javaservices.GeomServiceTester