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

com.maxleap.code.impl.LoaderBase Maven / Gradle / Ivy

There is a newer version: 2.4.9
Show newest version
package com.maxleap.code.impl;

import com.maxleap.code.*;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by stream.
 */
public abstract class LoaderBase implements Loader {
  private Logger logger = LoggerFactory.getLogger(LoaderBase.class);
  private Map definers;

  private Definer functionDefiner = new DefineFunction();
  private Definer jobDefiner = new DefineJob();
  private Definer managerDefiner = new DefineLASClassManager();

  protected LoaderBase() {
    this.definers = new HashMap();
    definers.put(functionDefiner.getCategory().alias(), functionDefiner);
    definers.put(jobDefiner.getCategory().alias(), jobDefiner);
    definers.put(managerDefiner.getCategory().alias(), managerDefiner);
  }

  @Override
  public Map definers() {
    return definers;
  }

  protected void defineFunction(String name, LASHandler handler) {
    functionDefiner.define(name, handler);
    logger.info("Deployed Cloud Function :" + name);
  }

  protected void defineJob(String name, LASHandler handler) {
    jobDefiner.define(name, handler);
    logger.info("Deployed Cloud Job :" + name);
  }

  void defineClassesManager(String name, LASHandler handler) {
    managerDefiner.define(name, handler);
    logger.info("Deployed Cloud Classes Manager :" + name);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy