A2.1 ITCS 4010/5010 Grid Computing, 2005, UNC-Charlotte, B. Wilkinson Assignment 2 “Simple” Grid Services Assignment.

Slides:



Advertisements
Similar presentations
A1.1 Assignment 1 “Deploying a Simple Web Service” ITCS 4010/5010 Grid Computing, UNC-Charlotte B. Wilkinson, 2005.
Advertisements

Service Data in Grid Services  Service Data allows us to easily include a set of structured data to any service, which can then be processed directly.
Chapter 1 Writing a Program Fall Class Overview Course Information –On the web page and Blackboard –
Grid Computing, Barry Wilkinson, 2004A3.1 Assignment 3 Simple Job Submission Using GRAM.
Mark Holliday and Barry Wilkinson, 2004A2.1 Assignment 2 “Simple” Grid Services Assignment.
Barry Wilkinson and Mark Holliday, 2004A1.1 Assignments Preliminaries Several computers are configured at WCU for the assignments. Here, terra.cs.wcu.edu.
A1.1 Assignment 1 “Deploying a Simple Web Service”
A3.1 Assignment 3 Simple Job Submission Using GT 4 GRAM.
Java Remote Object Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
7-2.1 Additional Features of WSRF/GT4 Services A brief outline © 2011 B. Wilkinson/Clayton Ferner. Fall 2011 Grid computing course. Modification date:
Assignment 2 Modifying, Compiling, and Deploying a Simple Service Presenter Information goes Here.
4a.1 Grid Computing Infrastructure Software ITCS 4146/5146, UNC-Charlotte, B. Wilkinson, 2007 Feb 16, 2007,
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
3b.1 Web Services Part II Implementation details ITCS 4010 Grid Computing, 2005, UNC-Charlotte, B. Wilkinson, slides 3b version 0.1.
4a.1 Grid Computing Standards ITCS 4010 Grid Computing, 2005, UNC-Charlotte, B. Wilkinson, slides 4a.
Lecture 10: Web Services. Outline Overview of Web Services Create a Web Service with Sun J2EE (JAX-RPC)
1 Workshop 20: Teaching a Hands-on Undergraduate Grid Computing Course SIGCSE The 41st ACM Technical Symposium on Computer Science Education Friday.
Assignment 1 “Deploying a Simple Web Service” Mark Holliday Department of Mathematics and Computer Science Western Carolina University.
4c1 GT 4 grid services and their implementation Advanced features: An overview Topics: Resource home Singleton resource Multiple resources Notifications.
Distributed Web Software  Presentation-based, e.g., dynamic web pages  Service-based – Web Services.
Java Remote Object Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
4c1 GT 4 Services Advanced features: A very brief overview Topics: Resource home Singleton resource Multiple resources Notifications Lifecycles Copyright.
Grid Computing, B. Wilkinson, 20046c.1 Globus III - Information Services.
Distributed Web Software Presentation-based, e.g., dynamic web pages Service-based – Web Services.
Includes slides borrowed freely from The Globus team Building Grid Services and The Globus Toolkit ® CISE : Globus Tutorial Anda Iamnitchi.
Web Services (tying it all together) and Introduction to Grid Services Concepts These slides are adapted from course material developed by Barry Wilkinson,
GT3 Tutorial Chapter 5, 6, and 7 Lecture for Cluster and Grid Computing, CSCE 490/590 Fall 2004, University of Arkansas, Dr. Amy Apon
1 Notes adapted from Barry Wilkinson Grid Computing Course UNCC Web Service Resource Framework Creating Globus 4 services.
Grid Computing, B. Wilkinson, 20043b.1 Web Services Part II.
4c.1 Grid Computing, B. Wilkinson, 2005 Web Service Resource Framework Creating Globus 4 services.
COP 4991 Component Based Software Development Lecture #4 Java Web Services Onyeka Ezenwoye.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
9th Lecture COP 4991 Component-Based Software Development Instructor: Masoud Sadjadi Developing Grid Services.
WSRF & WSRF’s Application in VO-DAS Haijun Tian ChinaVO
CS 584 Lecture 18 l Assignment » Glenda assignment extended to the Java RMI Deadline » No Java RMI Assignment l Test » Friday, Saturday, Monday.
REVIEW On Friday we explored Client-Server Applications with Sockets. Servers must create a ServerSocket object on a specific Port #. They then can wait.
LAB 1CSIS04021 Briefing on Assignment One & RMI Programming February 13, 2007.
Introduction to Globus Toolkit 4 at LA Grid CIS 6612 – Autonomic Grid Computing Summer 2006 PresentersFernando FarfánMayelin Felipe AgnosticsDiego LópezRamakrishna.
Introduction to Grid programming with Globus Toolkit 4 By Valentin Kravtsov and David Carmeli Combined from material provided by: Jennifer M. Schopf, Borja.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
Shannon Hastings Multiscale Computing Laboratory Department of Biomedical Informatics.
The Globus Toolkit 4 (GT4) A brief introduction. Web Services, WSRF, OGSA and GT4.
Java Remote Object Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
Grid Services I - Concepts
Introduction to Globus Toolkit 4 at LA Grid CIS 6612 – Autonomic Grid Computing Summer 2006 PresentersFernando FarfánMayelin Felipe AgnosticsDiego LópezRamakrishna.
1 Creating Web Services Presented by Ashraf Memon Hands-on Ghulam Memon, Longjiang Ding.
Java Remote Method Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
1 Java Remote Method Invocation java.rmi.* java.rmi.registry.* java.rmi.server.*
7-1.1 Grid Computing Infrastructure Software, © 2010 B. Wilkinson/Clayton Ferner. Spring 2010 Grid computing course. slides7-1.ppt Modification date: Feb.
Enabling Grids for E-sciencE Software installation and setup Viet Tran Institute of Informatics Slovakia.
How to Write a Grid Service  The grid service will do basic mathematical operations. The math grid service is going to have the following methods:  add:
GT3 Tutorial Chapter 3 and Chapter 4 Lecture for Cluster and Grid Computing, CSCE 490/590 Fall 2004, University of Arkansas, Dr. Amy Apon
Data Manipulation with Globus Toolkit Ivan Ivanovski TU München,
Creating Web Services Presented by Ashraf Memon Presented by Ashraf Memon.
Boolean expressions, part 1: Compare operators. Compare operators Compare operators compare 2 numerical values and return a Boolean (logical) value A.
Group 2 Aurora Cain Michael Liu Brian Rozier UNC Charlotte ITCS 4146 Spring 2007.
College Board Topics – A.P. Computer Science A Program Design - Read and understand a problem's description, purpose, and goals; Apply data abstraction.
UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick.
1 Lecture 15 Remote Method Invocation Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
WSTK Development toolkit for Java Implementation of Web Services By Keping Jia.
Netprog Java RMI1 Remote Method Invocation.
Net-centric Computing Web Services. Lecture Outline  What is Web Service  Web Service Architecture  Creating and using Java Web Services  Apache Axis.
November, 2006 Developing Service using GT4 Writing Your First Stateful Web Service in 5 Simple Steps Adam Belloum.
Programming in Java Transitioning from Alice. Becomes not myFirstMethod but …. public static void main (String[] arg) { // code for testing classes goes.
Principles of Software Development
Remote Method Invocation
Web Service Resource Framework Creating Globus 4 services
CS 584 Lecture 18 Assignment Glenda assignment extended to the Java RMI Deadline No Java RMI Assignment Test Friday, Saturday, Monday.
Additional Features of WSRF/GT4 Services
Presentation transcript:

A2.1 ITCS 4010/5010 Grid Computing, 2005, UNC-Charlotte, B. Wilkinson Assignment 2 “Simple” Grid Services Assignment

A2.2 GT 4 Stateful Web Services Preliminaries Web services as created in assignment 1 are stateless. Stateful web services required for grid computing. Obtained in WS-RF by having a web service front- end to a stateful “resource.”

A2.3 Web Service Resource Resource properties Client Web Service Resource Framework (WS-RF) Holds information retained between accesses.

A2.4 Assignment Goals Build on the Web Services assignment. Show how stateful WS-RF web services can be created using Globus 4.0 See the difference between stateful WS-RF web services and stateless Web services.

A2.5 Purpose of Service To store an integer value which can be acted upon by methods to: Get its value Increment its value (add one), and Decrement its value (subtract one). These methods are given. Further methods will be implemented. The service is stateful (the value is retained between accesses).

A2.6 Resource Properties In the code provided in assignment 2, there are actually two resource properties: Value -- an integer acted upon by the operations: add, sub, and getValueRP and “Last operation performed” -- a string holding the name of the last operation done, addition or subtraction, which is not used in assignment 2

A2.7 Math Web Service Resource Resource properties “value” (integer) “last operation performed” (string) Client Assignment 2 Resource Properties

A2.8 Steps in Assignment 2 Preliminary set-up. Define the Service Interface using WSDL Write the stateful web service code using Java Write the Deployment Descriptor Build the Math service Deploy the Math service Write and compile the client Start the container and execute the client Add functionality to the service

A2.9 WSDL and Service Implementation In Assignment 1, we wrote the service implementation first and then provided the WSDL description.

A2.10 Service Implementation In Assignment 2, we will start with the interface/WSDL and write the implementation second. This is a more appropriate way from a software engineering perspective, i.e. describe what we want to do first and do a specific implementation afterwards.

A2.11 Step 1: Preliminaries The files that you will need for this assignment are provided in a tar file: new_assignment2.tar.gz which you download. This tar includes specially written scripts.

A2.12 Step 2: Defining service Interface using WSDL WSDL file is provided in the tar file in: assignment2/schema/ examples/MathService_instance/Math.wsdl This file is discussed in detail in Assignment 2 “Presentation slides” and in lecture slides slides4c.

A2.13 Step 2 Implement Service Using Java Service is implemented in Java. Code provided in the tar file at: assignment2/org/globus/examples/services/ MathService/impl/MathImpl.java

A2.14 Service The code has two major parts: Resource properties Service code (methods) which are combined into one file for this assignment.

A2.15 Service – Resource Properties public class MathService implements Resource, ResourceProperties { private ResourcePropertySet propSet; /* Resource Property set */ private int value; private String lastOp; public MathService() throws RemoteException { /* RP Constructor */ this.propSet = new SimpleResourcePropertySet( MathQNames.RESOURCE_PROPERTIES); /* Create RP set */ try { /* Initialize the RP's */ ResourceProperty valueRP = new ReflectionResourceProperty( MathQNames.RP_VALUE, "Value", this); this.propSet.add(valueRP); setValue(0); ResourceProperty lastOpRP = new ReflectionResourceProperty( MathQNames.RP_LASTOP, "LastOp", this); this.propSet.add(lastOpRP); setLastOp("NONE"); } catch (Exception e) { throw new RuntimeException(e.getMessage()); } Resource Property code Resource properties

A2.16 /* Get/Setters for the RPs */ public int getValue() { return value; } public void setValue(int value) { this.value = value; } public String getLastOp() { return lastOp; } public void setLastOp(String lastOp) { this.lastOp = lastOp; } Service – Resource Properties methods

A2.17 Service code - methods /* Remotely-accessible operations */ public AddResponse add(int a) throws RemoteException { value += a; lastOp = "ADDITION"; return new AddResponse(); } public SubtractResponse subtract(int a) throws RemoteException { value -= a; lastOp = "SUBTRACTION"; return new SubtractResponse(); } public int getValueRP(GetValueRP params) throws RemoteException { return value; } /* Required by interface ResourceProperties */ public ResourcePropertySet getResourcePropertySet() { return this.propSet; }

A2.18 Step 4: Writing Deployment Descriptor Code for deployment descriptor for service is provided in: org/globus/services/ MathService/server-deploy.wsdd

A2.19 Step 5: Building Initial building in assignment 2 is done using (in essence) the GT4 command (script): globus-build-service This command is embedded in a script: build.sh which also includes a script called: nameChangeScript to rename student files to make them each unique.

A2.20 Step 6: Deploying Service Deployment is done using the GT4 command: globus-deploy-gar as user “globus”, using gar file created by globus-build-service.

A2.21 Step 7: Write and Compile Client public class Client { public static void main(String[] args) { MathServiceAddressingLocator locator = new MathServiceAddressingLocator(); try { String serviceURI = args[0]; EndpointReferenceType endpoint = new EndpointReferenceType(); endpoint.setAddress(new Address(serviceURI)); //service endpt ref. MathPortType math; math = locator.getMathPortTypePort(endpoint); // Get PortType math.add(10); // Perform an addition math.add(5); // Perform another addition System.out.println("Current value: " + math.getValueRP(new GetValueRP())); // Access value math.subtract(5); // Perform a subtraction System.out.println("Current value: " + math.getValueRP(new GetValueRP())); // Access value } catch (Exception e) { e.printStackTrace(); }

A2.22 Step 7 (continued) The code for the client is provided in: assignment2/org/globus/examples/clients /MathService_instance/Client.java Compile it using javac.

A2.23 Steps 8-9: Start Container As user globus, start Globus container on a TCP port not in use: globus-start-container -p 8081 This example assumes port 8081 is not in use; use netstat –t –all to see which ports are in use. MathService will be listed as two of the services that are available once the container has started.

A2.24 Step 10: Execute Client Execute client: java –classpath./build/classes/org/globus/examples/services/core/ yourusername_first/impl/:$CLASSPATH org/globus/examples/clients/MathService_instance/Client core/yourusername_first/MathService You will see the following result (hopefully): Current value: 15 Current value: 10

A2.25 Step 11 Undeploy sevice Deploy service in preparation to modifying it. As user Globus, issue command: globus-undeploy-gar with (re)named gar file.

A2.26 Step 12: Extend Functionality of Service Add a multiply method to your Math Service. Repeat all the steps to test it.

A2.27 Acknowledgment This assignment is derived from Borja Sotomayor’s Globus Toolkit 4 Programmer’s Tutorial: