View Javadoc

1   /*
2    * $Id: WSDDJavaMuleProvider.java 10489 2008-01-23 17:53:38Z dfeist $
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.transport.soap.axis.extensions;
12  
13  import org.mule.transport.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   */
26  public class WSDDJavaMuleProvider extends WSDDProvider
27  {
28      private AxisConnector connector;
29  
30      public WSDDJavaMuleProvider(AxisConnector connector)
31      {
32          this.connector = connector;
33      }
34  
35      /**
36       * Factory method for creating an <code>MuleRPCProvider</code>.
37       * 
38       * @param wsddService a <code>WSDDService</code> value
39       * @param engineConfiguration an <code>EngineConfiguration</code> value
40       * @return a <code>Handler</code> value
41       * @exception Exception if an error occurs
42       */
43      public org.apache.axis.Handler newProviderInstance(WSDDService wsddService,
44                                                         EngineConfiguration engineConfiguration)
45          throws Exception
46      {
47          String serviceStyle = wsddService.getStyle().toString();
48          if (serviceStyle.equals("message"))
49          {
50              return new MuleMsgProvider(connector);
51          }
52          return new MuleRPCProvider(connector);
53      }
54  
55      /**
56       * @return String
57       * @see org.apache.axis.deployment.wsdd.WSDDProvider#getName()
58       */
59      public String getName()
60      {
61          return WSDDConstants.PROVIDER_RPC;
62      }
63  }