forked from apache/camel-k-runtime
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kamelets: create a camel-kamelet component apache#375
- Loading branch information
1 parent
0a7cdbe
commit 8b4ddcb
Showing
15 changed files
with
748 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<groupId>org.apache.camel.k</groupId> | ||
<artifactId>camel-k-runtime-parent</artifactId> | ||
<version>1.5.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>camel-kamelet</artifactId> | ||
|
||
<dependencies> | ||
|
||
<!-- ****************************** --> | ||
<!-- --> | ||
<!-- RUNTIME --> | ||
<!-- --> | ||
<!-- ****************************** --> | ||
|
||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
<version>${slf4j.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.camel</groupId> | ||
<artifactId>camel-core-engine</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.camel</groupId> | ||
<artifactId>camel-direct</artifactId> | ||
</dependency> | ||
|
||
<!-- ****************************** --> | ||
<!-- --> | ||
<!-- TESTS --> | ||
<!-- --> | ||
<!-- ****************************** --> | ||
|
||
<dependency> | ||
<groupId>org.apache.camel.k</groupId> | ||
<artifactId>camel-k-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.camel</groupId> | ||
<artifactId>camel-core-languages</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.camel</groupId> | ||
<artifactId>camel-timer</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.camel</groupId> | ||
<artifactId>camel-log</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.jboss.jandex</groupId> | ||
<artifactId>jandex-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>make-index</id> | ||
<goals> | ||
<goal>jandex</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.camel</groupId> | ||
<artifactId>camel-component-maven-plugin</artifactId> | ||
<version>${camel.version}</version> | ||
<executions> | ||
<execution> | ||
<id>generate</id> | ||
<goals> | ||
<goal>generate</goal> | ||
</goals> | ||
<phase>process-classes</phase> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>build-helper-maven-plugin</artifactId> | ||
<version>${build-helper-maven-plugin.version}</version> | ||
<executions> | ||
<execution> | ||
<phase>generate-sources</phase> | ||
<goals> | ||
<goal>add-source</goal> | ||
<goal>add-resource</goal> | ||
</goals> | ||
<configuration> | ||
<sources> | ||
<source>src/generated/java</source> | ||
</sources> | ||
<resources> | ||
<resource> | ||
<directory>src/generated/resources</directory> | ||
</resource> | ||
</resources> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
55 changes: 55 additions & 0 deletions
55
...let/src/generated/java/org/apache/camel/component/kamelet/KameletComponentConfigurer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* Generated by camel build tools - do NOT edit this file! */ | ||
package org.apache.camel.component.kamelet; | ||
|
||
import java.util.Map; | ||
|
||
import org.apache.camel.CamelContext; | ||
import org.apache.camel.spi.GeneratedPropertyConfigurer; | ||
import org.apache.camel.spi.PropertyConfigurerGetter; | ||
import org.apache.camel.util.CaseInsensitiveMap; | ||
import org.apache.camel.support.component.PropertyConfigurerSupport; | ||
|
||
/** | ||
* Generated by camel build tools - do NOT edit this file! | ||
*/ | ||
@SuppressWarnings("unchecked") | ||
public class KameletComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter { | ||
|
||
@Override | ||
public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { | ||
KameletComponent target = (KameletComponent) obj; | ||
switch (ignoreCase ? name.toLowerCase() : name) { | ||
case "basicpropertybinding": | ||
case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true; | ||
case "bridgeerrorhandler": | ||
case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true; | ||
case "lazystartproducer": | ||
case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; | ||
default: return false; | ||
} | ||
} | ||
|
||
@Override | ||
public Map<String, Object> getAllOptions(Object target) { | ||
Map<String, Object> answer = new CaseInsensitiveMap(); | ||
answer.put("basicPropertyBinding", boolean.class); | ||
answer.put("bridgeErrorHandler", boolean.class); | ||
answer.put("lazyStartProducer", boolean.class); | ||
return answer; | ||
} | ||
|
||
@Override | ||
public Object getOptionValue(Object obj, String name, boolean ignoreCase) { | ||
KameletComponent target = (KameletComponent) obj; | ||
switch (ignoreCase ? name.toLowerCase() : name) { | ||
case "basicpropertybinding": | ||
case "basicPropertyBinding": return target.isBasicPropertyBinding(); | ||
case "bridgeerrorhandler": | ||
case "bridgeErrorHandler": return target.isBridgeErrorHandler(); | ||
case "lazystartproducer": | ||
case "lazyStartProducer": return target.isLazyStartProducer(); | ||
default: return null; | ||
} | ||
} | ||
} | ||
|
68 changes: 68 additions & 0 deletions
68
...elet/src/generated/java/org/apache/camel/component/kamelet/KameletEndpointConfigurer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* Generated by camel build tools - do NOT edit this file! */ | ||
package org.apache.camel.component.kamelet; | ||
|
||
import java.util.Map; | ||
|
||
import org.apache.camel.CamelContext; | ||
import org.apache.camel.spi.GeneratedPropertyConfigurer; | ||
import org.apache.camel.spi.PropertyConfigurerGetter; | ||
import org.apache.camel.util.CaseInsensitiveMap; | ||
import org.apache.camel.support.component.PropertyConfigurerSupport; | ||
|
||
/** | ||
* Generated by camel build tools - do NOT edit this file! | ||
*/ | ||
@SuppressWarnings("unchecked") | ||
public class KameletEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter { | ||
|
||
@Override | ||
public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { | ||
KameletEndpoint target = (KameletEndpoint) obj; | ||
switch (ignoreCase ? name.toLowerCase() : name) { | ||
case "basicpropertybinding": | ||
case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true; | ||
case "bridgeerrorhandler": | ||
case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true; | ||
case "exceptionhandler": | ||
case "exceptionHandler": target.setExceptionHandler(property(camelContext, org.apache.camel.spi.ExceptionHandler.class, value)); return true; | ||
case "exchangepattern": | ||
case "exchangePattern": target.setExchangePattern(property(camelContext, org.apache.camel.ExchangePattern.class, value)); return true; | ||
case "lazystartproducer": | ||
case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; | ||
case "synchronous": target.setSynchronous(property(camelContext, boolean.class, value)); return true; | ||
default: return false; | ||
} | ||
} | ||
|
||
@Override | ||
public Map<String, Object> getAllOptions(Object target) { | ||
Map<String, Object> answer = new CaseInsensitiveMap(); | ||
answer.put("basicPropertyBinding", boolean.class); | ||
answer.put("bridgeErrorHandler", boolean.class); | ||
answer.put("exceptionHandler", org.apache.camel.spi.ExceptionHandler.class); | ||
answer.put("exchangePattern", org.apache.camel.ExchangePattern.class); | ||
answer.put("lazyStartProducer", boolean.class); | ||
answer.put("synchronous", boolean.class); | ||
return answer; | ||
} | ||
|
||
@Override | ||
public Object getOptionValue(Object obj, String name, boolean ignoreCase) { | ||
KameletEndpoint target = (KameletEndpoint) obj; | ||
switch (ignoreCase ? name.toLowerCase() : name) { | ||
case "basicpropertybinding": | ||
case "basicPropertyBinding": return target.isBasicPropertyBinding(); | ||
case "bridgeerrorhandler": | ||
case "bridgeErrorHandler": return target.isBridgeErrorHandler(); | ||
case "exceptionhandler": | ||
case "exceptionHandler": return target.getExceptionHandler(); | ||
case "exchangepattern": | ||
case "exchangePattern": return target.getExchangePattern(); | ||
case "lazystartproducer": | ||
case "lazyStartProducer": return target.isLazyStartProducer(); | ||
case "synchronous": return target.isSynchronous(); | ||
default: return null; | ||
} | ||
} | ||
} | ||
|
2 changes: 2 additions & 0 deletions
2
camel-kamelet/src/generated/resources/META-INF/services/org/apache/camel/component/kamelet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Generated by camel build tools - do NOT edit this file! | ||
class=org.apache.camel.component.kamelet.KameletComponent |
2 changes: 2 additions & 0 deletions
2
...t/src/generated/resources/META-INF/services/org/apache/camel/configurer/kamelet-component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Generated by camel build tools - do NOT edit this file! | ||
class=org.apache.camel.component.kamelet.KameletComponentConfigurer |
2 changes: 2 additions & 0 deletions
2
...et/src/generated/resources/META-INF/services/org/apache/camel/configurer/kamelet-endpoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Generated by camel build tools - do NOT edit this file! | ||
class=org.apache.camel.component.kamelet.KameletEndpointConfigurer |
Oops, something went wrong.