00001 /* 00002 * Copyright (C) 2001 - 2004 ScalAgent Distributed Technologies 00003 * Copyright (C) 1996 - 2000 BULL 00004 * Copyright (C) 1996 - 2000 INRIA 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00019 * USA. 00020 */ 00021 package fr.dyade.aaa.agent; 00022 00023 import java.io.*; 00024 00029 public final class AgentCreateRequest extends Notification { 00033 static final long serialVersionUID = 1L; 00034 00036 public AgentId reply; 00041 AgentId deploy; 00043 byte agentState[]; 00044 00045 public AgentCreateRequest(Agent agent) throws IOException { 00046 this(agent, null); 00047 } 00048 00049 public AgentCreateRequest(Agent agent, AgentId reply) throws IOException { 00050 super(); 00051 00052 this.reply = reply; 00053 this.deploy = agent.getId(); 00054 00055 ByteArrayOutputStream bos = new ByteArrayOutputStream(); 00056 ObjectOutputStream oos = new ObjectOutputStream(bos); 00057 oos.writeObject(agent); 00058 oos.flush(); 00059 agentState = bos.toByteArray(); 00060 } 00061 00062 public final AgentId getDeploy() { 00063 return deploy; 00064 } 00065 }
1.5.0