Search in sources :

Example 1 with LocalDocumentReferenceResolver

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

the class ExternalAttachmentProvider method resolveLocal.

Policy resolveLocal(PolicyReference ref, Document doc) {
    String relativeURI = ref.getURI().substring(1);
    String absoluteURI = doc.getBaseURI() + ref.getURI();
    Policy resolved = registry.lookup(absoluteURI);
    if (null != resolved) {
        return resolved;
    }
    ReferenceResolver resolver = new LocalDocumentReferenceResolver(doc, builder);
    resolved = resolver.resolveReference(relativeURI);
    if (null != resolved) {
        ref.setURI(absoluteURI);
        registry.register(absoluteURI, resolved);
    }
    return resolved;
}
Also used : Policy(org.apache.neethi.Policy) LocalDocumentReferenceResolver(org.apache.cxf.ws.policy.attachment.reference.LocalDocumentReferenceResolver) ReferenceResolver(org.apache.cxf.ws.policy.attachment.reference.ReferenceResolver) LocalDocumentReferenceResolver(org.apache.cxf.ws.policy.attachment.reference.LocalDocumentReferenceResolver)

Aggregations

LocalDocumentReferenceResolver (org.apache.cxf.ws.policy.attachment.reference.LocalDocumentReferenceResolver)1 ReferenceResolver (org.apache.cxf.ws.policy.attachment.reference.ReferenceResolver)1 Policy (org.apache.neethi.Policy)1