1 /* 2 * Copyright (C) 2004 - France Telecom R&D 3 * Copyright (C) 2004 ScalAgent Distributed Technologies 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 2.1 of the License, or any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public 16 * License along with this library; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 18 * USA. 19 * 20 * Initial developer(s): ScalAgent Distributed Technologies 21 * Contributor(s): 22 */ 23 package fr.dyade.aaa.agent; 24 25 import java.io.*; 26 27 /** 28 * This interface is used by object that need to carry additionnal data 29 * between HA nodes. 30 */ 31 public interface BagSerializer { 32 /** 33 * The readBag method is responsible for reading from the stream and 34 * restoring the agent's transient state. 35 */ 36 public void readBag(ObjectInputStream in) 37 throws IOException, ClassNotFoundException; 38 39 /** 40 * The writeBag method is responsible for writing the extra data 41 * of this particular agent so that the corresponding readBag method 42 * can restore it. 43 */ 44 public void writeBag(ObjectOutputStream out) 45 throws IOException; 46 } 47