Package org.apache.synapse.config

Examples of org.apache.synapse.config.Entry


        String entrySrc = "<localEntry xmlns=\"http://ws.apache.org/ns/synapse\" " +
                "key=\"" + key + "\"><![CDATA[" + text + "]]></localEntry>";

        try {
            OMElement elem = parseXMLString(entrySrc, coalesced);
            Entry entry = EntryFactory.createEntry(elem, new Properties());
            assertEquals(key, entry.getKey());
            assertEquals(Entry.INLINE_TEXT, entry.getType());
            assertEquals(text, (String) entry.getValue());

            OMElement serialization = EntrySerializer.serializeEntry(entry, null);
            OMElement expectedSerialization = parseXMLString(entrySrc, false);
            assertTrue(compare(expectedSerialization, serialization));
        } catch (XMLStreamException e) {
View Full Code Here


        String entrySrc = "<localEntry xmlns=\"http://ws.apache.org/ns/synapse\" " +
                "key=\"" + key + "\"><![CDATA[" + escapedText + "]]></localEntry>";

        try {
            OMElement elem = parseXMLString(entrySrc, coalesced);
            Entry entry = EntryFactory.createEntry(elem, new Properties());
            assertEquals(key, entry.getKey());
            assertEquals(Entry.INLINE_TEXT, entry.getType());
            assertEquals(actualText, (String) entry.getValue());

            OMElement expectedSerialization = parseXMLString(entrySrc, false);
            OMElement serialization = EntrySerializer.serializeEntry(entry, null);
            assertTrue(compare(expectedSerialization, serialization));
View Full Code Here

        String serializedSrc = "<localEntry xmlns=\"http://ws.apache.org/ns/synapse\" " +
                "key=\"" + key + "\"><![CDATA[" + text + "]]></localEntry>";

        try {
            OMElement elem = parseXMLString(entrySrc, true);
            Entry entry = EntryFactory.createEntry(elem, new Properties());
            assertEquals(key, entry.getKey());
            assertEquals(Entry.INLINE_TEXT, entry.getType());
            assertEquals(text, (String) entry.getValue());

            OMElement serialization = EntrySerializer.serializeEntry(entry, null);
            OMElement expectedSerialization = parseXMLString(serializedSrc, false);
            assertEquals(text, serialization.getText());
            serialization = parseXMLString(serialization.toString(), false);
View Full Code Here

        String entrySrc = "<localEntry xmlns=\"http://ws.apache.org/ns/synapse\" " +
                "key=\"" + key + "\"><![CDATA[" + text + "]]></localEntry>";

        try {
            OMElement elem = parseXMLString(entrySrc, coalesced);
            Entry entry = EntryFactory.createEntry(elem, new Properties());
            assertEquals(key, entry.getKey());
            assertEquals(Entry.INLINE_TEXT, entry.getType());
            assertEquals(text, (String) entry.getValue());

            OMElement serialization = EntrySerializer.serializeEntry(entry, null);
            assertEquals(text, serialization.getText());

            OMElement expectedSerialization = parseXMLString(entrySrc, false);
View Full Code Here

                "key=\"" + key + "\">" + xml + "</localEntry>";

        try {
            OMElement elem = parseXMLString(entrySrc, true);
            OMElement expectedSerialization = elem.cloneOMElement();
            Entry entry = EntryFactory.createEntry(elem, new Properties());
            assertEquals(key, entry.getKey());
            assertEquals(Entry.INLINE_XML, entry.getType());

            OMElement valueElem = parseXMLString(xml, true);
            assertTrue(compare(valueElem, (OMElement) entry.getValue()));

            OMElement serialization = EntrySerializer.serializeEntry(entry, null);
            assertTrue(compare(expectedSerialization, serialization));
        } catch (XMLStreamException e) {
            fail("Error while parsing entry definition: " + e.getMessage());
View Full Code Here

                "key=\"" + key + "\">" + xml + "</localEntry>";

        try {
            OMElement elem = parseXMLString(entrySrc, coalesced);
            OMElement expectedSerialization = elem.cloneOMElement();
            Entry entry = EntryFactory.createEntry(elem, new Properties());
            assertEquals(key, entry.getKey());
            assertEquals(Entry.INLINE_XML, entry.getType());

            OMElement valueElem = parseXMLString(xml, coalesced);
            assertTrue(compare(valueElem, (OMElement) entry.getValue()));

            OMElement serialization = EntrySerializer.serializeEntry(entry, null);
            assertTrue(compare(expectedSerialization, serialization));
        } catch (XMLStreamException e) {
            fail("Error while parsing entry definition: " + e.getMessage());
View Full Code Here

                "key=\"" + key + "\">" + xml + "</localEntry>";

        try {
            OMElement elem = parseXMLString(entrySrc, true);
            OMElement expectedSerialization = elem.cloneOMElement();
            Entry entry = EntryFactory.createEntry(elem, new Properties());
            assertEquals(key, entry.getKey());
            assertEquals(Entry.INLINE_XML, entry.getType());

            OMElement valueElem = parseXMLString(xml, true);
            assertTrue(compare(valueElem, (OMElement) entry.getValue()));

            OMElement serialization = EntrySerializer.serializeEntry(entry, null);
            assertTrue(compare(expectedSerialization, serialization));
        } catch (XMLStreamException e) {
            fail("Error while parsing entry definition: " + e.getMessage());
View Full Code Here

            Iterator entryDefinitions = FileUtils.iterateFiles(localEntriesDir, extensions, false);
            while (entryDefinitions.hasNext()) {
                File file = (File) entryDefinitions.next();
                OMElement document = getOMElement(file);
                Entry entry = SynapseXMLConfigurationFactory.defineEntry(synapseConfig, document,
                        properties);
                if (entry != null) {
                    entry.setFileName(file.getName());
                    synapseConfig.getArtifactDeploymentStore().addArtifact(file.getAbsolutePath(),
                            entry.getKey());
                }
             }
        }
    }
View Full Code Here

                return new ReturnValue(result);

            //Then, it must be a entry key
            //reload the XML document from the registry
            boolean reLoad = false;
            Entry dp = synCtx.getConfiguration().getEntryDefinition(key);
            // if the key refers to a dynamic resource
            if (dp != null && dp.isDynamic()) {
                if (!dp.isCached() || dp.isExpired()) {
                    reLoad = true;
                }
            }
            if (reLoad) {
                // it is need to synchronized this to avoid recreation of the cachedValue by
View Full Code Here

            } else {
                handleFault("Unable to access the registry instance for the ESB", null);
            }
            OMElement e = null;
            if (registry != null) {
                e = (OMElement) registry.getResource(new Entry(key), synConfig.getProperties());
            }
            if (e != null) {
                if (log.isDebugEnabled()) {
                    log.debug("Found dynamic endpoint " + key);
                }
View Full Code Here

TOP

Related Classes of org.apache.synapse.config.Entry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.