View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.soap.axis.extensions;
8   
9   import java.util.ArrayList;
10  import java.util.Iterator;
11  import java.util.List;
12  
13  import org.apache.axis.AxisEngine;
14  import org.apache.axis.ConfigurationException;
15  import org.apache.axis.EngineConfiguration;
16  import org.apache.axis.configuration.SimpleProvider;
17  
18  /**
19   * <code>MuleConfigProvider</code> is needed because the Simple Provider does not
20   * list services in the defaultConfiguration.
21   */
22  public class MuleConfigProvider extends SimpleProvider
23  {
24      private EngineConfiguration engineConfiguration;
25  
26      public MuleConfigProvider(EngineConfiguration engineConfiguration)
27      {
28          super(engineConfiguration);
29          this.engineConfiguration = engineConfiguration;
30      }
31  
32      /**
33       * Configure an AxisEngine. Right now just calls the default configuration if
34       * there is one, since we don't do anything special.
35       */
36      public void configureEngine(AxisEngine engine) throws ConfigurationException
37      {
38          synchronized (this)
39          {
40              engineConfiguration.configureEngine(engine);
41              super.configureEngine(engine);
42          }
43      }
44  
45      public Iterator getAxisDeployedServices() throws ConfigurationException
46      {
47          return engineConfiguration.getDeployedServices();
48      }
49  
50      public Iterator getAllDeployedServices() throws ConfigurationException
51      {
52          List services = new ArrayList();
53          Iterator iter = engineConfiguration.getDeployedServices();
54          while (iter.hasNext())
55          {
56              services.add(iter.next());
57          }
58          iter = super.getDeployedServices();
59          while (iter.hasNext())
60          {
61              services.add(iter.next());
62          }
63          return services.iterator();
64      }
65  }