KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jmeter > samplers > RemoteTestListenerWrapper


1 // $Header: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/samplers/RemoteTestListenerWrapper.java,v 1.9 2004/02/14 03:34:29 sebb Exp $
2
/*
3  * Copyright 2001-2004 The Apache Software Foundation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * 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,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17 */

18
19 package org.apache.jmeter.samplers;
20
21 import java.io.Serializable JavaDoc;
22
23 import org.apache.jmeter.engine.event.LoopIterationEvent;
24 import org.apache.jmeter.engine.util.NoThreadClone;
25 import org.apache.jmeter.testelement.AbstractTestElement;
26 import org.apache.jmeter.testelement.TestListener;
27 import org.apache.jorphan.logging.LoggingManager;
28 import org.apache.log.Logger;
29
30 /**
31  * @author unascribed
32  * @version $Revision: 1.9 $
33  */

34 public class RemoteTestListenerWrapper
35     extends AbstractTestElement
36     implements TestListener, Serializable JavaDoc, NoThreadClone
37 {
38     transient private static Logger log = LoggingManager.getLoggerForClass();
39     RemoteSampleListener listener;
40
41     public RemoteTestListenerWrapper()
42     {
43     }
44
45     public RemoteTestListenerWrapper(RemoteSampleListener l)
46     {
47         listener = l;
48     }
49     public void testStarted()
50     {
51         try
52         {
53             listener.testStarted();
54         }
55         catch (Exception JavaDoc ex)
56         {
57             log.error("", ex);
58         }
59
60     }
61     public void testEnded()
62     {
63         try
64         {
65             listener.testEnded();
66         }
67         catch (Exception JavaDoc ex)
68         {
69             log.error("", ex);
70         }
71     }
72     public void testStarted(String JavaDoc host)
73     {
74         try
75         {
76             listener.testStarted(host);
77         }
78         catch (Exception JavaDoc ex)
79         {
80             log.error("", ex);
81         }
82     }
83     public void testEnded(String JavaDoc host)
84     {
85         try
86         {
87             listener.testEnded(host);
88         }
89         catch (Exception JavaDoc ex)
90         {
91             log.error("", ex);
92         }
93     }
94     /* (non-Javadoc)
95      * @see TestListener#testIterationStart(LoopIterationEvent)
96      */

97     public void testIterationStart(LoopIterationEvent event)
98     {
99     }
100
101 }
Popular Tags