KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > dyade > aaa > agent > UnknownAgent


1 /*
2  * Copyright (C) 2004 - 2006 ScalAgent Distributed Technologies
3  * Copyright (C) 1996 - 2000 BULL
4  * Copyright (C) 1996 - 2000 INRIA
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA.
20  */

21
22 package fr.dyade.aaa.agent;
23
24 /**
25  * Notify by the engine to the sender of a notification when the target agent
26  * does not exist.
27  *
28  * @see Engine
29  */

30 public class UnknownAgent extends Notification {
31
32   static final long serialVersionUID = 3125179672784868254L;
33
34   /** The non-existent target agent id. */
35   public AgentId agent;
36   /** The failing notification that can not be delivered. */
37   public Notification not;
38
39   /**
40    * Allocates a new <code>UnknownAgent</code> notification.
41    *
42    * @param agent The non-existent target agent id.
43    * @param not The failing notification that can not be delivered.
44    */

45   public UnknownAgent(AgentId agent, Notification not) {
46     this.agent = agent;
47     this.not = not;
48   }
49
50   /**
51    * Appends a string image for this object to the StringBuffer parameter.
52    *
53    * @param output
54    * buffer to fill in
55    * @return
56     <code>output</code> buffer is returned
57    */

58   public StringBuffer JavaDoc toString(StringBuffer JavaDoc output) {
59     output.append('(');
60     super.toString(output);
61     output.append(",agent=").append(agent);
62     output.append(",not=").append(not);
63     output.append(')');
64
65     return output;
66   }
67 }
68
69
Popular Tags