View Javadoc

1   /*
2    * $Id: MuleConfigProvider.java 7976 2007-08-21 14:26:13Z dirk.olmes $
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.providers.soap.axis.extensions;
12  
13  import java.util.ArrayList;
14  import java.util.Iterator;
15  import java.util.List;
16  
17  import org.apache.axis.AxisEngine;
18  import org.apache.axis.ConfigurationException;
19  import org.apache.axis.EngineConfiguration;
20  import org.apache.axis.configuration.SimpleProvider;
21  
22  /**
23   * <code>MuleConfigProvider</code> is needed because the Simple Provider does not
24   * list services in the defaultConfiguration
25   * 
26   * @author <a href="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
27   * @version $Revision: 7976 $
28   */
29  public class MuleConfigProvider extends SimpleProvider
30  {
31      private EngineConfiguration engineConfiguration;
32  
33      public MuleConfigProvider(EngineConfiguration engineConfiguration)
34      {
35          super(engineConfiguration);
36          this.engineConfiguration = engineConfiguration;
37      }
38  
39      /**
40       * Configure an AxisEngine. Right now just calls the default configuration if
41       * there is one, since we don't do anything special.
42       */
43      public void configureEngine(AxisEngine engine) throws ConfigurationException
44      {
45          synchronized (this)
46          {
47              engineConfiguration.configureEngine(engine);
48              super.configureEngine(engine);
49          }
50      }
51  
52      public Iterator getAxisDeployedServices() throws ConfigurationException
53      {
54          return engineConfiguration.getDeployedServices();
55      }
56  
57      public Iterator getAllDeployedServices() throws ConfigurationException
58      {
59          List services = new ArrayList();
60          Iterator iter = engineConfiguration.getDeployedServices();
61          while (iter.hasNext())
62          {
63              services.add(iter.next());
64          }
65          iter = super.getDeployedServices();
66          while (iter.hasNext())
67          {
68              services.add(iter.next());
69          }
70          return services.iterator();
71      }
72  }