This is an automated email from the ASF dual-hosted git repository. pcongiusti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 18547515fc2c13a1216a335663aa2e28f3a8c700 Author: gre8t <[email protected]> AuthorDate: Sat Apr 2 13:11:05 2022 +0100 added a trait example for services --- examples/traits/service/service.java | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/examples/traits/service/service.java b/examples/traits/service/service.java new file mode 100644 index 000000000..22064fcd8 --- /dev/null +++ b/examples/traits/service/service.java @@ -0,0 +1,29 @@ +/* + * 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. + */ + +//kamel run --trait service.enabled=true + +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.example.MyClass; + +public class Classpath extends RouteBuilder { + @Override + public void configure() throws Exception { + from("timer:tick") + .log(MyClass.sayHello()); + } +} \ No newline at end of file
