/**
 * 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.
 */
package org.apache.camel.cdi.ee;

import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.ejb.Singleton;
import javax.ejb.Startup;
import javax.inject.Inject;
import java.util.logging.Level;

/**
 * @author Arun Gupta / Markus Eisele
 */
@Singleton
@Startup
public class Bootstrap {

    @Inject
    CamelContext context;

    Logger logger = LoggerFactory.getLogger(Bootstrap.class);

    @PostConstruct
    public void init() {
        logger.info(">> Create CamelContext and register Camel Route.");

        try {
            context.addRoutes(new RouteBuilder() {
                @Override
                public void configure() {

                    from("timer://timer1?period=1000")
                            .setBody()
                            .simple("Camel")
                            .beanRef("helloCamel", "sayHello")
                            .log(">> Response : ${body}");

                }
            });
        // Start Camel Context
        context.start();

        logger.info(">> CamelContext created and camel route started.");
        } catch (Exception ex) {
            java.util.logging.Logger.getLogger(Bootstrap.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    @PreDestroy
    public void shutdown() {
        // Graceful Shutdown Camel Context
        try {
        context.stop();
        logger.info(">> CamelContext stopped .");
        } catch (Exception ex) {
            java.util.logging.Logger.getLogger(Bootstrap.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}

@@ -1433,25 +1433,26 @@
 Create Camel
-C
+ c
 ontext and r
@@ -1465,17 +1465,17 @@
 r Camel 
-R
+r
 oute.%22);
@@ -1689,20 +1689,16 @@
         
-    
 .setBody
@@ -1700,20 +1700,16 @@
 tBody()%0A
-    
         
@@ -1769,20 +1769,13 @@
     
-    
 .bean
-Ref
 (%22he
@@ -1821,20 +1821,16 @@
         
- 
-   
 .log(%22%3E%3E
@@ -1848,25 +1848,24 @@
  $%7Bbody%7D%22);%0A
-%0A
             
@@ -1905,25 +1905,25 @@
 Start Camel 
-C
+c
 ontext%0A     
@@ -1968,25 +1968,26 @@
 fo(%22%3E%3E Camel
-C
+ c
 ontext creat
@@ -1993,17 +1993,17 @@
 ted and 
-c
+C
 amel rou
@@ -2036,34 +2036,37 @@
 atch (Exception 
+caus
 e
-x
 ) %7B%0A            
@@ -2143,34 +2143,37 @@
 l.SEVERE, null, 
+caus
 e
-x
 );%0A        %7D%0A   
@@ -2241,17 +2241,17 @@
 raceful 
-S
+s
 hutdown 
@@ -2256,17 +2256,17 @@
 n Camel 
-C
+c
 ontext%0A 
@@ -2278,32 +2278,36 @@
   try %7B%0A        
+  
+  
 context.stop();%0A
@@ -2306,32 +2306,36 @@
 stop();%0A        
+   
+ 
 logger.info(%22%3E%3E 
@@ -2335,25 +2335,26 @@
 fo(%22%3E%3E Camel
-C
+ c
 ontext stopp
@@ -2355,17 +2355,16 @@
  stopped
- 
 .%22);%0A   
@@ -2387,18 +2387,21 @@
 ception 
+caus
 e
-x
 ) %7B%0A    
@@ -2494,18 +2494,21 @@
 , null, 
+caus
 e
-x
 );%0A     

Replace beanRef deprecated method