001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common Development
008: * and Distribution License("CDDL") (collectively, the "License"). You
009: * may not use this file except in compliance with the License. You can obtain
010: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
011: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
012: * language governing permissions and limitations under the License.
013: *
014: * When distributing the software, include this License Header Notice in each
015: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
016: * Sun designates this particular file as subject to the "Classpath" exception
017: * as provided by Sun in the GPL Version 2 section of the License file that
018: * accompanied this code. If applicable, add the following below the License
019: * Header, with the fields enclosed by brackets [] replaced by your own
020: * identifying information: "Portions Copyrighted [year]
021: * [name of copyright owner]"
022: *
023: * Contributor(s):
024: *
025: * If you wish your version of this file to be governed by only the CDDL or
026: * only the GPL Version 2, indicate your decision by adding "[Contributor]
027: * elects to include this software in this distribution under the [CDDL or GPL
028: * Version 2] license." If you don't indicate a single choice of license, a
029: * recipient has the option to distribute your version of this file under
030: * either the CDDL, the GPL Version 2 or to extend the choice of license to
031: * its licensees as provided above. However, if you add GPL Version 2 code
032: * and therefore, elected the GPL Version 2 license, then the option applies
033: * only if the new code is made subject to such option by the copyright
034: * holder.
035: */
036:
037: package com.sun.xml.ws.assembler;
038:
039: import com.sun.xml.ws.api.WSBinding;
040: import com.sun.xml.ws.api.model.wsdl.WSDLPort;
041: import com.sun.xml.ws.api.pipe.Pipe;
042: import com.sun.xml.ws.api.pipe.PipelineAssembler;
043: import com.sun.xml.ws.policy.PolicyMap;
044:
045: import javax.xml.ws.Dispatch;
046:
047: /**
048: * Entry point to the various configuration information
049: * necessary for constructing {@link Pipe}s.
050: *
051: * <p>
052: * This object is created by a {@link PipelineAssembler} and
053: * passed as a constructor parameter to most pipes,
054: * so that they can access configuration information.
055: *
056: * @author Kohsuke Kawaguchi
057: */
058: public abstract class PipeConfiguration {
059: private final PolicyMap policy;
060: private final WSDLPort wsdlModel;
061:
062: PipeConfiguration(PolicyMap policy, WSDLPort wsdlModel) {
063: this .policy = policy;
064: this .wsdlModel = wsdlModel;
065: }
066:
067: /**
068: * Gets the {@link PolicyMap} that represents
069: * the policy information applicable to the current pipeline.
070: *
071: * @return always non-null same object.
072: */
073: public PolicyMap getPolicyMap() {
074: return policy;
075: }
076:
077: /**
078: * Gets the {@link WSDLPort} that represents
079: * the WSDL information about the port for which
080: * a pipeline is created.
081: *
082: * <p>
083: * This model is present only when the client
084: * provided WSDL to the JAX-WS runtime in some means
085: * (such as indirectly through SEI or through {@link Dispatch}.)
086: *
087: * <p>
088: * JAX-WS allows modes of operations where no WSDL
089: * is available for the current pipeline, and in which
090: * case this model is not present.
091: *
092: * @return null if this model is not present.
093: * If non-null, it's always the same object.
094: */
095: public WSDLPort getWSDLModel() {
096: return wsdlModel;
097: }
098:
099: /**
100: * Gets the applicable {@link WSBinding} for this pipeline.
101: *
102: * @return always non-null.
103: */
104: public abstract WSBinding getBinding();
105: }
|