1    //
2    // SwitchRMI  Framework
3    // Copyright (c) 2000-2002 by Michael J. Henderson & Associates.
4    //
5    // Michael Henderson
6    // http://switchrmi.sf.net
7    // mailto:mikehenderson@dunelm.org.uk
8    //
9    // This library is free software.
10   //
11   // You may redistribute it and/or modify it under the terms of the GNU
12   // Lesser General Public License as published by the Free Software Foundation.
13   //
14   // Version 2.1 of the license should be included with this distribution in
15   // the file LICENSE, as well as License.html. If the license is not
16   // included with this distribution, you may find a copy at the FSF web
17   // site at 'www.gnu.org' or 'www.fsf.org', or you may write to the
18   // Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139 USA.
19   //
20   // This library is distributed in the hope that it will be useful,
21   // but WITHOUT ANY WARRANTY; without even the implied waranty of
22   // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
23   // Lesser General Public License for more details.
24   //
25   // $Id: IEchoImpl.java,v 1.1 2002/11/11 22:19:48 mikehenderson Exp $
26   package com.mjh.switchrmi.transport.test;
27   
28   public class IEchoImpl implements IEcho
29   {
30       private String description;
31       private int identifier;
32       private int callCount;
33   
34       public IEchoImpl()
35       {
36       }
37   
38       public String getDescription()
39       {
40           callCount++;
41   
42           return description;
43       }
44   
45       public void setDescription(String value)
46       {
47           callCount++;
48           description = value;
49       }
50   
51       public int getIdentifier()
52       {
53           callCount++;
54   
55           return identifier;
56       }
57   
58       public void setIdentifier(int value)
59       {
60           callCount++;
61           System.out.println("XXXXXXXXXXXXX identifier = " + value);
62           identifier = value;
63       }
64   
65       public String echo(String string)
66       {
67           callCount++;
68   
69           return string;
70       }
71   
72       public char echo(char c)
73       {
74           callCount++;
75   
76           return c;
77       }
78   
79       public byte echo(byte b)
80       {
81           return b;
82       }
83   
84       public short echo(short s)
85       {
86           callCount++;
87   
88           return s;
89       }
90   
91       public int echo(int i)
92       {
93           callCount++;
94   
95           return i;
96       }
97   
98       public long echo(long l)
99       {
100          callCount++;
101  
102          return l;
103      }
104  
105      public float echo(float f)
106      {
107          callCount++;
108  
109          return f;
110      }
111  
112      public double echo(double d)
113      {
114          callCount++;
115  
116          return d;
117      }
118  
119      public boolean echo(boolean b)
120      {
121          callCount++;
122  
123          return b;
124      }
125  
126      public Integer echo(Integer i)
127      {
128          callCount++;
129  
130          return i;
131      }
132  
133      public Double echo(Double d)
134      {
135          callCount++;
136  
137          return d;
138      }
139  
140      public Object echo(Object object)
141      {
142          callCount++;
143  
144          return object;
145      }
146  
147      public java.util.Map echo(java.util.Map map)
148      {
149          System.out.println("Echoing: " + map);
150          callCount++;
151  
152          return map;
153      }
154  
155      public java.util.Date echo(java.util.Date date)
156      {
157          callCount++;
158  
159          return date;
160      }
161  
162      public java.util.List echo(java.util.List list)
163      {
164          callCount++;
165  
166          return list;
167      }
168  
169      public void throwException()
170                          throws Exception
171      {
172          callCount++;
173          throw new Exception("This is the reason, right here!");
174      }
175  
176      public int echoCallCount()
177                        throws Exception
178      {
179          return callCount;
180      }
181  }