Package com.sun.xml.ws.binding
Class BindingImpl
- java.lang.Object
-
- com.sun.xml.ws.binding.BindingImpl
-
- All Implemented Interfaces:
WSBinding
,jakarta.xml.ws.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.
- Author:
- WS Development Team
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
BindingImpl.MessageKey
Experimental: Identify messages based on the name of the message and the operation that uses this message.
-
Field Summary
Fields Modifier and Type Field Description protected static jakarta.xml.ws.WebServiceFeature[]
EMPTY_FEATURES
protected Map<BindingImpl.MessageKey,WebServiceFeatureList>
faultMessageFeatures
protected WebServiceFeatureList
features
protected Map<QName,WebServiceFeatureList>
inputMessageFeatures
protected MessageContextFactory
messageContextFactory
protected Map<QName,WebServiceFeatureList>
operationFeatures
protected Map<QName,WebServiceFeatureList>
outputMessageFeatures
protected jakarta.xml.ws.Service.Mode
serviceMode
-
Constructor Summary
Constructors Modifier Constructor Description protected
BindingImpl(BindingID bindingId, jakarta.xml.ws.WebServiceFeature... features)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addKnownHeader(QName headerQName)
Adds header QName to set known to be supported by this bindingstatic BindingImpl
create(BindingID bindingId)
static BindingImpl
create(BindingID bindingId, jakarta.xml.ws.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 withWSBinding
that apply to one of the fault messages of an operation.<F extends jakarta.xml.ws.WebServiceFeature>
FgetFeature(Class<F> featureType)
Gets aWebServiceFeature
of the specific type.WebServiceFeatureList
getFeatures()
Returns a list of features associated withWSBinding
.List<jakarta.xml.ws.handler.Handler>
getHandlerChain()
HandlerConfiguration
getHandlerConfig()
WebServiceFeatureList
getInputMessageFeatures(QName operationName)
Experimental: Returns a list of features associated withWSBinding
that apply to the input message of an operation.Set<QName>
getKnownHeaders()
Returns set of header QNames known to be supported by this binding.MessageContextFactory
getMessageContextFactory()
<F extends jakarta.xml.ws.WebServiceFeature>
FgetOperationFeature(Class<F> featureType, QName operationName)
Experimental: Gets aWebServiceFeature
of the specific type that applies to an operation.WebServiceFeatureList
getOperationFeatures(QName operationName)
Experimental: Returns a list of features associated withWSBinding
that apply to a particular operation.WebServiceFeatureList
getOutputMessageFeatures(QName operationName)
Experimental: Returns a list of features associated withWSBinding
that apply to the output message of an operation.SOAPVersion
getSOAPVersion()
Gets the SOAP version of this binding.static void
initializeJavaActivationHandlers()
boolean
isFeatureEnabled(Class<? extends jakarta.xml.ws.WebServiceFeature> feature)
Checks if a particularWebServiceFeature
is enabled.boolean
isOperationFeatureEnabled(Class<? extends jakarta.xml.ws.WebServiceFeature> featureType, QName operationName)
Experimental: Checks if a particularWebServiceFeature
on an operation is enabled.void
setFaultMessageFeatures(QName operationName, QName messageName, jakarta.xml.ws.WebServiceFeature... newFeatures)
protected void
setHandlerConfig(HandlerConfiguration handlerConfig)
void
setInputMessageFeatures(QName operationName, jakarta.xml.ws.WebServiceFeature... newFeatures)
void
setMode(jakarta.xml.ws.Service.Mode mode)
void
setOperationFeatures(QName operationName, jakarta.xml.ws.WebServiceFeature... newFeatures)
void
setOutputMessageFeatures(QName operationName, jakarta.xml.ws.WebServiceFeature... newFeatures)
-
-
-
Field Detail
-
EMPTY_FEATURES
protected static final jakarta.xml.ws.WebServiceFeature[] EMPTY_FEATURES
-
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 jakarta.xml.ws.Service.Mode serviceMode
-
messageContextFactory
protected MessageContextFactory messageContextFactory
-
-
Constructor Detail
-
BindingImpl
protected BindingImpl(BindingID bindingId, jakarta.xml.ws.WebServiceFeature... features)
-
-
Method Detail
-
getHandlerChain
@NotNull public List<jakarta.xml.ws.handler.Handler> getHandlerChain()
- Specified by:
getHandlerChain
in interfacejakarta.xml.ws.Binding
- Specified by:
getHandlerChain
in interfaceWSBinding
-
getHandlerConfig
public HandlerConfiguration getHandlerConfig()
-
setHandlerConfig
protected void setHandlerConfig(HandlerConfiguration handlerConfig)
-
setMode
public void setMode(@NotNull jakarta.xml.ws.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.- Specified by:
getKnownHeaders
in interfaceWSBinding
- Returns:
- Set of known QNames
-
addKnownHeader
public boolean addKnownHeader(QName headerQName)
Description copied from interface:WSBinding
Adds header QName to set known to be supported by this binding- Specified by:
addKnownHeader
in interfaceWSBinding
- Parameters:
headerQName
- Known header QName- Returns:
- true, if new entry was added; false, if known header QName was already known
-
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 interfaceWSBinding
- 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 bindingThis is just a short-cut for
getBindingID().getSOAPVersion()
- Specified by:
getSOAPVersion
in interfaceWSBinding
- 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. SeeMessage
for how a non-SOAP binding shall be handled byTube
s.
-
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 interfaceWSBinding
- 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()
-
initializeJavaActivationHandlers
public static void initializeJavaActivationHandlers()
-
create
public static BindingImpl create(@NotNull BindingID bindingId)
-
create
public static BindingImpl create(@NotNull BindingID bindingId, jakarta.xml.ws.WebServiceFeature[] features)
-
getDefaultBinding
public static WSBinding getDefaultBinding()
-
getBindingID
public String getBindingID()
- Specified by:
getBindingID
in interfacejakarta.xml.ws.Binding
-
getFeature
@Nullable public <F extends jakarta.xml.ws.WebServiceFeature> F getFeature(@NotNull Class<F> featureType)
Description copied from interface:WSBinding
Gets aWebServiceFeature
of the specific type.- Specified by:
getFeature
in interfaceWSBinding
- 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 jakarta.xml.ws.WebServiceFeature> F getOperationFeature(@NotNull Class<F> featureType, @NotNull QName operationName)
Description copied from interface:WSBinding
Experimental: Gets aWebServiceFeature
of the specific type that applies to an operation.- Specified by:
getOperationFeature
in interfaceWSBinding
- 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 jakarta.xml.ws.WebServiceFeature> feature)
Description copied from interface:WSBinding
Checks if a particularWebServiceFeature
is enabled.- Specified by:
isFeatureEnabled
in interfaceWSBinding
- Returns:
- true if enabled.
-
isOperationFeatureEnabled
public boolean isOperationFeatureEnabled(@NotNull Class<? extends jakarta.xml.ws.WebServiceFeature> featureType, @NotNull QName operationName)
Description copied from interface:WSBinding
Experimental: Checks if a particularWebServiceFeature
on an operation is enabled.- Specified by:
isOperationFeatureEnabled
in interfaceWSBinding
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 withWSBinding
.- Specified by:
getFeatures
in interfaceWSBinding
-
getOperationFeatures
@NotNull public WebServiceFeatureList getOperationFeatures(@NotNull QName operationName)
Description copied from interface:WSBinding
Experimental: Returns a list of features associated withWSBinding
that apply to a particular operation.- Specified by:
getOperationFeatures
in interfaceWSBinding
- 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 withWSBinding
that apply to the input message of an operation.- Specified by:
getInputMessageFeatures
in interfaceWSBinding
- 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 withWSBinding
that apply to the output message of an operation.- Specified by:
getOutputMessageFeatures
in interfaceWSBinding
- 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 withWSBinding
that apply to one of the fault messages of an operation.- Specified by:
getFaultMessageFeatures
in interfaceWSBinding
- Parameters:
operationName
- The WSDL name of the operation.messageName
- The WSDL name of the fault message.
-
setOperationFeatures
public void setOperationFeatures(@NotNull QName operationName, jakarta.xml.ws.WebServiceFeature... newFeatures)
-
setInputMessageFeatures
public void setInputMessageFeatures(@NotNull QName operationName, jakarta.xml.ws.WebServiceFeature... newFeatures)
-
setOutputMessageFeatures
public void setOutputMessageFeatures(@NotNull QName operationName, jakarta.xml.ws.WebServiceFeature... newFeatures)
-
setFaultMessageFeatures
public void setFaultMessageFeatures(@NotNull QName operationName, @NotNull QName messageName, jakarta.xml.ws.WebServiceFeature... newFeatures)
-
getMessageContextFactory
@NotNull public MessageContextFactory getMessageContextFactory()
- Specified by:
getMessageContextFactory
in interfaceWSBinding
- Returns:
- A MessageContextFactory configured according to the binding's features.
-
-