All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.yandex.qatools.camelot.common.builders.BuildersFactoryImpl Maven / Gradle / Ivy

There is a newer version: 2.5.4
Show newest version
package ru.yandex.qatools.camelot.common.builders;

import org.apache.camel.CamelContext;
import org.quartz.Scheduler;
import ru.yandex.qatools.camelot.api.AppConfig;
import ru.yandex.qatools.camelot.config.Plugin;

import static java.util.concurrent.TimeUnit.MINUTES;

/**
 * @author Ilya Sadykov (mailto: [email protected])
 */
public class BuildersFactoryImpl implements BuildersFactory {
    private long waitForLockSec = MINUTES.toSeconds(5);

    @Override
    public AggregatorRoutesBuilder newAggregatorPluginRouteBuilder(CamelContext camelContext,
                                                                   Plugin plugin) throws Exception { //NOSONAR
        return new AggregatorPluginRouteBuilder(camelContext, plugin);
    }

    @Override
    public ProcessorRoutesBuilder newProcessorPluginRouteBuilder(CamelContext camelContext,
                                                                 Plugin plugin) throws Exception { //NOSONAR
        return new ProcessorPluginRouteBuilder(camelContext, plugin);
    }

    @Override
    public AggregationRepositoryBuilder newRepositoryBuilder(CamelContext camelContext) throws Exception { //NOSONAR
        return new MemoryAggregationRepositoryBuilder(camelContext, waitForLockSec);
    }

    @Override
    public QuartzInitializer newQuartzInitializer(Scheduler scheduler, AppConfig config) throws Exception { //NOSONAR
        return new QuartzInitializerImpl(scheduler, config);
    }

    @Override
    public SchedulerBuildersFactory newSchedulerBuildersFactory(Scheduler scheduler, CamelContext camelContext){
        return new SchedulerBuildersFactoryImpl(scheduler, camelContext);
    }

    public long getWaitForLockSec() {
        return waitForLockSec;
    }

    public void setWaitForLockSec(long waitForLockSec) {
        this.waitForLockSec = waitForLockSec;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy