package com.yihu.hos.broker.common.camelrouter;

import com.yihu.hos.broker.configurations.ArbiterConfiguration;
import org.apache.camel.builder.RouteBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @created Airhead 2016/8/1.
 */
@Component
public class BrokerServerRouter extends RouteBuilder {
    @Autowired
    private ArbiterConfiguration arbiterConfiguration;

    @Override
    public void configure() throws Exception {
        if (arbiterConfiguration.getEnable()) {
            from("timer:brokerServerOnline?period={{hos.timer.period}}")
                    .to("bean:brokerServerService?method=brokerServerOnline");
        }
    }
}
