next up previous contents
Next: Literatur Up: B Source-Code des Voyager-MASA-Gateways Previous: B.7 FOO

B.8 FOOVoyagerAgent

package voyageragent;

import com.objectspace.voyager.*;
import com.objectspace.voyager.agent.*;
import java.io.*;
import java.net.*;
import java.util.*;
import com.objectspace.lib.util.*;


/**
 * Example for Voyager agents
 */

public class FOOVoyagerAgent implements voyageragent.FOO, Serializable
{ 
  
		public FOOVoyagerAgent() {
				System.out.println("FOOVoyagerAgent.<init>");
		}

		public void message(){
				System.out.println("This is a message!");
		}
		public void print_message(String message){
				System.out.println("Message:" +  message);
		}
		public void print_number_message(Short number, String message){
				System.out.println("Number: " + number + " Message: " +  message);
		}

		public String get_time(){
				String host = "unknown host";
				try{
						host = InetAddress.getLocalHost().getHostName();
				}catch(UnknownHostException e){
						e.printStackTrace();
				}
				return "Time on " +  host + ": " 
						+ Calendar.getInstance().getTime();
		}
}



Copyright Munich Network Management Team