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.protocol.jms.sampler;
20:
21: import javax.jms.JMSException;
22: import javax.jms.Message;
23: import javax.jms.Queue;
24: import javax.jms.QueueRequestor;
25: import javax.jms.QueueSession;
26:
27: /**
28: * Request/reply executor with a temporary reply queue. <br>
29: * Created on: October 28, 2004
30: *
31: * @author Martijn Blankestijn
32: * @version $Id: TemporaryQueueExecutor.java,v 1.3 2005/06/01 18:10:32
33: * mblankestijn Exp $
34: */
35: public class TemporaryQueueExecutor implements QueueExecutor {
36: /** The sender and receiver. */
37: private QueueRequestor requestor;
38:
39: /**
40: * Constructor.
41: *
42: * @param session
43: * the session to use to send the message
44: * @param destination
45: * the queue to send the message on
46: * @throws JMSException
47: */
48: public TemporaryQueueExecutor(QueueSession session,
49: Queue destination) throws JMSException {
50: requestor = new QueueRequestor(session, destination);
51: }
52:
53: /*
54: * (non-Javadoc)
55: *
56: * @see org.apache.jmeter.protocol.jms.sampler.QueueExecutor#sendAndReceive(javax.jms.Message)
57: */
58: public Message sendAndReceive(Message request) throws JMSException {
59: return requestor.request(request);
60: }
61: }
|