Coverage Report - org.mule.transport.soap.axis.AxisInitialisationCallback
 
Classes in this File Line Coverage Branch Coverage Complexity
AxisInitialisationCallback
77%
10/13
50%
3/6
3
 
 1  
 /*
 2  
  * $Id: AxisInitialisationCallback.java 10489 2008-01-23 17:53:38Z dfeist $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.transport.soap.axis;
 12  
 
 13  
 import org.mule.api.lifecycle.InitialisationCallback;
 14  
 import org.mule.api.lifecycle.InitialisationException;
 15  
 
 16  
 import org.apache.axis.handlers.soap.SOAPService;
 17  
 import org.apache.commons.logging.Log;
 18  
 import org.apache.commons.logging.LogFactory;
 19  
 
 20  
 /**
 21  
  * <code>AxisInitialisationCallback</code> is invoked when an Axis component is
 22  
  * created from its descriptor.
 23  
  */
 24  
 public class AxisInitialisationCallback implements InitialisationCallback
 25  
 {
 26  2
     protected static final Log logger = LogFactory.getLog(AxisInitialisationCallback.class);
 27  
 
 28  
     private SOAPService service;
 29  376
     private boolean invoked = false;
 30  
 
 31  
     public AxisInitialisationCallback(SOAPService service)
 32  376
     {
 33  376
         this.service = service;
 34  376
     }
 35  
 
 36  
     public void initialise(Object component) throws InitialisationException
 37  
     {
 38  
         // only call this once
 39  88
         if (invoked)
 40  
         {
 41  8
             return;
 42  
         }
 43  80
         if (component instanceof AxisInitialisable)
 44  
         {
 45  0
             if (logger.isDebugEnabled())
 46  
             {
 47  0
                 logger.debug("Calling axis initialisation for component: " + component.getClass().getName());
 48  
             }
 49  0
             ((AxisInitialisable)component).initialise(service);
 50  
         }
 51  80
         invoked = true;
 52  80
     }
 53  
 }