Prism-MW Tutorial CS 795 / SWE 699 Sam Malek Spring 2010.

Slides:



Advertisements
Similar presentations
1 G54PRG Programming Lecture 1 Amadeo Ascó Adam Moore 29 Organising Code: Packages & Archives.
Advertisements

A Tailorable Environment for Assessing the Quality of Deployment Architectures in Highly Distributed Settings Sam Malek and Marija Mikic-Rakic Nels Beckman.
Processing and Java David Meredith
Informer Extensions PRESENTER: Brad Leupen | CTO, Entrinsik |
Picture It Very Basic Game Picture Pepper. Original Game import java.util.Scanner; public class Game { public static void main() { Scanner scan=new Scanner(System.in);
A component- and message-based architectural style for GUI software
SORTING AND ASYMPTOTIC COMPLEXITY Lecture 12 CS2110 – Spring 2014 File searchSortAlgorithms.zip on course website (lecture notes for lectures 12, 13) contains.
Overview of Prism-MW CS 795 / SWE 699 Sam Malek Spring 2010.
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.
Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
Object Oriented Programming in Java George Mason University Fall 2011
Extensibility, Safety and Performance in the SPIN Operating System Presented by Allen Kerr.
Data Structures Lecture 1 Fang Yu Department of Management Information Systems National Chengchi University Fall 2011.
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.
Java Beans & Serialization CS-328 Dick Steflik. Java Beans Java based component technology –originally developed to provide java with a component technology.
1 Web Services – Part II CS , Spring 2008/9.
Java Tutorial – Building GUIs Java with Added Swing Daniel Bryant
Introduction to Java Lab CS110A – Lab Section 004 Instructor: Duo Wei.
Prism-MW Tutorial. From Architecture to Design 2.
University of Southern California Center for Systems and Software Engineering From Dependable Architectures To Dependable Systems Nenad Medvidovic Center.
Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Tomcat Celsina Bignoli History of Tomcat Tomcat is the result of the integration of two groups of developers. – JServ, an open source.
Thammanoon Kawinfruangfukul CSSE MS, ID: Middleware.
Developing User Interfaces (DUI) Chris North cs3724: HCI.
Programming in Java; Instructor:Moorthy Introduction, Objects, Classes, Libraries1 Programming in Java Introduction.
Introduction to the JBoss Presented by: Hao Shi. Agenda Application Servers What is JBoss JBoss features Architecture of JBoss Installation and running.
An program As a simple example of socket programming we can implement a program that sends to a remote site As a simple example of socket.
Ali Shahrokni Application Components Activities Services Content providers Broadcast receivers.
International Conference on Software Engineering 2007
A Style-Aware Architectural Middleware for Resource-Constrained, Distributed Systems CS 5381 Steven Ruiz Authors: Sam Malek, Marija Mikic-Rakic, and Nenad.
COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.
LAB 1CSIS04021 Briefing on Assignment One & RMI Programming February 13, 2007.
IBM TSpaces Lab 1 Introduction. Summary TSpaces Overview Basic Definitions Basic primitive operations Reading/writing tuples in tuplespace HelloWorld.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
CS390- Unix Programming Environment CS 390 Unix Programming Environment Java Socket Programming.
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing with Graphics.
An Introduction to Programming and Object Oriented Design using Java 3 rd Edition. Dec 2007 Jaime Niño Frederick Hosch Chapter 18 Integrating user interface.
JAVA Programming “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
CS 4244: Internet Programming Network Programming in Java 1.0.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
Networking Implementations (part 1) CPS210 Spring 2006.
Testing in Android. Methods Unit Testing Integration Testing System Testing Regression Testing Compatibility Testing Black Box (Functional) White Box.
Computer Science I Programming in Java (programming using Processing IN Java, using IntelliJ IDE) Classwork/Homework: copy your Processing projects over.
Java and C++ Transitioning. A simple example public class HelloWorldApp { public static void main(String[] args) { //Display the string. System.out.println("Hello.
GT3 Tutorial Chapter 3 and Chapter 4 Lecture for Cluster and Grid Computing, CSCE 490/590 Fall 2004, University of Arkansas, Dr. Amy Apon
Creating Web Services Presented by Ashraf Memon Presented by Ashraf Memon.
Threads, SMP and Microkernels Process vs. thread: –Unit of resource ownership (process has virtual address space, memory, I/O channels, files) –Unit of.
2.2 Threads  Process: address space + code execution  There is no law that states that a process cannot have more than one “line” of execution.  Threads:
Debugging RTC CLI in Eclipse
Eclipse.
Principles of Software Development
Threads vs. Events SEDA – An Event Model 5204 – Operating Systems.
Updatecenter Module 3 Application Server SE/EE 8.1 Installation
Lecture 7: Android Services
Chapter 5 Remote Procedure Call
Google Web Toolkit Tutorial
Updatecenter Snjezana Sevo-Zenzerovic
Block 15 Developing the Calculator application
Java Remote Method Invocation (RMI)
RADE new features via JAVA
J2EE Application Development
Java External Libraries & Case Study
JavaServer Faces: The Fundamentals
class PrintOnetoTen { public static void main(String args[]) {
Java Tutorial – Application Building
(Computer fundamental Lab)
Developing Java Applications with NetBeans
Developing Java Applications with NetBeans
Software Engineering and Architecture
Message Passing Systems
Presentation transcript:

Prism-MW Tutorial CS 795 / SWE 699 Sam Malek Spring 2010

Prism-MW Download Prism-MW 2.1 source code from Compile and develop your code on top of it Alternatively, you could download Prism-MW Jar file and set the appropriate class paths The easiest way to compile the source code is to use Eclipse –You can download the eclipse from: –Create a Java project and import the source code –Eclipse will automatically compile the code for you

Package Structure Prism –Benchmark –Core –Exception –Extensions Architecture Component Connector Evt Port –Style –Test Core Extensible_port real_time Style Packages you would need to be familiar with

Simple Calculator

Simple Calculator – Single Address Space 1/2 package Prism.test.core; import Prism.core.*; import Prism.test.*; class testArchLocally { static public void main(String argv[]) { FIFOScheduler sched = new FIFOScheduler(100); Scaffold s = new Scaffold(); RRobinDispatcher disp = new RRobinDispatcher(sched, 10); s.dispatcher=disp; s.scheduler=sched; Architecture arch = new Architecture("Demo"); arch.scaffold=s; AbstractImplementation addition = new Addition(); Component t = new Component("add", addition); t.scaffold=s; AbstractImplementation subtract = new Subtract(); Component sub = new Component("Sub", subtract); sub.scaffold=s; GUI gui = new GUI(); Component b = new Component("GUI", gui); b.scaffold=s; Connector conn1 = new Connector("conn1"); conn1.scaffold =s; arch.add(b); arch.add(conn1); arch.add(t); arch.add(sub); Creates an event queue of 100 events A data structure that is associated with the scheduler and dispatcher, may be used for monitoring and so on Creates 10 threads for processing events Creates the architecture object Creates addition, subtraction, and gui components; also attaches them to the scaffold Creates the connector Adds components and connector to the architecture

Simple Calculator – Single Address Space 2/2 Port subReplyPort = new Port("subReplyPort", PrismConstants.REPLY); sub.addCompPort (subReplyPort); Port conn1RequestPort1 = new Port("conn1RequestPort1", PrismConstants.REQUEST); conn1.addConnPort(conn1RequestPort1); arch.weld(subReplyPort, conn1RequestPort1); Port tReplyPort = new Port("tReplyPort", PrismConstants.REPLY); t.addCompPort(tReplyPort); Port conn1RequestPort2 = new Port("conn1RequestPort2", PrismConstants.REQUEST); conn1.addConnPort(conn1RequestPort2); arch.weld(tReplyPort, conn1RequestPort2); Port bRequestPort = new Port ("bRequestPort", PrismConstants.REQUEST); b.addCompPort(bRequestPort); Port conn1ReplyPort1 = new Port("conn1ReplyPort1", PrismConstants.REPLY); conn1.addConnPort(conn1ReplyPort1); arch.weld(bRequestPort, conn1ReplyPort1); disp.start(); arch.start(); } Creates the ports and attaches them to the appropriate component/connector Start the dispatcher (threads) and then the architecture

Simple Calculator – Distributed

Client Side – GUI Component String hostName = "localhost"; int portNum = 2601; FIFOScheduler sched = new FIFOScheduler(100); Scaffold s = new Scaffold(); RRobinDispatcher disp = new RRobinDispatcher(sched, 10); s.dispatcher=disp; s.scheduler=sched; Architecture arch = new Architecture("Demo1"); arch.scaffold=s; Connector conn=new Connector("conn"); conn.scaffold=s; ExtensiblePort ep = new ExtensiblePort ("ep", PrismConstants.REQUEST); SocketDistribution sd=new SocketDistribution(ep); ep.addDistributionModule(sd); ep.scaffold = s; conn.addConnPort(ep); GUI gui = new GUI(); Component b = new Component("GUI", gui); b.scaffold=s; arch.add(conn); arch.add(b); arch.add(ep); Port bRequestPort = new Port("bRequestPort", PrismConstants.REQUEST); b.addCompPort(bRequestPort); Port connReplyPort = new Port("connReplyPort", PrismConstants.REPLY); conn.addConnPort(connReplyPort); arch.weld(bRequestPort, connReplyPort); disp.start(); arch.start(); ep.connect(hostName, portNum);

Server Side – Addition Component int portNum = 2601; FIFOScheduler sched = new FIFOScheduler(100); Scaffold s = new Scaffold(); RRobinDispatcher disp = new RRobinDispatcher(sched, 10); s.dispatcher=disp; s.scheduler=sched; Architecture arch = new Architecture("Demo"); arch.scaffold=s; Connector conn=new Connector("conn"); conn.scaffold=s; ExtensiblePort ep = new ExtensiblePort("ep", PrismConstants.REPLY); SocketDistribution sd=new SocketDistribution(ep, portNum); ep.addDistributionModule(sd); ep.scaffold = s; conn.addConnPort(ep); Addition addition = new Addition(); Component t = new Component("Add", addition); t.scaffold=s; arch.add(conn); arch.add(t); arch.add(ep); Port tReplyPort = new Port ("tReplyPort", PrismConstants.REPLY); t.addCompPort(tReplyPort); Port connRequestPort = new Port("connRequestPort", PrismConstants.REQUEST); conn.addConnPort(connRequestPort); arch.weld(tReplyPort, connRequestPort); disp.start(); arch.start();