DOC PREVIEW
CMU ISM 95702 - The Network is the Computer

This preview shows page 1-2-3 out of 8 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

“The Network is the Computer”The Client Passes HardWork to a Remote ObjectHardWork implements TaskAll Tasks Have An Execute MethodComputeEngines implement ComputeThe Remote ComputeEngineSlide 7This all depends on…95-702 OCT 1“The Network is the Computer”Advanced RMI orPassing Behavior95-702 OCT 2The Client Passes HardWork to a Remote Objectimport java.rmi.*;import java.math.*;public class ComputeClient { public static void main(String args[]) { if(System.getSecurityManager() == null) { System.setSecurityManager(new RMISecurityManager()); } try { String name = "//localhost/Compute"; Compute comp = (Compute) Naming.lookup(name); HardWork task = new HardWork(); BigInteger bi = (BigInteger) (comp.executeTask(task)); System.out.println("The result is " + bi); } catch(Exception e) { e.printStackTrace(); }}}95-702 OCT 3HardWork implements Taskimport java.math.*;public class HardWork implements Task { public Object execute() { BigInteger sum = new BigInteger(""+0); for(int j = 0; j < 1000; j++ ) { BigInteger x = new BigInteger(""+j); sum.add(x); } return sum; }}95-702 OCT 4All Tasks Have An Execute Methodimport java.io.Serializable;public interface Task extends Serializable { Object execute();}95-702 OCT 5ComputeEngines implement Computeimport java.rmi.Remote;import java.rmi.RemoteException;public interface Compute extends Remote { Object executeTask(Task t) throws RemoteException;}95-702 OCT 6The Remote ComputeEngineimport java.rmi.*;import java.rmi.server.*;public class ComputeEngine extends UnicastRemoteObject implements Compute { public ComputeEngine() throws RemoteException { super(); } public Object executeTask(Task t) { return t.execute(); }95-702 OCT 7public static void main(String[] args) { if(System.getSecurityManager() == null) { System.setSecurityManager(new RMISecurityManager()); } String name = "//localhost/Compute"; try { Compute engine = new ComputeEngine(); Naming.rebind(name,engine); System.out.println("ComputeEngine bound"); } catch(Exception e) { System.out.println("exception thrown"); e.printStackTrace(); } }}95-702 OCT 8This all depends on…•Java’s ability to download class files via a codebase (see reading on schedule)•The downloaded class behaving itself (security manager and


View Full Document

CMU ISM 95702 - The Network is the Computer

Documents in this Course
Homework

Homework

12 pages

Lecture

Lecture

25 pages

Lecture

Lecture

21 pages

Lecture

Lecture

24 pages

Exam

Exam

11 pages

Homework

Homework

16 pages

Homework

Homework

38 pages

lecture

lecture

38 pages

review

review

7 pages

lecture

lecture

18 pages

review

review

8 pages

Chapter2

Chapter2

32 pages

Lecture 4

Lecture 4

47 pages

Lecture

Lecture

22 pages

Naming

Naming

26 pages

lecture

lecture

34 pages

lecture

lecture

42 pages

lecture

lecture

112 pages

Lecture

Lecture

33 pages

Axis

Axis

43 pages

lecture

lecture

32 pages

review

review

17 pages

Lecture

Lecture

53 pages

Lecture

Lecture

80 pages

Lab

Lab

14 pages

Load more
Download The Network is the Computer
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view The Network is the Computer and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view The Network is the Computer 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?