View Javadoc

1   /*
2    * $Id: MuleConfigProvider.java 7963 2007-08-21 08:53:15Z 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  public class MuleConfigProvider extends SimpleProvider
27  {
28      private EngineConfiguration engineConfiguration;
29  
30      public MuleConfigProvider(EngineConfiguration engineConfiguration)
31      {
32          super(engineConfiguration);
33          this.engineConfiguration = engineConfiguration;
34      }
35  
36      /**
37       * Configure an AxisEngine. Right now just calls the default configuration if
38       * there is one, since we don't do anything special.
39       */
40      public void configureEngine(AxisEngine engine) throws ConfigurationException
41      {
42          synchronized (this)
43          {
44              engineConfiguration.configureEngine(engine);
45              super.configureEngine(engine);
46          }
47      }
48  
49      public Iterator getAxisDeployedServices() throws ConfigurationException
50      {
51          return engineConfiguration.getDeployedServices();
52      }
53  
54      public Iterator getAllDeployedServices() throws ConfigurationException
55      {
56          List services = new ArrayList();
57          Iterator iter = engineConfiguration.getDeployedServices();
58          while (iter.hasNext())
59          {
60              services.add(iter.next());
61          }
62          iter = super.getDeployedServices();
63          while (iter.hasNext())
64          {
65              services.add(iter.next());
66          }
67          return services.iterator();
68      }
69  }