当前位置: 首页>>代码示例>>Java>>正文


Java PolicySourceModel类代码示例

本文整理汇总了Java中com.sun.xml.internal.ws.policy.sourcemodel.PolicySourceModel的典型用法代码示例。如果您正苦于以下问题:Java PolicySourceModel类的具体用法?Java PolicySourceModel怎么用?Java PolicySourceModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PolicySourceModel类属于com.sun.xml.internal.ws.policy.sourcemodel包,在下文中一共展示了PolicySourceModel类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPolicies

import com.sun.xml.internal.ws.policy.sourcemodel.PolicySourceModel; //导入依赖的package包/类
final Collection<Policy> getPolicies() throws PolicyException {
    if (null == policyURIs) {
        throw LOGGER.logSevereException(new PolicyException(PolicyMessages.WSP_1004_POLICY_URIS_CAN_NOT_BE_NULL()));
    }
    if (null == policyStore) {
        throw LOGGER.logSevereException(new PolicyException(PolicyMessages.WSP_1010_NO_POLICIES_DEFINED()));
    }

    final Collection<Policy> result = new ArrayList<Policy>(policyURIs.size());

    for (String policyURI : policyURIs) {
        final PolicySourceModel sourceModel = policyStore.get(policyURI);
        if (sourceModel == null) {
            throw LOGGER.logSevereException(new PolicyException(PolicyMessages.WSP_1005_POLICY_REFERENCE_DOES_NOT_EXIST(policyURI)));
        } else {
            result.add(ModelTranslator.getTranslator().translate(sourceModel));
        }
    }

    return result;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:BuilderHandler.java

示例2: writePolicyOrReferenceIt

import com.sun.xml.internal.ws.policy.sourcemodel.PolicySourceModel; //导入依赖的package包/类
/**
 * Adds a PolicyReference element that points to the policy of the element,
 * if the policy does not have any id or name. Writes policy inside the element otherwise.
 *
 * @param subject
 *      PolicySubject to be referenced or marshalled
 * @param writer
 *      A TXW on to which we shall add the PolicyReference
 */
private void writePolicyOrReferenceIt(final PolicySubject subject, final TypedXmlWriter writer) {
    final Policy policy;
    try {
        policy = subject.getEffectivePolicy(merger);
    } catch (PolicyException e) {
        throw LOGGER.logSevereException(new WebServiceException(PolicyMessages.WSP_1011_FAILED_TO_RETRIEVE_EFFECTIVE_POLICY_FOR_SUBJECT(subject.toString()), e));
    }
    if (policy != null) {
        if (null == policy.getIdOrName()) {
            final PolicyModelGenerator generator = ModelGenerator.getGenerator();
            try {
                final PolicySourceModel policyInfoset = generator.translate(policy);
                marshaller.marshal(policyInfoset, writer);
            } catch (PolicyException pe) {
                throw LOGGER.logSevereException(new WebServiceException(PolicyMessages.WSP_1002_UNABLE_TO_MARSHALL_POLICY_OR_POLICY_REFERENCE(), pe));
            }
        } else {
            final TypedXmlWriter policyReference = writer._element(policy.getNamespaceVersion().asQName(XmlToken.PolicyReference), TypedXmlWriter.class);
            policyReference._attribute(XmlToken.Uri.toString(), '#' + policy.getIdOrName());
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:PolicyWSDLGeneratorExtension.java

示例3: getPolicyURIs

import com.sun.xml.internal.ws.policy.sourcemodel.PolicySourceModel; //导入依赖的package包/类
private Collection<String> getPolicyURIs(
        final Collection<PolicyRecordHandler> handlers, final PolicySourceModelContext modelContext) throws PolicyException{
    final Collection<String> result = new ArrayList<String>(handlers.size());
    String policyUri;
    for (PolicyRecordHandler handler : handlers) {
        policyUri = handler.handler;
        if (HandlerType.AnonymousPolicyId == handler.type) {
            final PolicySourceModel policyModel = getAnonymousPolicyModels().get(policyUri);
            policyModel.expand(modelContext);
            while (getPolicyModels().containsKey(policyUri)) {
                policyUri = AnonymnousPolicyIdPrefix.append(anonymousPoliciesCount++).toString();
            }
            getPolicyModels().put(policyUri,policyModel);
        }
        result.add(policyUri);
    }
    return result;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:PolicyWSDLParserExtension.java

示例4: readPolicy

import com.sun.xml.internal.ws.policy.sourcemodel.PolicySourceModel; //导入依赖的package包/类
private void readPolicy(final XMLEventReader reader) throws PolicyException {
    final PolicySourceModel policyModel = POLICY_UNMARSHALLER.unmarshalModel(reader);
    final PolicyModelTranslator translator = PolicyModelTranslator.getTranslator();
    final Policy policy = translator.translate(policyModel);
    if (this.currentUri != null) {
        map.put(this.currentUri, policy);
        this.currentUri = null;
        this.currentPolicy = null;
    }
    else {
        this.currentPolicy = policy;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:ExternalAttachmentsUnmarshaller.java

示例5: BuilderHandlerEndpointScope

import com.sun.xml.internal.ws.policy.sourcemodel.PolicySourceModel; //导入依赖的package包/类
/** Creates a new instance of WSDLServiceScopeBuilderHandler */
BuilderHandlerEndpointScope(Collection<String> policyURIs, Map<String,PolicySourceModel> policyStore, Object policySubject, QName service, QName port) {

    super(policyURIs, policyStore, policySubject);
    this.service = service;
    this.port = port;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:BuilderHandlerEndpointScope.java

示例6: BuilderHandlerServiceScope

import com.sun.xml.internal.ws.policy.sourcemodel.PolicySourceModel; //导入依赖的package包/类
/**
 * Creates a new instance of BuilderHandlerServiceScope
 */
BuilderHandlerServiceScope(
        Collection<String> policyURIs, Map<String,PolicySourceModel> policyStore, Object policySubject, QName service) {

    super(policyURIs, policyStore, policySubject);
    this.service = service;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:BuilderHandlerServiceScope.java

示例7: BuilderHandlerMessageScope

import com.sun.xml.internal.ws.policy.sourcemodel.PolicySourceModel; //导入依赖的package包/类
/** Creates a new instance of WSDLServiceScopeBuilderHandler */
BuilderHandlerMessageScope(
        Collection<String> policyURIs
        , Map<String,PolicySourceModel> policyStore
        , Object policySubject
        , Scope scope
        , QName service, QName port, QName operation, QName message) {

    super(policyURIs, policyStore, policySubject);
    this.service = service;
    this.port = port;
    this.operation = operation;
    this.scope = scope;
    this.message = message;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:BuilderHandlerMessageScope.java

示例8: BuilderHandlerOperationScope

import com.sun.xml.internal.ws.policy.sourcemodel.PolicySourceModel; //导入依赖的package包/类
/** Creates a new instance of WSDLServiceScopeBuilderHandler */
BuilderHandlerOperationScope(
        Collection<String> policyURIs
        , Map<String,PolicySourceModel> policyStore
        , Object policySubject
        , QName service, QName port, QName operation) {

    super(policyURIs, policyStore, policySubject);
    this.service = service;
    this.port = port;
    this.operation = operation;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:BuilderHandlerOperationScope.java


注:本文中的com.sun.xml.internal.ws.policy.sourcemodel.PolicySourceModel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。