com.alogic.idnote.loader.HotLoader Maven / Gradle / Ivy
package com.alogic.idnote.loader;
import com.alogic.idnote.IdNote;
import com.alogic.idnote.IdNoteGroup;
import com.alogic.load.Loader;
import com.anysoft.util.Properties;
import com.anysoft.util.PropertiesConstants;
/**
* 热部署文件
* @author yyduan
* @since 1.6.12.13 [20181213 duanyy]
*/
public class HotLoader extends Loader.HotFile implements IdNoteGroup{
protected String dftClass = IdNote.Default.class.getName();
@Override
protected String getObjectDftClass() {
return dftClass;
}
@Override
public void configure(Properties p){
dftClass = PropertiesConstants.getString(p, "dftClass", dftClass);
super.configure(p);
}
@Override
public String getNote(String id, String dft) {
IdNote note = getNote(id);
return note != null ? note.getNote() : dft;
}
@Override
public IdNote getNote(String id) {
return load(id, true);
}
}