View Javadoc
1   /*
2    * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3    * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4    *
5    * This code is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU General Public License version 2 only, as
7    * published by the Free Software Foundation.  Oracle designates this
8    * particular file as subject to the "Classpath" exception as provided
9    * by Oracle in the LICENSE file that accompanied this code.
10   *
11   * This code is distributed in the hope that it will be useful, but WITHOUT
12   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14   * version 2 for more details (a copy is included in the LICENSE file that
15   * accompanied this code).
16   *
17   * You should have received a copy of the GNU General Public License version
18   * 2 along with this work; if not, write to the Free Software Foundation,
19   * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20   *
21   * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22   * or visit www.oracle.com if you need additional information or have any
23   * questions.
24   */
25  
26  package com.sun.xml.internal.ws.api.wsdl.writer;
27  
28  import com.sun.xml.internal.txw2.TypedXmlWriter;
29  import com.sun.xml.internal.ws.api.model.SEIModel;
30  import com.sun.xml.internal.ws.api.WSBinding;
31  import com.sun.xml.internal.ws.api.server.Container;
32  import com.sun.istack.internal.NotNull;
33  import com.sun.istack.internal.Nullable;
34  
35  /**
36   * WSDLGeneatorContext provides a context for the WSDLGeneratorExtension and is used in
37   * {@link WSDLGeneratorExtension#start(WSDLGenExtnContext)}. This context consists of TXW, {@link SEIModel},
38   * {@link WSBinding}, {@link Container}, and implementation class. WSDL extensions are used to
39   * extend the generated WSDL by adding implementation specific extensions.
40   *
41   * @author Jitendra Kotamraju
42   */
43  public class WSDLGenExtnContext {
44      private final TypedXmlWriter root;
45      private final SEIModel model;
46      private final WSBinding binding;
47      private final Container container;
48      private final Class endpointClass;
49  
50      /**
51       * Constructs WSDL Generation context for the extensions
52       *
53       * @param root      This is the root element of the generated WSDL.
54       * @param model     WSDL is being generated from this {@link SEIModel}.
55       * @param binding   The binding for which we generate WSDL. the binding {@link WSBinding} represents a particular
56       *                  configuration of JAXWS. This can be typically be overriden by
57       * @param container The entry point to the external environment.
58       *                  If this extension is used at the runtime to generate WSDL, you get a {@link Container}
59       *                  that was given to {@link com.sun.xml.internal.ws.api.server.WSEndpoint#create}.
60       */
61      public WSDLGenExtnContext(@NotNull TypedXmlWriter root, @NotNull SEIModel model, @NotNull WSBinding binding,
62                                @Nullable Container container, @NotNull Class endpointClass) {
63          this.root = root;
64          this.model = model;
65          this.binding = binding;
66          this.container = container;
67          this.endpointClass = endpointClass;
68      }
69  
70      public TypedXmlWriter getRoot() {
71          return root;
72      }
73  
74      public SEIModel getModel() {
75          return model;
76      }
77  
78      public WSBinding getBinding() {
79          return binding;
80      }
81  
82      public Container getContainer() {
83          return container;
84      }
85  
86      public Class getEndpointClass() {
87          return endpointClass;
88      }
89  
90  }