KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > joram > mom > notifications > AbstractNotification


1 /*
2  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
3  * Copyright (C) 2001 - ScalAgent Distributed Technologies
4  * Copyright (C) 1996 - Dyade
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  * Initial developer(s): Frederic Maistre (INRIA)
22  * Contributor(s):
23  */

24 package org.objectweb.joram.mom.notifications;
25
26 /**
27  * The <code>AbstractNotification</code> class is the superclass of the
28  * notifications exchanged by a client agent and a MOM destination agent.
29  */

30 public abstract class AbstractNotification
31                       extends fr.dyade.aaa.agent.Notification
32 {
33   /**
34    * The <code>clientContext</code> field allows a client to identify a context
35    * within which a notification is exchanged with a destination.
36    * <p>
37    * This field is for the client use only and might not be set.
38    */

39   private int clientContext = -1;
40
41
42   /**
43    * Constructs an <code>AbstractNotification</code>.
44    *
45    * @param clientContext Identifies a client context.
46    */

47   public AbstractNotification(int clientContext)
48   {
49     this.clientContext = clientContext;
50   }
51
52   /**
53    * Constructs an <code>AbstractNotification</code>.
54    */

55   public AbstractNotification()
56   {}
57
58
59   /** Returns the client context identifier. */
60   public int getClientContext()
61   {
62     return clientContext;
63   }
64
65   public void setPersistent(boolean persistent) {
66     this.persistent = persistent;
67   }
68   
69   public final boolean getPersistent() {
70     return persistent;
71   }
72
73   /**
74    * Appends a string image for this object to the StringBuffer parameter.
75    *
76    * @param output
77    * buffer to fill in
78    * @return
79     <code>output</code> buffer is returned
80    */

81   public StringBuffer JavaDoc toString(StringBuffer JavaDoc output) {
82     output.append('(');
83     super.toString(output);
84     output.append(", clientContext=").append(clientContext);
85     output.append(')');
86
87     return output;
88   }
89 }
90
Popular Tags