HelloWorld Service Clara-2.x Tutorial-2 By V. Gyurjyan.

Slides:



Advertisements
Similar presentations
Designing a Program & the Java Programming Language
Advertisements

4 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: Servlets.
CGI programming. Common Gateway Interface interface between web server and other programs (cgi scripts) information passed as environment variables passed.
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
OO Programming in Java Objectives for today: Overriding the toString() method Polymorphism & Dynamic Binding Interfaces Packages and Class Path.
METHOD OVERRIDING Sub class can override the methods defined by the super class. Overridden Methods in the sub classes should have same name, same signature.
1 OBJECTIVES To generate a web-based system enables to assemble model configurations. to submit these configurations on different.
Unit2: Object-oriented programming Getting started with Java Jin Sa.
COMP 14: Intro. to Intro. to Programming May 23, 2000 Nick Vallidis.
CS 117 Section 2 + KNET Computer accounts – ed to KNET students –Change password Homework 1 Lab Tutors –In lab for next 2 weeks –Will help you with.
Java CourseWinter 2009/10. Introduction Object oriented, imperative programming language. Developed: Inspired by C++ programming language.
Copyright 2013 by Pearson Education Building Java Programs Chapter 1 Lecture 1-1: Introduction; Basic Java Programs reading:
Copyright 2008 by Pearson Education Building Java Programs Chapter 1 Lecture 1-1: Introduction; Basic Java Programs reading: self-check: #1-14.
Threading in Java – a Tutorial QMUL IEEE SB. Why Threading When we need to run two tasks concurrently So multiple parts (>=2) of a program can run simultaneously.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
CSC 8505 Compiler Construction IR Example: Java Bytecode (looking inside class files)
Java 程序设计 Java Programming Fall, Contents for Today Java Program Structure  How to Compile a Java Program  How to Run a Java Program Environment.
Java RMI Essentials Based on Mastering RMI Rickard Oberg.
Java: Chapter 1 Computer Systems Computer Programming II.
CS 584 Lecture 18 l Assignment » Glenda assignment extended to the Java RMI Deadline » No Java RMI Assignment l Test » Friday, Saturday, Monday.
Requesting Geometry Service Clara-2.x Tutorial-4 By V. Gyurjyan.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
Jaeki Song ISQS6337 JAVA Lecture 03 Introduction to Java -The First Java Application-
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
POS 406 Java Technology And Beginning Java Code
Clement Allen, PhD Florida A&M University SUMMER 2006.
MACIASZEK, L.A. (2001): Requirements Analysis and System Design. Developing Information Systems with UML, Addison Wesley Chapter 6 - Tutorial Guided Tutorial.
IBM TSpaces Lab 1 Introduction. Summary TSpaces Overview Basic Definitions Basic primitive operations Reading/writing tuples in tuplespace HelloWorld.
Tutorial 1 Running JADE Under Eclipse Dr. Fuhua Lin School of Computing and Information Systems Athabasca University, Alberta, Canada Oct. 27, 2009.
JAVA PROGRAMMING BASICS CHAPTER 2. History of Java Begin with project Green in 1991 founded by Patrick Noughton, Mike Sheridan and James Gosling who worked.
4-Nov-15 Air Force Institute of Technology Electrical and Computer Engineering Object-Oriented Programming Design Topic 1: The Java Environment Maj Joel.
EIE375 BlueJ: Getting Started Dr Lawrence Cheung.
Checkout, Installation and Running Tutorial-1 By V. Gyurjyan.
1 Creating Web Services from a existing tool Presented by Ashraf Memon Hands-on Ashraf Memon, Ghulam Memon.
JAVA Programming “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
1 Creating Web Services Presented by Ashraf Memon Hands-on Ghulam Memon, Longjiang Ding.
SCI-BUS is supported by the FP7 Capacities Programme under contract no. RI CloudBroker Platform Tutorial Wibke Sudholt CloudBroker GmbH Technoparkstrasse.
Pengantar OOP Class-Java. 2 Software Development Tools Using Sun Java SDK alone Source File(s) (.java) Programmer Compiler (javac) Class File(s) (.class)
Overview of Java CSCI 392 Day One. Running C code vs Java code C Source Code C Compiler Object File (machine code) Library Files Linker Executable File.
1 Chapter 9a Abstract Classes & Dynamic Binding. 2 Abstract Classes All classes so far have been concrete classes –Classes that can be used to create.
V Gyurjyan, D Abbott, J Carbonneau, G Gilfoyle, D Heddle, G Heyes, S Paul, C Timmer, D Weygand V. Gyurjyan JLAB data acquisition and analysis group.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
Computer Programming A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return.
How CGI and Java Servlets are Run By David Stein 14 November 2006.
Java - hello world example public class HelloWorld { public static void main (String args[]) { System.out.println("Hello World"); }
Thomas Jefferson National Accelerator Facility Page 1 ClaRA Stress Test V. Gyurjyan S. Mancilla.
Bayu Priyambadha, S.Kom. Static content  Web Server delivers contents of a file (html) 1. Browser sends request to Web Server 3. Web Server sends HTML.
ITP 109 Week 2 Trina Gregory Introduction to Java.
Requesting Geometry Service Tutorial-2 By V. Gyurjyan.
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
Checkout, Installation and Running Tutorial-1 By V. Gyurjyan.
Introduction to 1. What is Java ? Sun Microsystems Java is a programming language and computing platform first released by Sun Microsystems in The.
Introduction to Java Programming by Laurie Murphy Revised 09/08/2016.
Copyright 2010 by Pearson Education APCS Building Java Programs Chapter 1 Lecture 1-1: Introduction; Basic Java Programs reading:
CPSC 233 Tutorial January 21 st /22 nd, Linux Commands.
Chapter 5 Introduction to Defining Classes Fundamentals of Java.
Electronic Commerce Java (1)
Basic concepts of C++ Presented by Prof. Satyajit De
Chapter No. : 1 Introduction to Java.
Clas12 Reconstruction and Analysis Framework
Introduction CSC 111.
Units with – James tedder
Units with – James tedder
CS 180 Assignment 6 Arrays.
CSE 142, Spring 2012 Building Java Programs Chapter 1
Zorah Fung University of Washington, Spring 2015
CLARA . What’s new? CLAS Collaboration Meeting. March 6, 2019
Zorah Fung University of Washington, Winter 2016
Presentation transcript:

HelloWorld Service Clara-2.x Tutorial-2 By V. Gyurjyan

Clara-2..x Design Concept Review  Cloud consists of distributed processes, called Clara- Data-Processing-Environment (JVM’s) running one in each computing node. Master Clara-Container is called Platform and runs administrative services.  Each Clara-Container runs a pub-sub server and contains one or many Service-Containers  Service-Container deploys one or many User-Engines as a services.

Clara-2.x naming Convention  Service Name : DPE-Host/Service-Container/User-Engine  Service-Container name is arbitrary (given by the user)  User-Engine name is defined by the engine developer and accessed through the Clara interface public String getName() { return ”myName” }

HelloWorldService class package examples.service; import org.jlab.clas12.tools.MimeType; import org.jlab.coda.clara.core.JioSerial; import org.jlab.coda.clara.system.CConstants; import org.jlab.coda.clara.system.CUtil; import org.jlab.coda.clara.user.JService; /** * Hello world service * Vardan Gyurjyan 2.x */ public class HelloWorldService extends JService {

HelloWorldService public String getName() { return "Hello"; public String getAuthor() { return "Gyurjyan"; public String getDescription() { return "Hello World service"; }

HelloWorldService public String getVersion() { return "1.0"; public String getLanguage() { return CConstants.LANG_JAVA; }

HelloWorldService public JioSerial execute(JioSerial[] data) { return null; public void configure(JioSerial data) { public void destruct() { }

HelloWorldService public JioSerial execute(JioSerial data) { // output transient data object JioSerial out = new JioSerial(); out.setLanguage(CConstants.LANG_JAVA); // check the input data mime-type if(data.getMimeType().type().equals(MimeType.STRING.type())){ // get the data content String inputDataObject = data.getStringObject(); // generate the output data out.setData(CUtil.getCurrentTime()+": Hello World from "+inputDataObject); out.setDataDescription("response to " + inputDataObject); out.setStatus(CConstants.info);

HelloWorldService class } else { // Reject with an execution status = error out.setData(CConstants.REJECT); out.setDataDescription("I can accept only strings"); out.setStatus(CConstants.error); } return out; }

Compiling javac -cp $CLARA_SERVICES/lib/Clara.jar:$CLARA_SERVICES/lib/j tools-1.0.jar:$CLARA_SERVICES/lib/cMsg-3.3.jar HelloWorldService.java -d $CLARA_SERVCIES/