coherence-community / coherence-incubator

Coherence Incubator
38 stars 37 forks source link

processing:cluster-config configuration isn't properly processed from introduce-cache-config #143

Closed brianoliver closed 8 years ago

brianoliver commented 9 years ago

Externalizing the processing pattern configuration using an element:introduce-cache-config currently isn't working. The workaround is to embed the configuration for PP in the main cache-config file. We should be able to use the element:introduce-cache-config.

brianoliver commented 9 years ago

@janneman said: I believe the problem is with the ProcessingPatternNamespaceHandler, which results in an issue in the XmlPreprocessingNamespaceHandler code that performs: mergeForeignElement. The current ProcessingPatternNamespaceHandler does not implement the IntroduceCacheConfigSupport interface - and hence when the processing pattern configuration is externalized it won't be merged into the main config.

I verified that making the ProcessingPatternNamespaceHandler implement the aforementioned interface:

@Override
    public void mergeConfiguration(ProcessingContext context, String sFromURI, XmlElement xmlElement,
            XmlElement xmlIntoCacheConfig, QualifiedName qnOriginatedFrom) {

        // clone the element to merge
        XmlElement xmlMergeElement = (XmlElement) xmlElement.clone();

        // annotate the origin of the merging element
        xmlMergeElement.addAttribute(qnOriginatedFrom.getName()).setString(sFromURI);

        xmlIntoCacheConfig.getElementList().add(xmlMergeElement);
    }

Fixes the problem.

brianoliver commented 8 years ago

This issue was imported from JIRA COHINC-143

brianoliver commented 9 years ago

Reported by janneman

brianoliver commented 8 years ago

Marked as fixed by @brianoliver on Tuesday, December 8th 2015, 5:15:12 pm