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

com.mindsnacks.zinc.classes.jobs.ZincJob Maven / Gradle / Ivy

There is a newer version: 1.6.2
Show newest version
package com.mindsnacks.zinc.classes.jobs;

import com.mindsnacks.zinc.classes.ZincLogging;

import java.util.concurrent.Callable;

/**
 * User: NachoSoto
 * Date: 9/3/13
 */
public abstract class ZincJob implements Callable {
    protected String getJobName() {
        return this.getClass().getSimpleName();
    }

    protected final void logMessage(final String message) {
        ZincLogging.log(getJobName(), message);
    }

    @Override
    public final V call() throws Exception {
        logMessage("started");
        final V result = run();
        logMessage("finished");

        return result;
    }

    protected abstract V run() throws Exception;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy