KickJava   Java API By Example, From Geeks To Geeks.

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


1 // $Header: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/samplers/RemoteSampleListenerWrapper.java,v 1.7 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 import java.rmi.RemoteException JavaDoc;
23
24 import org.apache.jmeter.engine.util.NoThreadClone;
25 import org.apache.jmeter.testelement.AbstractTestElement;
26 import org.apache.jorphan.logging.LoggingManager;
27 import org.apache.log.Logger;
28
29 /**
30  * @author unascribed
31  * @version $Revision: 1.7 $
32  */

33
34 public class RemoteSampleListenerWrapper
35     extends AbstractTestElement
36     implements SampleListener, Serializable JavaDoc, NoThreadClone
37 {
38     transient private static Logger log = LoggingManager.getLoggerForClass();
39     RemoteSampleListener listener;
40
41     public RemoteSampleListenerWrapper(RemoteSampleListener l)
42     {
43         listener = l;
44     }
45
46     public RemoteSampleListenerWrapper()
47     {
48     }
49
50     public void sampleOccurred(SampleEvent e)
51     {
52         try
53         {
54             listener.sampleOccurred(e);
55         }
56         catch (RemoteException JavaDoc err)
57         {
58             log.error("", err);
59         }
60     }
61     public void sampleStarted(SampleEvent e)
62     {
63         try
64         {
65             listener.sampleStarted(e);
66         }
67         catch (RemoteException JavaDoc err)
68         {
69             log.error("", err);
70         }
71     }
72     public void sampleStopped(SampleEvent e)
73     {
74         try
75         {
76             listener.sampleStopped(e);
77         }
78         catch (RemoteException JavaDoc err)
79         {
80             log.error("", err);
81         }
82     }
83 }
Popular Tags