Clover coverage report - Lingo - 1.0-SNAPSHOT
Coverage timestamp: Fri May 13 2005 08:50:34 BST
file stats: LOC: 67   Methods: 3
NCLOC: 38   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
AsyncReplyHandler.java - 60% 66.7% 61.5%
coverage coverage
 1   
 /**
 2   
  * 
 3   
  * Copyright 2005 LogicBlaze, Inc.
 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   
 package org.logicblaze.lingo.jms.impl;
 19   
 
 20   
 import org.logicblaze.lingo.jms.ReplyHandler;
 21   
 import org.logicblaze.lingo.jms.marshall.Marshaller;
 22   
 import org.apache.commons.logging.Log;
 23   
 import org.apache.commons.logging.LogFactory;
 24   
 import org.springframework.remoting.support.RemoteInvocation;
 25   
 import org.springframework.remoting.support.RemoteInvocationBasedExporter;
 26   
 
 27   
 import javax.jms.JMSException;
 28   
 import javax.jms.Message;
 29   
 import java.lang.reflect.InvocationTargetException;
 30   
 
 31   
 /**
 32   
  * @version $Revision: 1.1 $
 33   
  */
 34   
 public class AsyncReplyHandler extends RemoteInvocationBasedExporter implements ReplyHandler {
 35   
     private static final Log log = LogFactory.getLog(AsyncReplyHandler.class);
 36   
 
 37   
     private Object pojo;
 38   
     private Marshaller marshaller;
 39   
 
 40  3
     public AsyncReplyHandler(Object pojo, Marshaller marshaller) {
 41  3
         this.pojo = pojo;
 42  3
         this.marshaller = marshaller;
 43   
     }
 44   
 
 45  9
     public boolean handle(Message message) throws JMSException {
 46  9
         RemoteInvocation invocation = marshaller.readRemoteInvocation(message);
 47  9
         try {
 48  9
             invoke(invocation, pojo);
 49   
         }
 50   
         catch (NoSuchMethodException e) {
 51  0
             onException(invocation, e);
 52   
         }
 53   
         catch (IllegalAccessException e) {
 54  0
             onException(invocation, e);
 55   
         }
 56   
         catch (InvocationTargetException e) {
 57  0
             onException(invocation, e);
 58   
         }
 59  9
         return false;
 60   
     }
 61   
 
 62   
 
 63  0
     protected void onException(RemoteInvocation invocation, Exception e) {
 64  0
         log.error("Failed to invoke: " + invocation + " on: " + pojo + ". Reason: " + e, e);
 65   
     }
 66   
 }
 67