com.sun.xml.ws.binding
Class BindingImpl

java.lang.Object
  extended by com.sun.xml.ws.binding.BindingImpl
All Implemented Interfaces:
WSBinding, Binding
Direct Known Subclasses:
HTTPBindingImpl, SOAPBindingImpl

public abstract class BindingImpl
extends Object
implements WSBinding

Instances are created by the service, which then sets the handler chain on the binding impl.

This class is made abstract as we don't see a situation when a BindingImpl has much meaning without binding id. IOW, for a specific binding there will be a class extending BindingImpl, for example SOAPBindingImpl.

The spi Binding interface extends Binding.


Nested Class Summary
protected static class BindingImpl.MessageKey
          Experimental: Identify messages based on the name of the message and the operation that uses this message.
 
Field Summary
protected static WebServiceFeature[] EMPTY_FEATURES
           
protected  Map<BindingImpl.MessageKey,WebServiceFeatureList> faultMessageFeatures
           
protected  WebServiceFeatureList features
           
protected  HandlerConfiguration handlerConfig
           
protected  Map<QName,WebServiceFeatureList> inputMessageFeatures
           
protected  org.jvnet.ws.message.MessageContextFactory messageContextFactory
           
protected  Map<QName,WebServiceFeatureList> operationFeatures
           
protected  Map<QName,WebServiceFeatureList> outputMessageFeatures
           
protected  Service.Mode serviceMode
           
 
Constructor Summary
protected BindingImpl(BindingID bindingId, WebServiceFeature... features)
           
 
Method Summary
 void addFeature(WebServiceFeature newFeature)
           
static BindingImpl create(BindingID bindingId)
           
static BindingImpl create(BindingID bindingId, WebServiceFeature[] features)
           
 Codec createCodec()
           
 AddressingVersion getAddressingVersion()
          Gets the WS-Addressing version of this binding.
 BindingID getBindingId()
          Gets the binding ID, which uniquely identifies the binding.
 String getBindingID()
           
static WSBinding getDefaultBinding()
           
 WebServiceFeatureList getFaultMessageFeatures(QName operationName, QName messageName)
          Experimental: Returns a list of features associated with WSBinding that apply to one of the fault messages of an operation.
<F extends WebServiceFeature>
F
getFeature(Class<F> featureType)
          Gets a WebServiceFeature of the specific type.
 WebServiceFeatureList getFeatures()
          Returns a list of features associated with WSBinding.
 List<Handler> getHandlerChain()
           
 HandlerConfiguration getHandlerConfig()
           
 WebServiceFeatureList getInputMessageFeatures(QName operationName)
          Experimental: Returns a list of features associated with WSBinding that apply to the input message of an operation.
 Set<QName> getKnownHeaders()
          Returns set of header QNames known to be supported by this binding.
 org.jvnet.ws.message.MessageContextFactory getMessageContextFactory()
           
<F extends WebServiceFeature>
F
getOperationFeature(Class<F> featureType, QName operationName)
          Experimental: Gets a WebServiceFeature of the specific type that applies to an operation.
 WebServiceFeatureList getOperationFeatures(QName operationName)
          Experimental: Returns a list of features associated with WSBinding that apply to a particular operation.
 WebServiceFeatureList getOutputMessageFeatures(QName operationName)
          Experimental: Returns a list of features associated with WSBinding that apply to the output message of an operation.
 SOAPVersion getSOAPVersion()
          Gets the SOAP version of this binding.
 boolean isFeatureEnabled(Class<? extends WebServiceFeature> feature)
          Checks if a particular WebServiceFeature is enabled.
 boolean isOperationFeatureEnabled(Class<? extends WebServiceFeature> featureType, QName operationName)
          Experimental: Checks if a particular WebServiceFeature on an operation is enabled.
 void setFaultMessageFeatures(QName operationName, QName messageName, WebServiceFeature... newFeatures)
           
 void setFeatures(WebServiceFeature... newFeatures)
           
 void setInputMessageFeatures(QName operationName, WebServiceFeature... newFeatures)
           
 void setMode(Service.Mode mode)
           
 void setOperationFeatures(QName operationName, WebServiceFeature... newFeatures)
           
 void setOutputMessageFeatures(QName operationName, WebServiceFeature... newFeatures)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.xml.ws.Binding
setHandlerChain
 

Field Detail

EMPTY_FEATURES

protected static final WebServiceFeature[] EMPTY_FEATURES

handlerConfig

protected HandlerConfiguration handlerConfig

features

protected final WebServiceFeatureList features

operationFeatures

protected final Map<QName,WebServiceFeatureList> operationFeatures

inputMessageFeatures

protected final Map<QName,WebServiceFeatureList> inputMessageFeatures

outputMessageFeatures

protected final Map<QName,WebServiceFeatureList> outputMessageFeatures

faultMessageFeatures

protected final Map<BindingImpl.MessageKey,WebServiceFeatureList> faultMessageFeatures

serviceMode

protected Service.Mode serviceMode

messageContextFactory

protected org.jvnet.ws.message.MessageContextFactory messageContextFactory
Constructor Detail

BindingImpl

protected BindingImpl(BindingID bindingId,
                      WebServiceFeature... features)
Method Detail

getHandlerChain

@NotNull
public List<Handler> getHandlerChain()
Specified by:
getHandlerChain in interface WSBinding
Specified by:
getHandlerChain in interface Binding

getHandlerConfig

public HandlerConfiguration getHandlerConfig()

setMode

public void setMode(@NotNull
                    Service.Mode mode)

getKnownHeaders

public Set<QName> getKnownHeaders()
Description copied from interface: WSBinding
Returns set of header QNames known to be supported by this binding. Tubes should use this Set to add QNames for headers they process so that must-understand processing can validate headers on inbound messages

Specified by:
getKnownHeaders in interface WSBinding
Returns:
Set of known QNames

getBindingId

@NotNull
public BindingID getBindingId()
Description copied from interface: WSBinding
Gets the binding ID, which uniquely identifies the binding.

The relevant specs define the binding IDs and what they mean. The ID is used in many places to identify the kind of binding (such as SOAP1.1, SOAP1.2, REST, ...)

Specified by:
getBindingId in interface WSBinding
Returns:
Always non-null same value.

getSOAPVersion

public final SOAPVersion getSOAPVersion()
Description copied from interface: WSBinding
Gets the SOAP version of this binding. TODO: clarify what to do with XML/HTTP binding

This is just a short-cut for getBindingID().getSOAPVersion()

Specified by:
getSOAPVersion in interface WSBinding
Returns:
If the binding is using SOAP, this method returns a SOAPVersion constant. If the binding is not based on SOAP, this method returns null. See Message for how a non-SOAP binding shall be handled by Tubes.

getAddressingVersion

public AddressingVersion getAddressingVersion()
Description copied from interface: WSBinding
Gets the WS-Addressing version of this binding.

TODO: clarify what to do with XML/HTTP binding

Specified by:
getAddressingVersion in interface WSBinding
Returns:
If the binding is using SOAP and WS-Addressing is enabled, this method returns a AddressingVersion constant. If binding is not using SOAP or WS-Addressing is not enabled, this method returns null. This might be little slow as it has to go over all the features on binding. Its advisable to cache the addressingVersion wherever possible and reuse it.

createCodec

@NotNull
public final Codec createCodec()

create

public static BindingImpl create(@NotNull
                                 BindingID bindingId)

create

public static BindingImpl create(@NotNull
                                 BindingID bindingId,
                                 WebServiceFeature[] features)

getDefaultBinding

public static WSBinding getDefaultBinding()

getBindingID

public String getBindingID()
Specified by:
getBindingID in interface Binding

getFeature

@Nullable
public <F extends WebServiceFeature> F getFeature(@NotNull
                                                           Class<F> featureType)
Description copied from interface: WSBinding
Gets a WebServiceFeature of the specific type.

Specified by:
getFeature in interface WSBinding
Parameters:
featureType - The type of the feature to retrieve.
Returns:
If the feature is present and enabled, return a non-null instance. Otherwise null.

getOperationFeature

@Nullable
public <F extends WebServiceFeature> F getOperationFeature(@NotNull
                                                                    Class<F> featureType,
                                                                    @NotNull
                                                                    QName operationName)
Description copied from interface: WSBinding
Experimental: Gets a WebServiceFeature of the specific type that applies to an operation.

Specified by:
getOperationFeature in interface WSBinding
Parameters:
featureType - The type of the feature to retrieve.
operationName - The WSDL name of the operation.
Returns:
If the feature is present and enabled, return a non-null instance. Otherwise null.

isFeatureEnabled

public boolean isFeatureEnabled(@NotNull
                                Class<? extends WebServiceFeature> feature)
Description copied from interface: WSBinding
Checks if a particular WebServiceFeature is enabled.

Specified by:
isFeatureEnabled in interface WSBinding
Returns:
true if enabled.

isOperationFeatureEnabled

public boolean isOperationFeatureEnabled(@NotNull
                                         Class<? extends WebServiceFeature> featureType,
                                         @NotNull
                                         QName operationName)
Description copied from interface: WSBinding
Experimental: Checks if a particular WebServiceFeature on an operation is enabled.

Specified by:
isOperationFeatureEnabled in interface WSBinding
operationName - The WSDL name of the operation.
Returns:
true if enabled.

getFeatures

@NotNull
public WebServiceFeatureList getFeatures()
Description copied from interface: WSBinding
Returns a list of features associated with WSBinding.

Specified by:
getFeatures in interface WSBinding

getOperationFeatures

@NotNull
public WebServiceFeatureList getOperationFeatures(@NotNull
                                                          QName operationName)
Description copied from interface: WSBinding
Experimental: Returns a list of features associated with WSBinding that apply to a particular operation.

Specified by:
getOperationFeatures in interface WSBinding
Parameters:
operationName - The WSDL name of the operation.

getInputMessageFeatures

@NotNull
public WebServiceFeatureList getInputMessageFeatures(@NotNull
                                                             QName operationName)
Description copied from interface: WSBinding
Experimental: Returns a list of features associated with WSBinding that apply to the input message of an operation.

Specified by:
getInputMessageFeatures in interface WSBinding
Parameters:
operationName - The WSDL name of the operation.

getOutputMessageFeatures

@NotNull
public WebServiceFeatureList getOutputMessageFeatures(@NotNull
                                                              QName operationName)
Description copied from interface: WSBinding
Experimental: Returns a list of features associated with WSBinding that apply to the output message of an operation.

Specified by:
getOutputMessageFeatures in interface WSBinding
Parameters:
operationName - The WSDL name of the operation.

getFaultMessageFeatures

@NotNull
public WebServiceFeatureList getFaultMessageFeatures(@NotNull
                                                             QName operationName,
                                                             @NotNull
                                                             QName messageName)
Description copied from interface: WSBinding
Experimental: Returns a list of features associated with WSBinding that apply to one of the fault messages of an operation.

Specified by:
getFaultMessageFeatures in interface WSBinding
Parameters:
operationName - The WSDL name of the operation.
messageName - The WSDL name of the fault message.

setFeatures

public void setFeatures(WebServiceFeature... newFeatures)

setOperationFeatures

public void setOperationFeatures(@NotNull
                                 QName operationName,
                                 WebServiceFeature... newFeatures)

setInputMessageFeatures

public void setInputMessageFeatures(@NotNull
                                    QName operationName,
                                    WebServiceFeature... newFeatures)

setOutputMessageFeatures

public void setOutputMessageFeatures(@NotNull
                                     QName operationName,
                                     WebServiceFeature... newFeatures)

setFaultMessageFeatures

public void setFaultMessageFeatures(@NotNull
                                    QName operationName,
                                    @NotNull
                                    QName messageName,
                                    WebServiceFeature... newFeatures)

addFeature

public void addFeature(@NotNull
                       WebServiceFeature newFeature)

getMessageContextFactory

@NotNull
public org.jvnet.ws.message.MessageContextFactory getMessageContextFactory()
Specified by:
getMessageContextFactory in interface WSBinding
Returns:
A MessageContextFactory configured according to the binding's features.


Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.