01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of 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,
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;
22: import java.rmi.RemoteException;
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: 493779 $
32: */
33:
34: public class RemoteSampleListenerWrapper extends AbstractTestElement
35: implements SampleListener, Serializable, NoThreadClone {
36: private static final Logger log = LoggingManager
37: .getLoggerForClass();
38:
39: private RemoteSampleListener listener;
40:
41: public RemoteSampleListenerWrapper(RemoteSampleListener l) {
42: listener = l;
43: }
44:
45: public RemoteSampleListenerWrapper() {
46: }
47:
48: public void sampleOccurred(SampleEvent e) {
49: try {
50: listener.sampleOccurred(e);
51: } catch (RemoteException err) {
52: log.error("", err); // $NON-NLS-1$
53: }
54: }
55:
56: public void sampleStarted(SampleEvent e) {
57: try {
58: listener.sampleStarted(e);
59: } catch (RemoteException err) {
60: log.error("", err); // $NON-NLS-1$
61: }
62: }
63:
64: public void sampleStopped(SampleEvent e) {
65: try {
66: listener.sampleStopped(e);
67: } catch (RemoteException err) {
68: log.error("", err); // $NON-NLS-1$
69: }
70: }
71: }
|