1 31 package org.objectweb.proactive.examples.hello; 32 33 import org.apache.log4j.Logger; 34 35 public class HelloClient { 36 37 static Logger logger = Logger.getLogger(HelloClient.class.getName()); 38 39 public static void main(String [] args) { 40 Hello myServer; 41 String message; 42 try { 43 if (args.length == 0) { 45 myServer = (Hello)org.objectweb.proactive.ProActive.newActive(Hello.class.getName(), new Object []{"local"}); 47 } else { 48 logger.info("Using server located on " + args[0]); 50 myServer = (Hello)org.objectweb.proactive.ProActive.lookupActive(Hello.class.getName(), args[0]); 51 } 52 message = myServer.sayHello(); 54 logger.info("The message is : " + message); 56 } catch (Exception e) { 57 logger.error("Could not reach/create server object"); 58 e.printStackTrace(); 59 System.exit(1); 60 } 61 } 62 } | Popular Tags |