View Javadoc

1   /*
2    * $Id: WSDDJavaMuleProvider.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 org.mule.providers.soap.axis.AxisConnector;
14  
15  import org.apache.axis.EngineConfiguration;
16  import org.apache.axis.deployment.wsdd.WSDDConstants;
17  import org.apache.axis.deployment.wsdd.WSDDProvider;
18  import org.apache.axis.deployment.wsdd.WSDDService;
19  
20  /**
21   * <code>WSDDJavaMuleProvider</code> is a factory class for creating the
22   * MuleProvider
23   * 
24   * @see MuleRPCProvider
25   * @author <a href="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
26   * @version $Revision: 7976 $
27   */
28  public class WSDDJavaMuleProvider extends WSDDProvider
29  {
30      private AxisConnector connector;
31  
32      public WSDDJavaMuleProvider(AxisConnector connector)
33      {
34          this.connector = connector;
35      }
36  
37      /**
38       * Factory method for creating an <code>MuleRPCProvider</code>.
39       * 
40       * @param wsddService a <code>WSDDService</code> value
41       * @param engineConfiguration an <code>EngineConfiguration</code> value
42       * @return a <code>Handler</code> value
43       * @exception Exception if an error occurs
44       */
45      public org.apache.axis.Handler newProviderInstance(WSDDService wsddService,
46                                                         EngineConfiguration engineConfiguration)
47          throws Exception
48      {
49          String serviceStyle = wsddService.getStyle().toString();
50          if (serviceStyle.equals("message"))
51          {
52              return new MuleMsgProvider(connector);
53          }
54          return new MuleRPCProvider(connector);
55      }
56  
57      /**
58       * @return String
59       * @see org.apache.axis.deployment.wsdd.WSDDProvider#getName()
60       */
61      public String getName()
62      {
63          return WSDDConstants.PROVIDER_RPC;
64      }
65  }