📄 processsms.java~18~
字号:
import Utilities.Engine;
import XML.*;
/**
* <p>Title: InHand SMS platform XMLRouter</p>
* <p>Description: InHand 短信服务平台服务路由器</p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: 北京映翰通网络技术有限公司</p>
* @author 韩传俊 shock2000@21cn.com
* @version 1.0
*/
public class ProcessSMS extends Engine {
public ProcessSMS() {
super("ProcessSMS");
}
public void run(){
String xmlStr="";
while(isRunning()){
if(!Config.recv_queue.isEmpty()){
xmlStr=(String)Config.recv_queue.pop();
//if (xmlStr!=null){
processXMLStr(xmlStr);
//}
}else{
nap();
}
}
this.shutdown();
Config.log.log("Thread processSMS is shutdown!");
}
private void processXMLStr(String xmlStr){
String xmlstr=xmlStr.toLowerCase();
ParseXML xml=new ParseXML();
xml.parse(xmlstr);
if (xmlstr.startsWith("<cmpp_d")){
//System.out.println("***** Read: "+xmlStr.substring(0,60)+" ...");
String msg_content=xml.getStringValue("/cmpp_deliver/msg_content");
String subcode=xml.getStringValue("/cmpp_deliver/destination_id");
int registered_delivery=xml.getIntValue("/cmpp_deliver/registered_delivery");
if (registered_delivery == 0){
if ((subcode.length()==4 && !subcode.startsWith("0")) || (subcode.length()==5 && subcode.startsWith("0"))){
while(!Config.service_id_queue.push(xmlStr))nap();
if(msg_content.startsWith("30303030") || msg_content.startsWith("0030003000300030"))
while(!Config.subcode_queue.push(xmlStr)) nap();
Config.incMo();
//System.out.println("-------------in RecvManager.processXMLStr() push deliver in service_id");
}else{
while(!Config.subcode_queue.push(xmlStr))nap();
Config.incMo();
//System.out.println("-------------in RecvManager.processXMLStr() push deliver in subcode");
}
}else{
while(!Config.service_id_queue.push(xmlStr))nap();
while(!Config.subcode_queue.push(xmlStr))nap();
}
}else {
while(!Config.service_id_queue.push(xmlStr)) nap();
while(!Config.subcode_queue.push(xmlStr) nap();
}
xml.release();
}
public static void main(String[] args) {
ProcessSMS processSMS1 = new ProcessSMS();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -