001: /*
002: * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025: package com.sun.xml.internal.ws.client;
026:
027: import com.sun.xml.internal.ws.pept.encoding.Decoder;
028: import com.sun.xml.internal.ws.pept.encoding.Encoder;
029: import com.sun.xml.internal.ws.pept.ept.ContactInfo;
030: import com.sun.xml.internal.ws.pept.ept.MessageInfo;
031: import com.sun.xml.internal.ws.pept.presentation.TargetFinder;
032: import com.sun.xml.internal.ws.pept.protocol.Interceptors;
033: import com.sun.xml.internal.ws.pept.protocol.MessageDispatcher;
034: import com.sun.xml.internal.ws.encoding.internal.InternalEncoder;
035: import com.sun.xml.internal.ws.encoding.soap.ClientEncoderDecoder;
036: import com.sun.xml.internal.ws.encoding.soap.SOAPDecoder;
037: import com.sun.xml.internal.ws.encoding.soap.SOAPEPTFactory;
038: import com.sun.xml.internal.ws.encoding.soap.SOAPEncoder;
039: import com.sun.xml.internal.ws.spi.runtime.WSConnection;
040:
041: import javax.xml.ws.soap.SOAPBinding;
042:
043: /**
044: * @author WS Development Team
045: */
046: public class ContactInfoBase implements ContactInfo, SOAPEPTFactory {
047: protected WSConnection _connection;
048: protected MessageDispatcher _messageDispatcher;
049: protected Encoder _encoder;
050: protected Decoder _decoder;
051: private String bindingId;
052: private InternalEncoder internalEncoder;
053:
054: public ContactInfoBase(WSConnection connection,
055: MessageDispatcher messageDispatcher, Encoder encoder,
056: Decoder decoder, String bindingId) {
057: _connection = connection;
058: _messageDispatcher = messageDispatcher;
059: _encoder = encoder;
060: _decoder = decoder;
061: internalEncoder = new ClientEncoderDecoder();
062: this .bindingId = bindingId;
063: }
064:
065: public ContactInfoBase() {
066: _connection = null;
067: _messageDispatcher = null;
068: _encoder = null;
069: _decoder = null;
070: }
071:
072: /* (non-Javadoc)
073: * @see com.sun.pept.ept.ContactInfo#getConnection(com.sun.pept.ept.MessageInfo)
074: */
075: public WSConnection getConnection(MessageInfo arg0) {
076: return _connection;
077: }
078:
079: /* (non-Javadoc)
080: * @see com.sun.pept.ept.EPTFactory#getMessageDispatcher(com.sun.pept.ept.MessageInfo)
081: */
082: public MessageDispatcher getMessageDispatcher(MessageInfo arg0) {
083: return _messageDispatcher;
084: }
085:
086: /* (non-Javadoc)
087: * @see com.sun.pept.ept.EPTFactory#getEncoder(com.sun.pept.ept.MessageInfo)
088: */
089: public Encoder getEncoder(MessageInfo arg0) {
090: return _encoder;
091: }
092:
093: /* (non-Javadoc)
094: * @see com.sun.pept.ept.EPTFactory#getDecoder(com.sun.pept.ept.MessageInfo)
095: */
096: public Decoder getDecoder(MessageInfo arg0) {
097: return _decoder;
098: }
099:
100: /* (non-Javadoc)
101: * @see com.sun.pept.ept.EPTFactory#getInterceptors(com.sun.pept.ept.MessageInfo)
102: */
103: public Interceptors getInterceptors(MessageInfo arg0) {
104: // TODO Auto-generated method stub
105: return null;
106: }
107:
108: /* (non-Javadoc)
109: * @see com.sun.pept.ept.EPTFactory#getTargetFinder(com.sun.pept.ept.MessageInfo)
110: */
111: public TargetFinder getTargetFinder(MessageInfo arg0) {
112: // TODO Auto-generated method stub
113: return null;
114: }
115:
116: public SOAPEncoder getSOAPEncoder() {
117: return (SOAPEncoder) _encoder;
118: }
119:
120: public SOAPDecoder getSOAPDecoder() {
121: return (SOAPDecoder) _decoder;
122: }
123:
124: public InternalEncoder getInternalEncoder() {
125: return internalEncoder;
126: }
127:
128: public String getBindingId() {
129: if (bindingId == null) {
130: return SOAPBinding.SOAP11HTTP_BINDING;
131: }
132:
133: return bindingId;
134: }
135: }
|