01: /*
02: * MCS Media Computer Software Copyright (c) 2006 by MCS
03: * -------------------------------------- Created on 26.07.2006 by W.Klaas
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
06: * use this file except in compliance with the License. You may obtain a copy of
07: * the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14: * License for the specific language governing permissions and limitations under
15: * the License.
16: */
17: package de.mcs.jmeasurement.test.proxy;
18:
19: /**
20: * This is the implementation class of the interface ITestProxy.
21: *
22: * @author W.Klaas
23: *
24: */
25: public class CTestProxy implements ITestProxy {
26:
27: public static final int waitEcho = 500;
28:
29: public static final int waitEchoNow = 200;
30:
31: public static final int waitException = 250;
32:
33: public CTestProxy() {
34: super ();
35: }
36:
37: public final String echo(String line) {
38: try {
39: Thread.sleep(waitEcho);
40: } catch (InterruptedException e) {
41: // TODO Auto-generated catch block
42: e.printStackTrace();
43: }
44: return line;
45: }
46:
47: public final void echoNow(String linie) {
48: try {
49: Thread.sleep(waitEchoNow);
50: } catch (InterruptedException e) {
51: // TODO Auto-generated catch block
52: e.printStackTrace();
53: }
54: }
55:
56: public final void exceptionNow() throws ProxyException {
57: try {
58: Thread.sleep(waitException);
59: } catch (InterruptedException e) {
60: // TODO Auto-generated catch block
61: e.printStackTrace();
62: }
63: throw new ProxyException("This is the exception");
64: }
65:
66: public final String iTestMethode(final String line) {
67: return line;
68: }
69: }
|