View Javadoc

    1   package org.codehaus.xfire.wsdl11.builder;
    2
    3   import java.io.IOException;
    4   import java.io.OutputStream;
    5
    6   import org.codehaus.xfire.service.Service;
    7   import org.codehaus.xfire.transport.TransportManager;
    8   import org.codehaus.xfire.wsdl.WSDLWriter;
    9   import org.codehaus.xfire.wsdl11.WSDL11ParameterBinding;
    10
    11  /***
    12   * An adapter for a <code>WSDLBuilder</code> so that it conforms to the <code>WSDLWriter</code> interface.
    13   *
    14   * @author <a href="mailto:poutsma@mac.com">Arjen Poutsma</a>
    15   */
    16  public class WSDLBuilderAdapter
    17          implements WSDLWriter
    18  {
    19      private WSDLBuilderFactory wsdlBuilderFactory;
    20      private Service service;
    21      private TransportManager transportManager;
    22      private WSDL11ParameterBinding paramBinding;
    23
    24      public WSDLBuilderAdapter(WSDLBuilderFactory wsdlBuilderFactory,
    25                                Service service,
    26                                TransportManager transports,
    27                                WSDL11ParameterBinding paramBinding)
    28      {
    29          this.wsdlBuilderFactory = wsdlBuilderFactory;
    30          this.service = service;
    31          this.transportManager = transports;
    32          this.paramBinding = paramBinding;
    33      }
    34
    35      /***
    36       * Write the WSDL to an OutputStream.
    37       *
    38       * @param out The OutputStream.
    39       * @throws java.io.IOException
    40       */
    41      public void write(OutputStream out)
    42          throws IOException
    43      {
    44          wsdlBuilderFactory.createWSDLBuilder(service, paramBinding, transportManager).write(out);
    45      }
    46
    47  }