KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > providers > soap > axis > AxisInitialisationCallback


1 /*
2  * $Id: AxisInitialisationCallback.java 3798 2006-11-04 04:07:14Z aperepel $
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 MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.providers.soap.axis;
12
13 import org.apache.axis.handlers.soap.SOAPService;
14 import org.apache.commons.logging.Log;
15 import org.apache.commons.logging.LogFactory;
16 import org.mule.impl.InitialisationCallback;
17 import org.mule.umo.lifecycle.InitialisationException;
18
19 /**
20  * <code>AxisInitialisationCallback</code> is invoked when an Axis component is
21  * created from its descriptor.
22  *
23  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
24  * @version $Revision: 3798 $
25  */

26 public class AxisInitialisationCallback implements InitialisationCallback
27 {
28     /**
29      * logger used by this class
30      */

31     protected static Log logger = LogFactory.getLog(AxisInitialisationCallback.class);
32
33     private SOAPService service;
34     private boolean invoked = false;
35
36     public AxisInitialisationCallback(SOAPService service)
37     {
38         this.service = service;
39     }
40
41     public void initialise(Object JavaDoc component) throws InitialisationException
42     {
43         // only call this once
44
if (invoked)
45         {
46             return;
47         }
48         if (component instanceof AxisInitialisable)
49         {
50             if (logger.isDebugEnabled())
51             {
52                 logger.debug("Calling axis initialisation for component: " + component.getClass().getName());
53             }
54             ((AxisInitialisable)component).initialise(service);
55         }
56         invoked = true;
57     }
58 }
59
Popular Tags