bizconfig.java
来自「java的一系列产品中包括jsme,jmse,j2ee,本文件提供j2ee实现的」· Java 代码 · 共 55 行
JAVA
55 行
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 + =
减小字号Ctrl + -
显示快捷键?