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

kz.greetgo.scheduling.TaskCollector Maven / Gradle / Ivy

There is a newer version: 3.1.1
Show newest version
package kz.greetgo.scheduling;

import kz.greetgo.scheduling.context.SchedulerContext;
import kz.greetgo.scheduling.context.SchedulerContextOnFile;

import java.io.File;

public class TaskCollector extends AbstractTaskCollector {
  public String configExtension = ".class.scheduler";

  public ThrowableCatcher throwableCatcher = new ThrowableCatcher() {
    @Override
    public void catchThrowable(Throwable throwable) {
      throwable.printStackTrace();
    }
  };

  @Override
  protected SchedulerContext getSchedulerContext(Class controllerClass) {
    SchedulerContextOnFile ret = new SchedulerContextOnFile(new File(
        configDir + "/" + controllerClass.getSimpleName() + configExtension
    ));
    ret.throwableCatcher = throwableCatcher;
    ret.makeExceptionCatcherThroughThrowableCatcher();
    return ret;
  }

  private final String configDir;

  public TaskCollector(String configDir) {
    this.configDir = configDir;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy