1 20 21 package fr.dyade.aaa.agent; 22 23 import java.io.*; 24 import java.util.*; 25 import java.lang.reflect.*; 26 import fr.dyade.aaa.util.*; 27 28 31 public abstract class AgentObject implements Serializable { 32 33 34 transient String name; 35 47 static AgentObject 48 load(String name) throws IOException, ClassNotFoundException { 49 return (AgentObject) AgentServer.transaction.load("AgentObject_" + name); 50 } 51 52 59 void save() throws IOException { 60 AgentServer.transaction.save(this, "AgentObject_" + name); 61 } 62 63 70 private void writeObject(java.io.ObjectOutputStream out) 71 throws IOException { 72 out.writeObject(name); 75 } 76 77 83 private void readObject(java.io.ObjectInputStream in) 84 throws IOException, ClassNotFoundException { 85 name = (String ) in.readObject(); 86 } 87 88 public AgentObject(String name) { 89 this.name = name; 90 } 91 92 97 public String toString() { 98 return new String ("AgentObject_" + name); 99 } 100 } 101 | Popular Tags |