Package jakarta.xml.ws.soap
Class MTOMFeature
- java.lang.Object
-
- jakarta.xml.ws.WebServiceFeature
-
- jakarta.xml.ws.soap.MTOMFeature
-
public final class MTOMFeature extends WebServiceFeature
This feature represents the use of MTOM with a web service. This feature can be used during the creation of SEI proxy, andDispatch
instances on the client side andEndpoint
instances on the server side. This feature cannot be used forService
instance creation on the client side.The following describes the affects of this feature with respect to being enabled or disabled:
- ENABLED: In this Mode, MTOM will be enabled. A receiver MUST accept both a non-optimized and an optimized message, and a sender MAY send an optimized message, or a non-optimized message. The heuristics used by a sender to determine whether to use optimization or not are implementation-specific.
- DISABLED: In this Mode, MTOM will be disabled
The
threshold
property can be used to set the threshold value used to determine when binary data should be XOP encoded.- Since:
- 1.6, JAX-WS 2.1
-
-
Field Summary
Fields Modifier and Type Field Description static String
ID
Constant value identifying the MTOMFeature-
Fields inherited from class jakarta.xml.ws.WebServiceFeature
enabled
-
-
Constructor Summary
Constructors Constructor Description MTOMFeature()
Create anMTOMFeature
.MTOMFeature(boolean enabled)
Creates aMTOMFeature
.MTOMFeature(boolean enabled, int threshold)
Creates aMTOMFeature
.MTOMFeature(int threshold)
Creates aMTOMFeature
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getID()
Get the unique identifier for this WebServiceFeature.int
getThreshold()
Gets the threshold value used to determine when binary data should be sent as an attachment.-
Methods inherited from class jakarta.xml.ws.WebServiceFeature
isEnabled
-
-
-
-
Field Detail
-
ID
public static final String ID
Constant value identifying the MTOMFeature- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MTOMFeature
public MTOMFeature()
Create anMTOMFeature
. The instance created will be enabled.
-
MTOMFeature
public MTOMFeature(boolean enabled)
Creates aMTOMFeature
.- Parameters:
enabled
- specifies if this feature should be enabled or not
-
MTOMFeature
public MTOMFeature(int threshold)
Creates aMTOMFeature
. The instance created will be enabled.- Parameters:
threshold
- the size in bytes that binary data SHOULD be before being sent as an attachment.- Throws:
WebServiceException
- if threshold is < 0
-
MTOMFeature
public MTOMFeature(boolean enabled, int threshold)
Creates aMTOMFeature
.- Parameters:
enabled
- specifies if this feature should be enabled or notthreshold
- the size in bytes that binary data SHOULD be before being sent as an attachment.- Throws:
WebServiceException
- if threshold is < 0
-
-
Method Detail
-
getID
public String getID()
Description copied from class:WebServiceFeature
Get the unique identifier for this WebServiceFeature.- Specified by:
getID
in classWebServiceFeature
- Returns:
- the unique identifier for this feature.
-
getThreshold
public int getThreshold()
Gets the threshold value used to determine when binary data should be sent as an attachment.- Returns:
- the current threshold size in bytes
-
-