1 5 6 package javax.xml.ws.soap; 7 8 import javax.xml.ws.Binding; 9 import javax.xml.ws.BindingType; 10 import javax.xml.ws.WebServiceFeature; 11 import javax.xml.ws.WebServiceException; 12 import javax.xml.ws.spi.Provider; 13 14 15 32 public final class MTOMFeature extends WebServiceFeature { 33 36 public static final String ID = "http://www.w3.org/2004/08/soap/features/http-optimization"; 37 38 39 45 protected int threshold = 0; 46 47 48 52 public MTOMFeature() { 53 this.enabled = true; 54 } 55 56 61 public MTOMFeature(boolean enabled) { 62 this.enabled = enabled; 63 } 64 65 66 75 public MTOMFeature(int threshold) { 76 if (threshold < 0) 77 throw new WebServiceException("MTOMFeature.threshold must be >= 0, actual value: "+threshold); 78 this.enabled = true; 79 this.threshold = threshold; 80 } 81 82 91 public MTOMFeature(boolean enabled, int threshold) { 92 if (threshold < 0) 93 throw new WebServiceException("MTOMFeature.threshold must be >= 0, actual value: "+threshold); 94 this.enabled = enabled; 95 this.threshold = threshold; 96 } 97 98 101 public String getID() { 102 return ID; 103 } 104 105 111 public int getThreshold() { 112 return threshold; 113 } 114 } 115 | Popular Tags |