本文整理汇总了Java中com.sun.xml.internal.ws.api.fastinfoset.FastInfosetFeature类的典型用法代码示例。如果您正苦于以下问题:Java FastInfosetFeature类的具体用法?Java FastInfosetFeature怎么用?Java FastInfosetFeature使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FastInfosetFeature类属于com.sun.xml.internal.ws.api.fastinfoset包,在下文中一共展示了FastInfosetFeature类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getFeatures
import com.sun.xml.internal.ws.api.fastinfoset.FastInfosetFeature; //导入依赖的package包/类
/**
* Process FastInfoset policy assertions.
*
* @param key Key to identify the endpoint scope.
* @param policyMap the policy map.
* @throws PolicyException If retrieving the policy triggered an exception.
*/
public Collection<WebServiceFeature> getFeatures(final PolicyMapKey key, final PolicyMap policyMap) throws PolicyException {
final Collection<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
if ((key != null) && (policyMap != null)) {
Policy policy = policyMap.getEndpointEffectivePolicy(key);
if (null!=policy && policy.contains(OPTIMIZED_FI_SERIALIZATION_ASSERTION)) {
Iterator <AssertionSet> assertions = policy.iterator();
while(assertions.hasNext()){
AssertionSet assertionSet = assertions.next();
Iterator<PolicyAssertion> policyAssertion = assertionSet.iterator();
while(policyAssertion.hasNext()){
PolicyAssertion assertion = policyAssertion.next();
if(OPTIMIZED_FI_SERIALIZATION_ASSERTION.equals(assertion.getName())){
String value = assertion.getAttributeValue(enabled);
boolean isFastInfosetEnabled = Boolean.valueOf(value.trim());
features.add(new FastInfosetFeature(isFastInfosetEnabled));
} // end-if non optional fast infoset assertion found
} // next assertion
} // next alternative
} // end-if policy contains fast infoset assertion
}
return features;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:FastInfosetFeatureConfigurator.java
示例2: SOAPBindingCodec
import com.sun.xml.internal.ws.api.fastinfoset.FastInfosetFeature; //导入依赖的package包/类
public SOAPBindingCodec(WSFeatureList features, StreamSOAPCodec xmlSoapCodec) {
super(getSoapVersion(features), features);
this.xmlSoapCodec = xmlSoapCodec;
xmlMimeType = xmlSoapCodec.getMimeType();
xmlMtomCodec = new MtomCodec(version, xmlSoapCodec, features);
xmlSwaCodec = new SwACodec(version, features, xmlSoapCodec);
String clientAcceptedContentTypes = xmlSoapCodec.getMimeType() + ", " +
xmlMtomCodec.getMimeType();
WebServiceFeature fi = features.get(FastInfosetFeature.class);
isFastInfosetDisabled = (fi != null && !fi.isEnabled());
if (!isFastInfosetDisabled) {
fiSoapCodec = getFICodec(xmlSoapCodec, version);
if (fiSoapCodec != null) {
fiMimeType = fiSoapCodec.getMimeType();
fiSwaCodec = new SwACodec(version, features, fiSoapCodec);
connegXmlAccept = fiMimeType + ", " + clientAcceptedContentTypes;
/**
* This feature will only be present on the client side.
*
* Fast Infoset is enabled on the client if the service
* explicitly supports Fast Infoset.
*/
WebServiceFeature select = features.get(SelectOptimalEncodingFeature.class);
if (select != null) { // if the client FI feature is set - ignore negotiation property
ignoreContentNegotiationProperty = true;
if (select.isEnabled()) {
// If the client's FI encoding feature is enabled, and server's is not disabled
if (fi != null) { // if server's FI feature also enabled
useFastInfosetForEncoding = true;
}
clientAcceptedContentTypes = connegXmlAccept;
} else { // If client FI feature is disabled
isFastInfosetDisabled = true;
}
}
} else {
// Fast Infoset could not be loaded by the runtime
isFastInfosetDisabled = true;
fiSwaCodec = null;
fiMimeType = "";
connegXmlAccept = clientAcceptedContentTypes;
ignoreContentNegotiationProperty = true;
}
} else {
// Fast Infoset is explicitly not supported by the service
fiSoapCodec = fiSwaCodec = null;
fiMimeType = "";
connegXmlAccept = clientAcceptedContentTypes;
ignoreContentNegotiationProperty = true;
}
xmlAccept = clientAcceptedContentTypes;
if(getSoapVersion(features) == null)
throw new WebServiceException("Expecting a SOAP binding but found ");
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:64,代码来源:SOAPBindingCodec.java
示例3: SOAPBindingCodec
import com.sun.xml.internal.ws.api.fastinfoset.FastInfosetFeature; //导入依赖的package包/类
public SOAPBindingCodec(WSBinding binding, StreamSOAPCodec xmlSoapCodec) {
super(binding.getSOAPVersion(), binding);
this.xmlSoapCodec = xmlSoapCodec;
xmlMimeType = xmlSoapCodec.getMimeType();
xmlMtomCodec = new MtomCodec(version, xmlSoapCodec, binding, binding.getFeature(MTOMFeature.class));
xmlSwaCodec = new SwACodec(version, binding, xmlSoapCodec);
String clientAcceptedContentTypes = xmlSoapCodec.getMimeType() + ", " +
xmlMtomCodec.getMimeType();
WebServiceFeature fi = binding.getFeature(FastInfosetFeature.class);
isFastInfosetDisabled = (fi != null && !fi.isEnabled());
if (!isFastInfosetDisabled) {
fiSoapCodec = getFICodec(xmlSoapCodec, version);
if (fiSoapCodec != null) {
fiMimeType = fiSoapCodec.getMimeType();
fiSwaCodec = new SwACodec(version, binding, fiSoapCodec);
connegXmlAccept = fiMimeType + ", " + clientAcceptedContentTypes;
/**
* This feature will only be present on the client side.
*
* Fast Infoset is enabled on the client if the service
* explicitly supports Fast Infoset.
*/
WebServiceFeature select = binding.getFeature(SelectOptimalEncodingFeature.class);
if (select != null) { // if the client FI feature is set - ignore negotiation property
ignoreContentNegotiationProperty = true;
if (select.isEnabled()) {
// If the client's FI encoding feature is enabled, and server's is not disabled
if (fi != null) { // if server's FI feature also enabled
useFastInfosetForEncoding = true;
}
clientAcceptedContentTypes = connegXmlAccept;
} else { // If client FI feature is disabled
isFastInfosetDisabled = true;
}
}
} else {
// Fast Infoset could not be loaded by the runtime
isFastInfosetDisabled = true;
fiSwaCodec = null;
fiMimeType = "";
connegXmlAccept = clientAcceptedContentTypes;
ignoreContentNegotiationProperty = true;
}
} else {
// Fast Infoset is explicitly not supported by the service
fiSoapCodec = fiSwaCodec = null;
fiMimeType = "";
connegXmlAccept = clientAcceptedContentTypes;
ignoreContentNegotiationProperty = true;
}
xmlAccept = clientAcceptedContentTypes;
if(!(binding instanceof SOAPBindingImpl))
throw new WebServiceException("Expecting a SOAP binding but found "+binding);
this.binding = (SOAPBindingImpl)binding;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:65,代码来源:SOAPBindingCodec.java
注:本文中的com.sun.xml.internal.ws.api.fastinfoset.FastInfosetFeature类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论