Clover coverage report - Maven Clover report
Coverage timestamp: Sun Aug 20 2006 04:03:27 PDT
file stats: LOC: 96   Methods: 13
NCLOC: 56   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
TopicRequestor.java - 28.6% 23.1% 26.5%
coverage coverage
 1    /**
 2    *
 3    * Copyright 2003-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    // This source code implements specifications defined by the Java
 20    // Community Process. In order to remain compliant with the specification
 21    // DO NOT add / change / or delete method signatures!
 22    //
 23   
 24    package javax.jms;
 25   
 26    /**
 27    * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
 28    */
 29    public class TopicRequestor {
 30    private TopicSession session;
 31    private Topic topic;
 32    private TemporaryTopic temporaryTopic;
 33    private TopicPublisher publisher;
 34    private TopicSubscriber subscriber;
 35   
 36  1 public TopicRequestor(TopicSession session, Topic topic)
 37    throws JMSException {
 38  1 super();
 39  1 setSession(session);
 40  1 setTopic(topic);
 41  1 setTemporaryTopic(session.createTemporaryTopic());
 42  0 setPublisher(session.createPublisher(topic));
 43  0 setSubscriber(session.createSubscriber(getTemporaryTopic()));
 44    }
 45   
 46  0 public Message request(Message message) throws JMSException {
 47  0 message.setJMSReplyTo(getTemporaryTopic());
 48  0 getPublisher().publish(message);
 49  0 return (getSubscriber().receive());
 50    }
 51   
 52  0 public void close() throws JMSException {
 53  0 getSession().close();
 54  0 getTemporaryTopic().delete();
 55    }
 56   
 57  0 private void setPublisher(TopicPublisher publisher) {
 58  0 this.publisher = publisher;
 59    }
 60   
 61  0 private TopicPublisher getPublisher() {
 62  0 return publisher;
 63    }
 64   
 65  1 private void setSession(TopicSession session) {
 66  1 this.session = session;
 67    }
 68   
 69  0 private TopicSession getSession() {
 70  0 return session;
 71    }
 72   
 73  0 private void setSubscriber(TopicSubscriber subscriber) {
 74  0 this.subscriber = subscriber;
 75    }
 76   
 77  0 private TopicSubscriber getSubscriber() {
 78  0 return subscriber;
 79    }
 80   
 81  0 private void setTemporaryTopic(TemporaryTopic temporaryTopic) {
 82  0 this.temporaryTopic = temporaryTopic;
 83    }
 84   
 85  0 private TemporaryTopic getTemporaryTopic() {
 86  0 return temporaryTopic;
 87    }
 88   
 89  1 private void setTopic(Topic topic) {
 90  1 this.topic = topic;
 91    }
 92   
 93  0 private Topic getTopic() {
 94  0 return topic;
 95    }
 96    }