Java 类org.apache.camel.catalog.DefaultCamelCatalog 实例源码

项目:syndesis-rest    文件:ConnectorCatalog.java   
public ConnectorCatalog(ConnectorCatalogProperties props) {

        connectorCatalog = new DefaultCamelConnectorCatalog();
        camelCatalog = new DefaultCamelCatalog(true);

        prefetchConnectors();

        maven = new DefaultMavenArtifactProvider();

        for (Map.Entry<String, String> repo : props.getMavenRepos().entrySet()) {
            maven.addMavenRepository(repo.getKey(), repo.getValue());
        }

        for (String gav : props.getConnectorGAVs()) {
            addConnector(gav);
        }
    }
项目:syndesis    文件:ConnectorCatalog.java   
public void init() throws Exception {
    connectorCatalog = new DefaultCamelConnectorCatalog();
    camelCatalog = new DefaultCamelCatalog(true);

    maven = new DefaultMavenArtifactProvider();

    // add 3rd party maven repos
    System.out.println("Adding bintray and jcenter as 3rd party Maven repositories");
    maven.addMavenRepository("jcenter", "https://jcenter.bintray.com");
}
项目:syndesis    文件:ComponentProxyComponent.java   
public ComponentProxyComponent(String componentId, String componentScheme) {
    this.componentId = componentId;
    this.componentScheme = componentScheme;
    this.componentSchemeAlias = Optional.empty();
    this.options = new HashMap<>();
    this.catalog = new DefaultCamelCatalog(false);

    try {
        this.definition = ComponentDefinition.forScheme(catalog, componentScheme);
    } catch (IOException e) {
        throw ObjectHelper.wrapRuntimeCamelException(e);
    }

    registerExtension(this::getComponentVerifierExtension);
}
项目:connectors    文件:ConnectorCatalog.java   
public void init() throws Exception {
    connectorCatalog = new DefaultCamelConnectorCatalog();
    camelCatalog = new DefaultCamelCatalog(true);

    maven = new DefaultMavenArtifactProvider();

    // add 3rd party maven repos
    System.out.println("Adding bintray and jcenter as 3rd party Maven repositories");
    maven.addMavenRepository("jcenter", "https://jcenter.bintray.com");
}
项目:camel-language-server    文件:CamelTextDocumentService.java   
public CamelTextDocumentService() {
    camelCatalog = CompletableFuture.supplyAsync(() -> {
        DefaultCamelCatalog res = new DefaultCamelCatalog(true);
        res.loadVersion("2.20.1");
        return res;
    });
}
项目:fabric8-forge    文件:CamelArchetypeCatalogFactory.java   
@Override
public ArchetypeCatalog getArchetypeCatalog() {
    if (cachedArchetypes == null) {
        // use the camel catalog to load the archetypes
        String xml = new DefaultCamelCatalog().archetypeCatalogAsXml();
        if (xml != null) {
            try {
                cachedArchetypes = new ArchetypeCatalogXpp3Reader().read(new StringReader(xml));
            } catch (Exception e) {
                logger.log(Level.SEVERE, "Error while retrieving archetypes", e);
            }
        }
    }
    return cachedArchetypes;
}
项目:funktion-connectors    文件:ConnectorGenerator.java   
private CamelCatalog createCamelCatalog() throws IOException{
    CamelCatalog result = new DefaultCamelCatalog(true);
    //add funktion camel components

    Predicate<String> filter = new FilterBuilder().includePackage("io.fabric8.funktion.camel");
    Reflections resources = new Reflections(new ConfigurationBuilder()
                                                .filterInputsBy(filter)
                                                .setScanners(new ResourcesScanner())
                                                .setUrls(ClasspathHelper.forJavaClassPath()));


    Set<String> jsonFiles = resources.getResources(Pattern.compile(".*\\.json"));


    LOG.info("Processing Funktion Camel components ...");
    for (String jsonFile: jsonFiles){
        InputStream inputStream = getClass().getClassLoader().getResourceAsStream(jsonFile);
        ObjectMapper mapper = new ObjectMapper();
        JsonNode root = mapper.readTree(inputStream);
        JsonNode component = root.path("component");
        if (!component.isMissingNode()) {
            String scheme = component.path("scheme").asText();
            String componentName = component.path("javaType").asText();
            result.addComponent(scheme,componentName);
            LOG.info("Processed component " + scheme);
        }else{
            LOG.error("Failed to find Component for " + jsonFile);
        }
    }
    return result;
}
项目:Camel    文件:CamelModelCatalogTest.java   
@Test
public void testFindModelNames() {
    CamelCatalog catalog = new DefaultCamelCatalog();
    List<String> names = catalog.findModelNames();

    assertNotNull(names);

    LOG.info("Found {} names", names.size());
    assertTrue("Should find some models", names.size() > 0);
}
项目:Camel    文件:CamelModelCatalogTest.java   
@Test
public void testFindModelNamesFilter() {
    CamelCatalog catalog = new DefaultCamelCatalog();
    List<String> names = catalog.findModelNames("transformation");

    assertNotNull(names);

    LOG.info("Found {} names", names.size());
    assertTrue("Should find some transformation models", names.size() > 0);
}
项目:Camel    文件:CamelModelCatalogTest.java   
@Test
public void testFindModelNamesFilterWildcard() {
    CamelCatalog catalog = new DefaultCamelCatalog();
    List<String> names = catalog.findModelNames("t*");

    assertNotNull(names);

    LOG.info("Found {} names", names.size());
    assertTrue("Should find some t* models", names.size() > 0);
}
项目:Camel    文件:CamelModelCatalogTest.java   
@Test
public void testFindComponentNamesFilterNoMatch() {
    CamelCatalog catalog = new DefaultCamelCatalog();
    List<String> names = catalog.findModelNames("cannotmatchme");

    assertNotNull(names);

    assertTrue("Should not match any models", names.size() == 0);
}
项目:Camel    文件:CamelModelCatalogTest.java   
@Test
public void testCoreComponentJson() {
    CamelCatalog catalog = new DefaultCamelCatalog();
    String json = catalog.modelJSonSchema("split");

    assertNotNull(json);
    LOG.info(json);

    assertTrue("Should find to split", json.contains("split"));
}
项目:Camel    文件:CamelModelCatalogTest.java   
@Test
public void testLabels() {
    CamelCatalog catalog = new DefaultCamelCatalog();
    Set<String> labels = catalog.findModelLabels();

    assertNotNull(labels);

    assertTrue("Should find labels", labels.size() > 0);
    assertTrue("Should find transformation label", labels.contains("transformation"));
}
项目:Camel    文件:CamelCatalogTest.java   
@Test
public void testFindComponentNames() {
    CamelCatalog catalog = new DefaultCamelCatalog();
    List<String> names = catalog.findComponentNames();

    assertNotNull("The names should not be null", names);

    LOG.info("Found {} names", names.size());
    assertTrue("Should find some components", names.size() > 0);
}
项目:Camel    文件:CamelCatalogTest.java   
@Test
public void testFindComponentNamesFilter() {
    CamelCatalog catalog = new DefaultCamelCatalog();
    List<String> names = catalog.findComponentNames("testing");

    assertNotNull("The names should not be null", names);

    LOG.info("Found {} names", names.size());
    assertTrue("Should find some testing components", names.size() > 0);
}
项目:Camel    文件:CamelCatalogTest.java   
@Test
public void testFindComponentNamesFilterWildcard() {
    CamelCatalog catalog = new DefaultCamelCatalog();
    List<String> names = catalog.findComponentNames("t*");

    assertNotNull("The names should not be null", names);

    LOG.info("Found {} names", names.size());
    assertTrue("Should find some t* components", names.size() > 0);
}
项目:Camel    文件:CamelCatalogTest.java   
@Test
public void testFindComponentNamesFilterTwo() {
    CamelCatalog catalog = new DefaultCamelCatalog();
    List<String> names = catalog.findComponentNames("transformation");

    assertNotNull("The names should not be null", names);

    LOG.info("Found {} names", names.size());
    assertTrue("Should find some transformation components", names.size() > 0);
}
项目:Camel    文件:CamelCatalogTest.java   
@Test
public void testFindComponentNamesFilterNoMatch() {
    CamelCatalog catalog = new DefaultCamelCatalog();
    List<String> names = catalog.findComponentNames("cannotmatchme");

    assertNotNull("The names should not be null", names);

    assertTrue("Should not match any components", names.size() == 0);
}
项目:Camel    文件:CamelCatalogTest.java   
@Test
public void testCoreComponentJson() {
    CamelCatalog catalog = new DefaultCamelCatalog();
    String json = catalog.componentJSonSchema("bean");

    assertNotNull("Should find the json information about the bean component", json);
    LOG.info(json);

    assertTrue("Should find bean component", json.contains("bean"));
}
项目:Camel    文件:CamelCatalogTest.java   
@Test
public void testFtpComponentJson() {
    CamelCatalog catalog = new DefaultCamelCatalog();
    String json = catalog.componentJSonSchema("ftp");

    assertNotNull("Should find the json information about the ftp component", json);
    LOG.info(json);

    assertTrue("Should find ftp component", json.contains("ftp"));
}
项目:Camel    文件:CamelCatalogTest.java   
@Test
public void testLabels() {
    CamelCatalog catalog = new DefaultCamelCatalog();
    Set<String> labels = catalog.findComponentLabels();

    assertNotNull("Should component labels", labels);

    assertTrue("Should find labels", labels.size() > 0);
    assertTrue("Should find core label", labels.contains("core"));
    assertTrue("Should find testing label", labels.contains("testing"));
    assertTrue("Should find rest label", labels.contains("rest"));
}
项目:Camel    文件:CamelCatalogLuceneTest.java   
@Before
public void createCamelCatalog() {
    catalog = new DefaultCamelCatalog();
    catalog.setSuggestionStrategy(new LuceneSuggestionStrategy());
}
项目:wildfly-camel    文件:WildFlyRuntimeProviderTest.java   
@BeforeClass
public static void createCamelCatalog() {
    catalog = new DefaultCamelCatalog();
    catalog.setRuntimeProvider(new WildFlyRuntimeProvider());
}