package camelcoredemo;


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

/**
 * Created by kennethfeng on 3/28/15.
 */
public class TimerMain {
    static Logger LOG = LoggerFactory.getLogger(TimerMain.class);

    public static void main(String []args) throws Exception {
        new TimerMain().run();
    }

    void run() throws Exception {
        final CamelContext camelContext = new DefaultCamelContext();

        camelContext.addRoutes(createRouteBuilder());
        camelContext.setTracing(true);
        camelContext.start();

        Runtime.getRuntime().addShutdownHook(new Thread() {
            public void run() {
                try {
                    camelContext.stop();
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        });

        waitForStop();
    }

    RouteBuilder createRouteBuilder() {
        return new TimerRouteBuilder();
    }

    void waitForStop() {
        while (true) {
            try {
                Thread.sleep(Long.MAX_VALUE);
            }
            catch (InterruptedException e) {
                break;
            }
        }
    }
}

package camelcoredemo;


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

/**
 * Created by kennethfeng on 3/28/15.
 */
public class TimerMain extends Main {
    static Logger LOG = LoggerFactory.getLogger(TimerMain.class);

    public static void main(String []args) throws Exception {
        TimerMain main = new TimerMain();
        main.enableHangupSupport();
        main.addRouteBuilder(createRouteBuilder());
        main.run(args);
    }

    static RouteBuilder createRouteBuilder() {
        return new TimerRouteBuilder();
    }
}

Use Improved Main Class