/** * CalculatorImplProvider.java * * This file was auto-generated by grid services tooling for the * Globus Toolkit * */ package DefaultNamespace; 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.impl.ogsi.GridServiceImpl; import org.globus.ogsa.ServiceData; import DefaultNamespace.CalculatorImplPortType; public class CalculatorImplProvider implements OperationProvider, GridServiceCallback { public static QName[] operations = new QName[] { new QName("http://DefaultNamespace", "add"), new QName("http://DefaultNamespace", "subtract"), }; private GridServiceBase base; private CalculatorImpl impl; static Log logger = LogFactory.getLog(CalculatorImplProvider.class.getName()); // Added by Purvesh private ServiceData serviceData; public CalculatorImplProvider() throws java.rmi.RemoteException { try { this.impl = new CalculatorImpl(); } catch (Exception e) { throw new java.rmi.RemoteException(e.getMessage()); } } public CalculatorImplProvider(CalculatorImpl 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()); serviceData = base.getServiceDataSet().create("DummySDE"); // Added by base.getServiceDataSet().add(serviceData); // Purvesh } 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 in0, int in1) throws java.rmi.RemoteException { serviceData.notifyChange(); // Added by Purvesh return this.impl.add(in0, in1); } public int subtract(int in0, int in1) throws java.rmi.RemoteException { serviceData.notifyChange(); // Added by PUrvesh return this.impl.subtract(in0, in1); } }