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

📄 bizconfig.java

📁 java的一系列产品中包括jsme,jmse,j2ee,本文件提供j2ee实现的源代码.
💻 JAVA
字号:
package bizcape.com;

import javax.servlet.*;
import javax.servlet.http.*;
import java.lang.*;
import java.net.*;
import java.util.Properties;
import java.io.*;

public class BizConfig{
	public static String fileName,sText;
	public static int iMaxRecv,iMaxSize,iReqNum,iInterval;
	public static String sRmtDef;
		
	private static Properties defaultProperty = new Properties();
	private static void setDefault(){
		defaultProperty.setProperty("MaxRecv","50");
		defaultProperty.setProperty("MaxXmlTextSize","2048");
		defaultProperty.setProperty("RequestNum","80");		
		defaultProperty.setProperty("PollingInterval","1000");
		defaultProperty.setProperty("RmtDefinition","file://zhanghz/D:/BizCape/RmtDefinition.xml");
	}
	
	public static boolean BizInit(){
		try{
			fileName=System.getProperty("bizprop","BizCape.prop");
			setDefault();
			InputStream  in =new BufferedInputStream(new FileInputStream(fileName));
			Properties prop=new Properties(defaultProperty);
			prop.load(in);
			if(!applyProperty(prop)){
		  	System.err.println("applyProperty fail");
				return false;	
			}
		}catch (IOException e) {
			 System.err.println(e);
			 return false;
		}
		return true; 
	}	
	
	private static boolean applyProperty(Properties prop){		
		try{
			iMaxRecv=Integer.valueOf(prop.getProperty("MaxRecv")).intValue();
			iMaxSize=Integer.valueOf(prop.getProperty("MaxXmlTextSize")).intValue();
			iReqNum=Integer.valueOf(prop.getProperty("RequestNum")).intValue();
			iInterval=Integer.valueOf(prop.getProperty("PollingInterval")).intValue();
			sRmtDef=prop.getProperty("RmtDefinition");
	  }catch(NumberFormatException e){
			System.err.println(e.toString() + " : in file BizCape.prop");
      return false;
		}
		return true;
	}		
}

⌨️ 快捷键说明

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