本文整理汇总了Java中com.sun.xml.internal.ws.api.policy.PolicyResolver类的典型用法代码示例。如果您正苦于以下问题:Java PolicyResolver类的具体用法?Java PolicyResolver怎么用?Java PolicyResolver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PolicyResolver类属于com.sun.xml.internal.ws.api.policy包,在下文中一共展示了PolicyResolver类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: RuntimeWSDLParser
import com.sun.xml.internal.ws.api.policy.PolicyResolver; //导入依赖的package包/类
private RuntimeWSDLParser(@NotNull String sourceLocation, XMLEntityResolver resolver, boolean isClientSide, Container container, PolicyResolver policyResolver, WSDLParserExtension... extensions) {
this.wsdlDoc = sourceLocation!=null ? new WSDLModelImpl(sourceLocation) : new WSDLModelImpl();
this.resolver = resolver;
this.policyResolver = policyResolver;
this.extensions = new ArrayList<WSDLParserExtension>();
this.context = new WSDLParserExtensionContextImpl(wsdlDoc, isClientSide, container, policyResolver);
boolean isPolicyExtensionFound = false;
for (WSDLParserExtension e : extensions) {
if (e instanceof com.sun.xml.internal.ws.api.wsdl.parser.PolicyWSDLParserExtension)
isPolicyExtensionFound = true;
register(e);
}
// register handlers for default extensions
if (!isPolicyExtensionFound)
register(new PolicyWSDLParserExtension());
register(new MemberSubmissionAddressingWSDLParserExtension());
register(new W3CAddressingWSDLParserExtension());
register(new W3CAddressingMetadataWSDLParserExtension());
this.extensionFacade = new WSDLParserExtensionFacade(this.extensions.toArray(new WSDLParserExtension[0]));
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:RuntimeWSDLParser.java
示例2: RuntimeWSDLParser
import com.sun.xml.internal.ws.api.policy.PolicyResolver; //导入依赖的package包/类
private RuntimeWSDLParser(@NotNull String sourceLocation, XMLEntityResolver resolver, boolean isClientSide, Container container, PolicyResolver policyResolver, WSDLParserExtension... extensions) {
this.wsdlDoc = sourceLocation!=null ? new WSDLModelImpl(sourceLocation) : new WSDLModelImpl();
this.resolver = resolver;
this.policyResolver = policyResolver;
this.extensions = new ArrayList<WSDLParserExtension>();
this.context = new WSDLParserExtensionContextImpl(wsdlDoc, isClientSide, container, policyResolver);
// register handlers for default extensions
register(new PolicyWSDLParserExtension());
register(new MemberSubmissionAddressingWSDLParserExtension());
register(new W3CAddressingWSDLParserExtension());
register(new W3CAddressingMetadataWSDLParserExtension());
for (WSDLParserExtension e : extensions)
register(e);
this.extensionFacade = new WSDLParserExtensionFacade(this.extensions.toArray(new WSDLParserExtension[0]));
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:18,代码来源:RuntimeWSDLParser.java
示例3: start
import com.sun.xml.internal.ws.api.policy.PolicyResolver; //导入依赖的package包/类
@Override
public void start(final WSDLGenExtnContext context) {
LOGGER.entering();
try {
this.seiModel = context.getModel();
final PolicyMapConfigurator[] policyMapConfigurators = loadConfigurators();
final PolicyMapExtender[] extenders = new PolicyMapExtender[policyMapConfigurators.length];
for (int i = 0; i < policyMapConfigurators.length; i++) {
extenders[i] = PolicyMapExtender.createPolicyMapExtender();
}
// Read policy config file
policyMap = PolicyResolverFactory.create().resolve(
new PolicyResolver.ServerContext(policyMap, context.getContainer(), context.getEndpointClass(), false, extenders));
if (policyMap == null) {
LOGGER.fine(PolicyMessages.WSP_1019_CREATE_EMPTY_POLICY_MAP());
policyMap = PolicyMap.createPolicyMap(Arrays.asList(extenders));
}
final WSBinding binding = context.getBinding();
try {
final Collection<PolicySubject> policySubjects = new LinkedList<PolicySubject>();
for (int i = 0; i < policyMapConfigurators.length; i++) {
policySubjects.addAll(policyMapConfigurators[i].update(policyMap, seiModel, binding));
extenders[i].disconnect();
}
PolicyMapUtil.insertPolicies(policyMap, policySubjects, this.seiModel.getServiceQName(), this.seiModel.getPortName());
} catch (PolicyException e) {
throw LOGGER.logSevereException(new WebServiceException(PolicyMessages.WSP_1017_MAP_UPDATE_FAILED(), e));
}
final TypedXmlWriter root = context.getRoot();
root._namespace(NamespaceVersion.v1_2.toString(), NamespaceVersion.v1_2.getDefaultNamespacePrefix());
root._namespace(NamespaceVersion.v1_5.toString(), NamespaceVersion.v1_5.getDefaultNamespacePrefix());
root._namespace(PolicyConstants.WSU_NAMESPACE_URI, PolicyConstants.WSU_NAMESPACE_PREFIX);
} finally {
LOGGER.exiting();
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:41,代码来源:PolicyWSDLGeneratorExtension.java
示例4: createPolicyMap
import com.sun.xml.internal.ws.api.policy.PolicyResolver; //导入依赖的package包/类
public PolicyMap createPolicyMap() {
PolicyMap map;
if(portModel != null) {
map = portModel.getOwner().getParent().getPolicyMap();
} else {
map = PolicyResolverFactory.create().resolve(new PolicyResolver.ClientContext(null,owner.getContainer()));
}
//still map is null, create a empty map
if(map == null)
map = PolicyMap.createPolicyMap(null);
return map;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:PortInfo.java
示例5: WSDLParserExtensionContextImpl
import com.sun.xml.internal.ws.api.policy.PolicyResolver; //导入依赖的package包/类
/**
* Construct {@link WSDLParserExtensionContextImpl} with information that whether its on client side
* or server side.
*/
protected WSDLParserExtensionContextImpl(EditableWSDLModel model, boolean isClientSide, Container container, PolicyResolver policyResolver) {
this.wsdlModel = model;
this.isClientSide = isClientSide;
this.container = container;
this.policyResolver = policyResolver;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:WSDLParserExtensionContextImpl.java
示例6: parse
import com.sun.xml.internal.ws.api.policy.PolicyResolver; //导入依赖的package包/类
/**
* Parses the WSDL and gives WSDLModel. If wsdl parameter is null, then wsdlLoc is used to get the WSDL. If the WSDL
* document could not be obtained then {@link MetadataResolverFactory} is tried to get the WSDL document, if not found
* then as last option, if the wsdlLoc has no '?wsdl' as query parameter then it is tried by appending '?wsdl'.
*
* @param wsdlLoc
* Either this or <tt>wsdl</tt> parameter must be given.
* Null location means the system won't be able to resolve relative references in the WSDL,
*/
public static WSDLModel parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver,
boolean isClientSide, Container container, Class serviceClass,
@NotNull PolicyResolver policyResolver,
boolean isUseStreamFromEntityResolverWrapper,
WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
assert resolver != null;
RuntimeWSDLParser wsdlParser = new RuntimeWSDLParser(wsdlSource.getSystemId(), new EntityResolverWrapper(resolver, isUseStreamFromEntityResolverWrapper), isClientSide, container, policyResolver, extensions);
Parser parser;
try{
parser = wsdlParser.resolveWSDL(wsdlLoc, wsdlSource, serviceClass);
if(!hasWSDLDefinitions(parser.parser)){
throw new XMLStreamException(ClientMessages.RUNTIME_WSDLPARSER_INVALID_WSDL(parser.systemId,
WSDLConstants.QNAME_DEFINITIONS, parser.parser.getName(), parser.parser.getLocation()));
}
}catch(XMLStreamException e){
//Try MEX if there is WSDLLoc available
if(wsdlLoc == null)
throw e;
return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, container, e, serviceClass, policyResolver, extensions);
}catch(IOException e){
//Try MEX if there is WSDLLoc available
if(wsdlLoc == null)
throw e;
return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, container, e, serviceClass, policyResolver, extensions);
}
wsdlParser.extensionFacade.start(wsdlParser.context);
wsdlParser.parseWSDL(parser, false);
wsdlParser.wsdlDoc.freeze();
wsdlParser.extensionFacade.finished(wsdlParser.context);
wsdlParser.extensionFacade.postFinished(wsdlParser.context);
if(wsdlParser.wsdlDoc.getServices().isEmpty())
throw new WebServiceException(ClientMessages.WSDL_CONTAINS_NO_SERVICE(wsdlLoc));
return wsdlParser.wsdlDoc;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:48,代码来源:RuntimeWSDLParser.java
示例7: parse
import com.sun.xml.internal.ws.api.policy.PolicyResolver; //导入依赖的package包/类
/**
* Parses the WSDL and gives WSDLModel. If wsdl parameter is null, then wsdlLoc is used to get the WSDL. If the WSDL
* document could not be obtained then {@link MetadataResolverFactory} is tried to get the WSDL document, if not found
* then as last option, if the wsdlLoc has no '?wsdl' as query parameter then it is tried by appending '?wsdl'.
*
* @param wsdlLoc
* Either this or {@code wsdl} parameter must be given.
* Null location means the system won't be able to resolve relative references in the WSDL,
*/
public static WSDLModel parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver,
boolean isClientSide, Container container, Class serviceClass,
@NotNull PolicyResolver policyResolver,
boolean isUseStreamFromEntityResolverWrapper,
WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
assert resolver != null;
RuntimeWSDLParser wsdlParser = new RuntimeWSDLParser(wsdlSource.getSystemId(), new EntityResolverWrapper(resolver, isUseStreamFromEntityResolverWrapper), isClientSide, container, policyResolver, extensions);
Parser parser;
try{
parser = wsdlParser.resolveWSDL(wsdlLoc, wsdlSource, serviceClass);
if(!hasWSDLDefinitions(parser.parser)){
throw new XMLStreamException(ClientMessages.RUNTIME_WSDLPARSER_INVALID_WSDL(parser.systemId,
WSDLConstants.QNAME_DEFINITIONS, parser.parser.getName(), parser.parser.getLocation()));
}
}catch(XMLStreamException e){
//Try MEX if there is WSDLLoc available
if(wsdlLoc == null)
throw e;
return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, container, e, serviceClass, policyResolver, extensions);
}catch(IOException e){
//Try MEX if there is WSDLLoc available
if(wsdlLoc == null)
throw e;
return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, container, e, serviceClass, policyResolver, extensions);
}
wsdlParser.extensionFacade.start(wsdlParser.context);
wsdlParser.parseWSDL(parser, false);
wsdlParser.wsdlDoc.freeze();
wsdlParser.extensionFacade.finished(wsdlParser.context);
wsdlParser.extensionFacade.postFinished(wsdlParser.context);
if(wsdlParser.wsdlDoc.getServices().isEmpty())
throw new WebServiceException(ClientMessages.WSDL_CONTAINS_NO_SERVICE(wsdlLoc));
return wsdlParser.wsdlDoc;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:48,代码来源:RuntimeWSDLParser.java
示例8: createPolicyMap
import com.sun.xml.internal.ws.api.policy.PolicyResolver; //导入依赖的package包/类
public PolicyMap createPolicyMap() {
PolicyMap map;
if(portModel != null) {
map = ((WSDLModelImpl) portModel.getOwner().getParent()).getPolicyMap();
} else {
map = PolicyResolverFactory.create().resolve(new PolicyResolver.ClientContext(null,owner.getContainer()));
}
//still map is null, create a empty map
if(map == null)
map = PolicyMap.createPolicyMap(null);
return map;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:13,代码来源:PortInfo.java
示例9: WSDLParserExtensionContextImpl
import com.sun.xml.internal.ws.api.policy.PolicyResolver; //导入依赖的package包/类
/**
* Construct {@link WSDLParserExtensionContextImpl} with information that whether its on client side
* or server side.
*/
protected WSDLParserExtensionContextImpl(WSDLModel model, boolean isClientSide, Container container, PolicyResolver policyResolver) {
this.wsdlModel = model;
this.isClientSide = isClientSide;
this.container = container;
this.policyResolver = policyResolver;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:11,代码来源:WSDLParserExtensionContextImpl.java
注:本文中的com.sun.xml.internal.ws.api.policy.PolicyResolver类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论