⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tempfile.3.tmp

📁 this is example use EJB with jboss.
💻 TMP
字号:
/*
 * Copyright(C) 2008, NTT AT Co., Ltd.
 * Project: AWGView
 *
 * Notes:
 *  N/A
 *
 * Record of change:
 * Date         Version      Name       Content
 * 2008/12/15   1.0          TriNT      First create       
 */
package jp.co.ntt.awgview.server.common;

import java.util.ArrayList;

import jp.co.ntt.awgview.server.AppMainServer;
import jp.co.ntt.awgview.server.constant.Constants;

/**
 * Class name 	: AlarmType <BR>
 * Package    	: jp.co.ntt_at.awgview.server.common <BR>
 * 
 * Description	: AlarmType function to get all Alarm type form configuration file (alarm_type.ini)<BR>
 * 				  Using log4j library <BR>
 * 
 * @author		: AI&T
 * @version 	: 1.0
 */
public class AlarmType {	
	private static ArrayList<String> arrayAlarmType = new ArrayList<String>();
	
	/**
	 * Load Alarm Type form configuration file into ArrayList<String>
	 * @return
	 */
	public static boolean loadAlarmType() {
		
		if (AppMainServer.JBOSS_HOME == null){
			 AppMainServer.JBOSS_HOME = System.getenv("JBOSS_HOME");
			 if (AppMainServer.JBOSS_HOME == null){
				 LogWriter.getInstance().fatal("Make sure that JBOSS_HOME  is still defined in the environment");
			     System.exit(0);
			 }
		}
		
		String pathConf = AppMainServer.JBOSS_HOME + Constants.ALARM_TYPE_CONFIG_FILE;
		
		LogWriter.getInstance(LogWriter.SNMP_LOG).info("Read file Alarm type configuration with path: " + pathConf);
		LogWriter.getInstance(LogWriter.DB_LOG).info("Read file Alarm type configuration with path: " + pathConf);
		
		arrayAlarmType = Utils.readFile2ArrayList(pathConf);		
		if (arrayAlarmType == null) {
			LogWriter.getInstance(LogWriter.SNMP_LOG).error("Cout not read Alarm type setting");
			LogWriter.getInstance(LogWriter.DB_LOG).error("Cout not read Alarm type setting");
			return false;
		} else if (arrayAlarmType.isEmpty()){						
			LogWriter.getInstance(LogWriter.SNMP_LOG).error("Cout not read Alarm type setting");
			LogWriter.getInstance(LogWriter.DB_LOG).error("Cout not read Alarm type setting");
			return false;			
		}
		
		return true;
	}
	
	/**
	 * Get Alarm Type
	 * @return arrayAlarmType is ArrayList<String>
	 */
	public static ArrayList<String> getAlarmType(){
		return arrayAlarmType;
	}	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -