1 31 package org.objectweb.proactive.examples.hello; 32 33 36 public class Hello implements org.objectweb.proactive.RunActive, java.io.Serializable { 37 38 private String name; 39 private String nodeURL; 40 private String hi = "Hello world"; 41 private java.text.DateFormat dateFormat = new java.text.SimpleDateFormat ("dd/MM/yyyy HH:mm:ss"); 42 43 44 public Hello() { 45 } 46 47 48 public Hello(String name) { 49 this.name = name; 50 } 51 52 53 public String sayHello() { 54 return hi + " at " + dateFormat.format(new java.util.Date ()) + "\n from \n" + nodeURL; 55 } 56 57 58 public void runActivity(org.objectweb.proactive.Body body) { 59 org.objectweb.proactive.Service service = new org.objectweb.proactive.Service(body); 60 nodeURL = body.getNodeURL(); 61 service.fifoServing(); 62 } 63 64 78 } 79 | Popular Tags |