KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Copyright (C) 1996 - 2000 BULL
3  * Copyright (C) 1996 - 2000 INRIA
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
21 package fr.dyade.aaa.agent;
22
23 /**
24  * Notify by the engine to the sender of a notification when the corresponding
25  * reaction throws an exception.
26  *
27  * @see Engine
28  */

29 public class ExceptionNotification extends Notification {
30
31   static final long serialVersionUID = -78084906213588139L;
32
33   /** The target agent id. */
34   public AgentId agent;
35   /** The failing notification. */
36   public Notification not;
37   /** The exception thrown. */
38   public Exception JavaDoc exc;
39
40   /**
41    * Allocates a new <code>ExceptionNotification</code> notification.
42    *
43    * @param agent The target agent id.
44    * @param not The failing notification.
45    * @param exc The exception thrown.
46    */

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

63   public StringBuffer JavaDoc toString(StringBuffer JavaDoc output) {
64     output.append('(');
65     super.toString(output);
66     output.append(",agent=").append(agent);
67     output.append(",not=").append(not);
68     output.append(",exc=").append(exc);
69     output.append(')');
70
71     return output;
72   }
73 }
74
Popular Tags