/** * CalcProvider.java * * This file was auto-generated by grid services tooling for the * Globus Toolkit * */ package Calc; import java.rmi.RemoteException; import org.globus.ogsa.GridContext; import org.globus.ogsa.GridServiceCallback; import org.globus.ogsa.GridServiceException; import org.globus.ogsa.impl.core.service.ServiceDataAnnotation; import org.globus.ogsa.PersistentGridServiceCallback; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.globus.ogsa.OperationProvider; import org.globus.ogsa.GridServiceBase; import org.globus.ogsa.PersistentGridServiceBase; import javax.xml.namespace.QName; // Added by Purvesh import org.globus.ogsa.ServiceData; import Calc.CalcData.CalcDataType; public class CalcProvider implements OperationProvider, GridServiceCallback { public static QName[] operations = new QName[] { new QName("http://Calc", "add"), new QName("http://Calc", "subtract"), }; private GridServiceBase base; private Calc impl; static Log logger = LogFactory.getLog(CalcProvider.class.getName()); private ServiceData serviceData; // Addded by private CalcDataType calcData; // Purvesh public CalcProvider() throws java.rmi.RemoteException { try { this.impl = new Calc(); } catch (Exception e) { throw new java.rmi.RemoteException(e.getMessage()); } } public CalcProvider(Calc impl) { this.impl = impl; } public QName[] getOperations() { return operations; } public void initialize(GridServiceBase base) throws GridServiceException { this.base = base; } public void preCreate(GridServiceBase base) throws GridServiceException { } public void postCreate(GridContext context) throws GridServiceException { ServiceDataAnnotation.setupServiceData(this, this.base.getServiceDataSet()); // Added by Purvesh - Begin // Create Service Data Element serviceData = base.getServiceDataSet().create("CalcData"); // Set the value of the SDE to a CalcDataType instance calcData = new CalcDataType(); serviceData.setValue(calcData); // Set intial values of MathServiceData calcData.setVersion("0.0"); calcData.setAuthor("purshah"); calcData.setLastOp("NONE"); // Add SDE to Service Data Set base.getServiceDataSet().add(serviceData); // Added by Purvesh - End } public void activate(GridContext context) throws GridServiceException { } public void deactivate(GridContext context) throws GridServiceException { } public void preDestroy(GridContext context) throws GridServiceException { } public int add(int a, int b) throws java.rmi.RemoteException, org.gridforum.ogsi.FaultType { return this.impl.add(a, b); } public int subtract(int a, int b) throws java.rmi.RemoteException, org.gridforum.ogsi.FaultType { return this.impl.subtract(a, b); } }