Package org.apache.camel

Examples of org.apache.camel.ComponentConfiguration


        if (completionText == null) {
            completionText = "";
        }
        Component component = context.getComponent(componentName, false);
        if (component != null) {
            ComponentConfiguration configuration = component.createComponentConfiguration();
            configuration.setParameters(endpointParameters);
            return configuration.completeEndpointPath(completionText);
        } else {
            return new ArrayList<String>();
        }
    }
View Full Code Here


        String json = context.getComponentParameterJsonSchema(componentName);
        if (json == null) {
            // okay this requires having the component on the classpath and being instantiated
            Component component = context.getComponent(componentName);
            if (component != null) {
                ComponentConfiguration configuration = component.createComponentConfiguration();
                json = configuration.createParameterJsonSchema();
            }
        }
        return json;
    }
View Full Code Here

        TestComponent comp = context.getComponent("test", TestComponent.class);
        EndpointConfiguration conf = comp.createConfiguration("test:my:foo?timeout=1000");

        assertEquals("1000", conf.getParameter("timeout"));

        ComponentConfiguration compConf = comp.createComponentConfiguration();
        String json = compConf.createParameterJsonSchema();
        assertNotNull(json);

        assertTrue(json.contains("\"retainFirst\": { \"type\": \"integer\""));
        assertTrue(json.contains("\"timeout\": { \"type\": \"integer\""));
    }
View Full Code Here

        XsltComponent comp = context.getComponent("xslt", XsltComponent.class);
        EndpointConfiguration conf = comp.createConfiguration("xslt:foo?deleteOutputFile=true");

        assertEquals("true", conf.getParameter("deleteOutputFile"));

        ComponentConfiguration compConf = comp.createComponentConfiguration();
        String json = compConf.createParameterJsonSchema();
        assertNotNull(json);

        assertTrue(json.contains("\"resourceUri\": { \"type\": \"string\""));
        assertTrue(json.contains("\"synchronous\": { \"type\": \"boolean\""));
    }
View Full Code Here

                + "?usePersist=true&persistenceUnit=custom");

        assertEquals("true", conf.getParameter("usePersist"));
        assertEquals("custom", conf.getParameter("persistenceUnit"));

        ComponentConfiguration compConf = comp.createComponentConfiguration();
        String json = compConf.createParameterJsonSchema();
        assertNotNull(json);

        assertTrue(json.contains("\"persistenceUnit\": { \"type\": \"string\""));
        assertTrue(json.contains("\"usePassedInEntityManager\": { \"type\": \"boolean\""));
    }
View Full Code Here

        EndpointConfiguration conf = comp.createConfiguration("smtp://james@myhost?password=secret&connectionTimeout=2500");

        assertEquals("secret", conf.getParameter("password"));
        assertEquals("2500", conf.getParameter("connectionTimeout"));

        ComponentConfiguration compConf = comp.createComponentConfiguration();
        String json = compConf.createParameterJsonSchema();
        assertNotNull(json);

        assertTrue(json.contains("\"contentType\": { \"type\": \"string\""));
        assertTrue(json.contains("\"debugMode\": { \"type\": \"boolean\""));
    }
View Full Code Here

        BeanComponent comp = context.getComponent("bean", BeanComponent.class);
        EndpointConfiguration conf = comp.createConfiguration("bean:foo?method=bar");

        assertEquals("bar", conf.getParameter("method"));

        ComponentConfiguration compConf = comp.createComponentConfiguration();
        String json = compConf.createParameterJsonSchema();
        assertNotNull(json);

        assertTrue(json.contains("\"method\": { \"type\": \"string\""));
        assertTrue(json.contains("\"cache\": { \"type\": \"boolean\""));
    }
View Full Code Here

        DataSetComponent comp = context.getComponent("dataset", DataSetComponent.class);
        EndpointConfiguration conf = comp.createConfiguration("dataset:foo?minRate=3");

        assertEquals("3", conf.getParameter("minRate"));

        ComponentConfiguration compConf = comp.createComponentConfiguration();
        String json = compConf.createParameterJsonSchema();
        assertNotNull(json);

        assertTrue(json.contains("\"preloadSize\": { \"type\": \"integer\""));
        assertTrue(json.contains("\"minRate\": { \"type\": \"integer\""));
        assertTrue(json.contains("\"exchangePattern\": { \"type\": \"string\", \"javaType\": \"org.apache.camel.ExchangePattern\""
View Full Code Here

        LanguageComponent comp = context.getComponent("language", LanguageComponent.class);
        EndpointConfiguration conf = comp.createConfiguration("language:simple:foo?transform=false");

        assertEquals("false", conf.getParameter("transform"));

        ComponentConfiguration compConf = comp.createComponentConfiguration();
        String json = compConf.createParameterJsonSchema();
        assertNotNull(json);

        assertTrue(json.contains("\"script\": { \"type\": \"string\""));
        assertTrue(json.contains("\"cacheScript\": { \"type\": \"boolean\""));
    }
View Full Code Here

        FileComponent comp = context.getComponent("file", FileComponent.class);
        EndpointConfiguration conf = comp.createConfiguration("file:target/foo?delete=true");

        assertEquals("true", conf.getParameter("delete"));

        ComponentConfiguration compConf = comp.createComponentConfiguration();
        String json = compConf.createParameterJsonSchema();
        assertNotNull(json);

        assertTrue(json.contains("\"exclude\": { \"type\": \"string\""));
        assertTrue(json.contains("\"delete\": { \"type\": \"boolean\""));
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.ComponentConfiguration

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.