📄 receiverparameter.java
字号:
package com.sms.platform.switchcenter.parameter;
import java.util.LinkedList;
import org.apache.log4j.Logger;
import com.sms.platform.switchcenter.entity.ReceiverFile;
public class ReceiverParameter {
private static Logger log = Logger.getLogger(ReceiverParameter.class);
private static ReceiverParameter _instance = null;
private static String parameterPath = "";
boolean isPriority = false;
LinkedList <ReceiverFile> filename = new LinkedList<ReceiverFile>();
// 构造函数
private ReceiverParameter(String _parameterPath) throws Exception {
//需要载入配置文件,添加多个
parameterPath = _parameterPath;
isPriority = ReceiverFile.loadIsPriority(parameterPath);
filename = ReceiverFile.loadReceiverFile(parameterPath);
}
/**
* 单例模式获得实例的方法
*
* @return Global
*/
public static synchronized ReceiverParameter getInstance(String parameterPath) {
if (_instance == null) {
try {
_instance = new ReceiverParameter(parameterPath);
} catch (Throwable ex) {
log.error("", ex);
System.exit(0);
}
}
return _instance;
}
public void loadReceiverParameter() throws Exception {
isPriority = ReceiverFile.loadIsPriority(this.parameterPath);
filename = ReceiverFile.loadReceiverFile(this.parameterPath);
}
/**
* 单例模式获得实例的方法
*
* @return Global
*/
public static synchronized ReceiverParameter getInstance() {
if (_instance == null) {
try {
if(parameterPath != null && !parameterPath.equals(""))
_instance = new ReceiverParameter(parameterPath);
} catch (Throwable ex) {
log.error("", ex);
System.exit(0);
}
}
return _instance;
}
public boolean isPriority() {
return isPriority;
}
public void setPriority(boolean isPriority) {
this.isPriority = isPriority;
}
public LinkedList<ReceiverFile> getFilename() {
return filename;
}
public void setFilename(LinkedList<ReceiverFile> filename) {
this.filename = filename;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -