KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
3  * Copyright (C) 2005 - 2006 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 org.objectweb.joram.mom.notifications;
24
25 import fr.dyade.aaa.agent.AgentId;
26
27 public class RegisterDestNot
28     extends fr.dyade.aaa.agent.Notification {
29
30   private AgentId id;
31   private String JavaDoc name;
32   private String JavaDoc className;
33   private String JavaDoc type;
34   
35   public RegisterDestNot(AgentId id,
36                          String JavaDoc name,
37                          String JavaDoc className,
38                          String JavaDoc type) {
39     this.id = id;
40     this.name = name;
41     this.className = className;
42     this.type = type;
43   }
44   
45   public final AgentId getId() {
46     return id;
47   }
48   
49   public final String JavaDoc getName() {
50     return name;
51   }
52   
53   public final String JavaDoc getClassName() {
54     return className;
55   }
56   
57   public final String JavaDoc getType() {
58     return type;
59   }
60   
61   public boolean isAssignableTo(String JavaDoc assignedType) {
62     return type.startsWith(assignedType);
63   }
64
65   /**
66    * Appends a string image for this object to the StringBuffer parameter.
67    *
68    * @param output
69    * buffer to fill in
70    * @return
71     <code>output</code> buffer is returned
72    */

73   public StringBuffer JavaDoc toString(StringBuffer JavaDoc output) {
74     output.append('(');
75     super.toString(output);
76     output.append(",id=").append(id);
77     output.append(",name=").append(name);
78     output.append(",className=").append(className);
79     output.append(",type=").append(type);
80     output.append(')');
81
82     return output;
83   }
84 }
85
Popular Tags