Presentation is loading. Please wait.

Presentation is loading. Please wait.

UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 3 HW#1 Jini Overview C++ Diagnostic Results.

Similar presentations


Presentation on theme: "UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 3 HW#1 Jini Overview C++ Diagnostic Results."— Presentation transcript:

1 UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 3 HW#1 Jini Overview C++ Diagnostic Results Mon. 9/11/00

2 Web Page http://www.cs.uml.edu/~kdaniels/courses/java2000.html Web Page new

3 Question from Last Lecture... ä What is socket-based communication? ä In a Java context, Deitel answers this on p. 936 in introduction to Servlets. Java has networking support for: ä “socket-based communications that enable applications to view networking as streams of data - a program can read from a socket or write to a socket as simply as reading or writing to a file.” ä “packet-based communications that enable individual packets of information to be transmitted - commonly used to transmit audio and video over the Internet.” ä Chapter 21 of Deitel treats Java networking

4 Homework #1

5 Wed, 9/6 Fri, 9/8 Read Ch 1 (Deitel) Fri, 9/8 Mon, 9/11 Read Ch 1, 2 (Edwards) Fri, 9/8 Mon, 9/11 Read Ch 1, 2 (Edwards) Fri, 9/15 Read Ch 2, 3 (Deitel) Fri, 9/15 Read Ch 2, 3 (Deitel) Fri, 9/15 Assignment #1, Part 1 Fri, 9/15 Assignment #1, Part 1 short-answer questions short-answer questions Mon, 9/18 Assignment #1, Part 2 “Hello World” programming Mon, 9/18 Assignment #1, Part 2 “Hello World” programming (application and applet) (application and applet) Assigned Due Content Assigned Due Content Homework is due at the start of lecture on the due date.

6 Introduction to Java Applications ä Java application is executed using the Java interpreter (but not inside browser like an applet) ä Application begins execution in main() ä main() is static method inside class // Save this in file Welcome1.java public class Welcome1{ public static void main( String args[] ) public static void main( String args[] ) { System.out.println( "Java is fun!" ); System.out.println( "Java is fun!" ); }} javac Welcome1.java java Welcome1 Welcome1.class Welcome1.java Similar application code is on p.36 of Deitel, Chapter 2

7 HW#1 HelloWorld Application ä Refer to p. 36 of Deitel, Chapter 2 for their Welcome1.java application ä Modify: ä System.out.println( ) statement ä Change name of class and file

8 Compiling and Running on a PC

9 javac Welcome1Applet.java appletviewer Welcome1Applet.html Introduction to Java Applets ä Java applet is executed inside a WWW browser (or appletviewer) using a Java interpreter that is inside the browser. Welcome1Applet.class Welcome1Applet.java Welcome1Applet.html // Save this file in Welcome1Applet.java import java.applet.*; import java.awt.*; public class Welcome1Applet extends Applet{ public void paint(Graphics g) public void paint(Graphics g) { g.drawString( "Java is fun!”, 25, 50 ); g.drawString( "Java is fun!”, 25, 50 ); }} </APPLET> Save this file in Welcome1Applet.html

10 HW#1 HelloWorld Applet ä Refer to p. 86 and p. 90 of Deitel, Chapter 3 for their WelcomeApplet.java applet ä Modify: ä.java file: ä g.drawString( ) statement ä Change name of class and file ä Extend Applet instead of JApplet unless you want to use Swing here. If extending Applet, import java.applet.*; ä.html file: ä Change name of class and file

11 Compiling and Running on a PC

12 Appletviewer on a PC

13 Browser on a PC

14 Computing Environment ä Java 2 platform: Java 2 SDK v. 1.2.1 ä http://www.javasoft.com/products/jdk/1.2 ä Jini v. 1.1 ä http://www.javasoft.com/products/jini ä UML CS UNIX environment ä Optional: ä PC environment (code must also run on UNIX) ä Java integrated development environment ä 2 are on disk with Deitel textbook (NetBeans caveat) Make sure you have a UML CS UNIX account

15 Jini Overview

16 What is Jini? Jini Is Not Initials But seriously... portions of this slide contributed by Ayal Spitz

17 Sun’s Jini Vision ä Initial Sun marketing focused on hardware ä Appliances in a home or office connecting to a network ä Jini’s goal is to make it possible for all of these appliances to seamlessly detect and communicate with one another ä Technology can also support software services Video Display jTV Video Tuner jCable box Digital Storage jVCR jStereojComputer portions of this slide contributed by Ayal Spitz

18 What is Jini? ä Java-based connection framework developed by Sun Microsystems ä Philosophy: ä plug ‘n play network ä blur distinction between hardware and software ä “self-healing” ä Elements: discovery, lookup, leasing, remote events, transactions, JavaSpaces

19 Background on Jini Technology proxy manages service interaction ClientLookup Service Service Item Proxy Attribute Service Provider Service Item Proxy Attribute Service Item Proxy Attribute Assumes Java and network Consists of Java classes Works at application level

20 5 Key Concepts ä Discovery: find communities on a network and join them ä Lookup: use Lookup Service(s) to find services and use them ä Leasing: resource is “loaned” to some consumer for fixed time period ä Remote Events: allow services to notify others of their state changes ä Transactions: protocol to support multiple services moving to “safe” state

21 Some Jini Definitions ä Service: an entity on the network (e.g. hardware device or software module) that can be used by other Jini participants ä Community: a group of Jini services that are “aware” of each other (typically workgroup size) ä Group: used by Jini APIs to specify and represent a community ä But, due to network separation, different communities may have same group name ä Federation: a collection of communities that are “aware” of each other

22 Client D Client C Client B Discovery Example: Multiple Community Service Provider 1 Service 1 Item Service Provider 2 Service 2 Item Service Provider 3 Service 3 Item Service Provider 4 Service 4 Item Client A Client E Lookup Service Service 1 Item Service 4 Item Service 3 Item Service 2 Item Service 1 ItemService 4 Item Service 1 Item Service 2 ItemService 3 Item Service 4 Item Service 3 Item

23 Requirements for Service, Client ä Either you or a delegate must be able to: ä Connect to a TCP/IP network ( ) ä Participate in discovery to find a Lookup Service ä Register with a Lookup Service to provide proxy ä Keep leases current ä Participate in discovery to find a Lookup Service ä Communicate with a Lookup Service to receive service proxy To be a Jini Service: To be a Jini Client: Extra “machinery” needed: - http server(s) for each machine to offer up downloadable code - RMI activation daemon

24 Hello World in a Jini Setting... c: policy.all policy corejinichapter5 HelloWorldServiceInterface.javaHelloWorldService.javaHelloWorldClient.java client HelloWorldServiceInterface.classHelloWorldClient$Listener.classHelloWorldClient.class corejinichapter5 HelloWorldServiceInterface.classHelloWorldServiceProxy.classHelloWorldService$Listener.classHelloWorldService.class corejinichapter5service service-dl HelloWorldServiceProxy.class corejinichapter5

25 Who Else is in the Game? (other providers of coordination frameworks/connection technologies/service architectures for distributed computing) ä HAVi ä Sony, Sharp, Toshiba, Philips, RCA, Matsushita, Hitachi, Grundig ä Microsoft & HP ä ChaiAppliance Plug and Play ä eSpeak ä Universal Plug and Play ä Network protocol level ä XML device description ä Salutation Framework

26 Further Information – Jini ä Sun web sites ä http://www.javasoft.com/jini http://www.javasoft.com/jini ä http://www.jini.org http://www.jini.org ä Development – Books ä “Core Jini” by W. Keith Edwards ä “The Jini Specification” by Arnold, O’Sullivan, Scheifler, Waldo, and Wollrath ä Gartner Advisory: ä Java Jini: A ‘Killer-App Enabler’ for Network Computing? http://gartner.jmu.edu/research/ras/83000/83044/83044.html portions of this slide contributed by Ayal Spitz

27 C++ Diagnostic

28 ä ä Assess C++ background ä ä Will not contribute to the course grade ä ä Answers on the way out of class ä ä Name is optional ä ä Provide code snippets, not entire programs ä ä Leave unknowns blank We’ll summarize results of the diagnostic in lecture.


Download ppt "UMass Lowell Computer Science 91.460 Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 3 HW#1 Jini Overview C++ Diagnostic Results."

Similar presentations


Ads by Google