kingbishop / JobManagementSystem

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Job Management System

Simple Single Application Prototype

The goal of this system is to handle the execution of multiple types of Jobs.

Main Components

Implementation

Creating a command job that simply prints "Hello World"

        /*Given a command and a priority*/
        Job printHelloWorld = new CommandJob(()->{
			System.out.println("Hello World");
			return JobCode.SUCCESS;
		},10);

Scheduling a Job

    long scheduleFor = System.currentTimeMillis() + 1000 //1 second from start
    JobManagementService.scheduleJob(printHelloWorld, scheduleFor);

Starting the Job Management System, blocks

    JobManagementService.start();
    /* 
        //Starting Async
        JobManagementService.startAsync();
    */

About


Languages

Language:Java 100.0%