KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > dyade > aaa > agent > conf > A3CMLService


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

19 package fr.dyade.aaa.agent.conf;
20
21 import java.io.*;
22 import java.util.*;
23
24 /**
25  * The class <code>A3CMLService</code> describes a service.
26  */

27 public class A3CMLService implements Serializable {
28   public String JavaDoc classname = null;
29   public String JavaDoc args = null;
30
31   public A3CMLService(String JavaDoc classname,
32                       String JavaDoc args) {
33     this.classname = classname;
34     this.args = args;
35   }
36
37
38   public A3CMLService duplicate() throws Exception JavaDoc {
39     A3CMLService clone = new A3CMLService(classname, args);
40     return clone;
41   }
42
43   public String JavaDoc toString() {
44     StringBuffer JavaDoc strBuf = new StringBuffer JavaDoc();
45     strBuf.append("(");
46     strBuf.append("classname=");
47     strBuf.append(classname);
48     strBuf.append(",args=");
49     strBuf.append(args);
50     strBuf.append(")");
51     return strBuf.toString();
52   }
53
54   public boolean equals(Object JavaDoc obj) {
55     if (obj == null) return false;
56
57     if (obj instanceof A3CMLService) {
58       A3CMLService service = (A3CMLService) obj;
59       if (((args == service.args) ||
60            ((args != null) && args.equals(service.args))) &&
61           ((classname == service.classname) ||
62            ((classname != null) && classname.equals(service.classname))))
63         return true;
64     }
65     return false;
66   }
67 }
68
Popular Tags