1 21 package fr.dyade.aaa.agent; 22 23 import java.io.*; 24 25 29 public final class AgentCreateRequest extends Notification { 30 static final long serialVersionUID = -873215263839213534L; 31 32 33 public AgentId reply; 34 38 AgentId deploy; 39 40 byte agentState[]; 41 42 public AgentCreateRequest(Agent agent) throws IOException { 43 this(agent, null); 44 } 45 46 public AgentCreateRequest(Agent agent, AgentId reply) throws IOException { 47 super(); 48 49 this.reply = reply; 50 this.deploy = agent.getId(); 51 52 ByteArrayOutputStream bos = new ByteArrayOutputStream(); 53 ObjectOutputStream oos = new ObjectOutputStream(bos); 54 oos.writeObject(agent); 55 oos.flush(); 56 agentState = bos.toByteArray(); 57 } 58 59 public final AgentId getDeploy() { 60 return deploy; 61 } 62 } 63 | Popular Tags |