Package org.apache.synapse.config

Examples of org.apache.synapse.config.Entry


            return true;
        } else {
            //Load the XML document from the registry
            boolean reLoad = false;
            boolean hasValueChanged = false;
            Entry dp = synCtx.getConfiguration().getEntryDefinition(this.regKey);
            // if the key refers to a dynamic resource
            if (dp != null && dp.isDynamic()) {
                if (!dp.isCached() || dp.isExpired()) {
                    reLoad = true;
                }
            }
            synchronized (resourceLock) {
                if (reLoad || this.value == null) {
View Full Code Here


            boolean reCreate = false; // It is not need to recreate ,if property is not dyanamic
            OMElement policyOmElement = null;

            if (policyKey != null) {
                Entry entry = synContext.getConfiguration().getEntryDefinition(policyKey);
                if (entry == null) {
                    return;
                }
                Object entryValue = entry.getValue();

                if (!(entryValue instanceof OMElement)) {
                    return;
                }
                // if entry is dynamic, need to check wheather updated or not
                if ((!entry.isCached() || entry.isExpired())) {
                    reCreate = true;
                }
                policyOmElement = (OMElement) entryValue;
            } else if (inLinePolicy != null) {
                policyOmElement = inLinePolicy;
View Full Code Here

            if (synLog.isTraceTraceEnabled()) {
                synLog.traceTrace("Message : " + synCtx.getEnvelope());
            }
        }

        Entry entry = synCtx.getConfiguration().getEntryDefinition(configKey);

        // if the configKey refers to a dynamic property
        if (entry != null && entry.isDynamic()) {
            if (!entry.isCached() || entry.isExpired()) {
                buildAppContext(synCtx, synLog);
            }
        // if the property is not a DynamicProperty, we will create an ApplicationContext only once
        } else {
            if (appContext == null) {
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);
            assertTrue(compare(expectedSerialization, serialization));
        } catch (XMLStreamException e) {
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);
            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

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.