Search in sources :

Example 6 with ReferenceResolver

use of org.apache.cxf.ws.policy.attachment.reference.ReferenceResolver in project cxf by apache.

the class Wsdl11AttachmentPolicyProvider method resolveLocal.

Policy resolveLocal(PolicyReference ref, DescriptionInfo di) {
    String uri = ref.getURI().substring(1);
    String absoluteURI = di.getBaseURI();
    if (absoluteURI == null) {
        absoluteURI = Integer.toString(di.hashCode()) + ref.getURI();
    } else {
        absoluteURI = absoluteURI + ref.getURI();
    }
    Policy resolved = registry.lookup(absoluteURI);
    if (null != resolved) {
        return resolved;
    }
    ReferenceResolver resolver = new LocalServiceModelReferenceResolver(di, builder);
    resolved = resolver.resolveReference(uri);
    if (null != resolved) {
        ref.setURI(absoluteURI);
        registry.register(absoluteURI, resolved);
    }
    return resolved;
}
Also used : Policy(org.apache.neethi.Policy) LocalServiceModelReferenceResolver(org.apache.cxf.ws.policy.attachment.reference.LocalServiceModelReferenceResolver) ReferenceResolver(org.apache.cxf.ws.policy.attachment.reference.ReferenceResolver) LocalServiceModelReferenceResolver(org.apache.cxf.ws.policy.attachment.reference.LocalServiceModelReferenceResolver)

Aggregations

ReferenceResolver (org.apache.cxf.ws.policy.attachment.reference.ReferenceResolver)6 Policy (org.apache.neethi.Policy)6 RemoteReferenceResolver (org.apache.cxf.ws.policy.attachment.reference.RemoteReferenceResolver)4 PolicyRegistry (org.apache.neethi.PolicyRegistry)3 ConfiguredBeanLocator (org.apache.cxf.configuration.ConfiguredBeanLocator)1 EffectivePolicy (org.apache.cxf.ws.policy.EffectivePolicy)1 PolicyBuilder (org.apache.cxf.ws.policy.PolicyBuilder)1 PolicyEngine (org.apache.cxf.ws.policy.PolicyEngine)1 LocalDocumentReferenceResolver (org.apache.cxf.ws.policy.attachment.reference.LocalDocumentReferenceResolver)1 LocalServiceModelReferenceResolver (org.apache.cxf.ws.policy.attachment.reference.LocalServiceModelReferenceResolver)1