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

com.morethanheroic.taskforce.sample.SampleApplication Maven / Gradle / Ivy

Go to download

Java Task Force (JTF) is a minimalistic batch framework that aims to radically simplify the writing and running of single-instance batch processing applications.

The newest version!
package com.morethanheroic.taskforce.sample;

import com.morethanheroic.taskforce.executor.JobExecutor;
import com.morethanheroic.taskforce.job.Job;
import com.morethanheroic.taskforce.job.builder.JobBuilder;
import com.morethanheroic.taskforce.sample.domain.SampleGenerator;
import com.morethanheroic.taskforce.sample.domain.SampleSink;
import com.morethanheroic.taskforce.sample.domain.SampleTask;
import com.morethanheroic.taskforce.sample.domain.SlowSampleTask;
import com.morethanheroic.taskforce.task.domain.TaskContext;

public class SampleApplication {

    public static void main(final String... args) {
        final Job job = JobBuilder.newBuilder()
                .generator(new SampleGenerator())
                .task("task-one", new SampleTask())
                .task("task-two", new SlowSampleTask(),
                        TaskContext.builder()
                                .statisticsCollectionEnabled(true)
                                .statisticsReportingEnabled(true)
                                .statisticsReportingRate(5)
                                .build()
                )
                .sink(new SampleSink())
                .build();

        final JobExecutor jobExecutor = new JobExecutor();
        jobExecutor.execute(job);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy