fidspush.java

来自「短信发送」· Java 代码 · 共 62 行

JAVA
62
字号
/**
 * Created at Dec 4, 2008
 */
package com.jdev.app.db;

import com.jdev.net.connector.ConnectionFactory;
import com.jdev.net.event.Notifier;

/**
 * <p>Title: FidsPush</p>
 * <p>Description: </p>
 * @author Lawrence
 * @version 
 */
public class FidsPush implements Runnable {
	private static Notifier notifier = Notifier.getNotifier();
	private FidsQueueHelper fidsDataHelper;
	
	/**
	 * 
	 */
	public FidsPush() {
		fidsDataHelper = new FidsQueueHelper(ConnectionFactory.CLIENT);
	}

	/* (non-Javadoc)
	 * @see java.lang.Runnable#run()
	 */
	public void run() {
		while (!Thread.interrupted()) {
			try {
				Thread.sleep(1000);
				String strOut = fidsDataHelper.readSend();
//				Debug.logVerbose(strOut);
				
				// 发送短信			
				String[] s = strOut.split(",");
				if(s.length == 3){
					String[] callees = new String[]{s[0]};
					String isReturn = "0";
					int msgId = 136744;
					
					strOut = s[1];
//					String ret = SMSWebService.sendMsg(strOut, callees, isReturn, msgId);
					notifier.fireOnStatus(strOut, Integer.parseInt("0"));
//					if(ret.equalsIgnoreCase("0"))
//						notifier.fireOnStatus(strOut, 0);
//					else
//						notifier.fireOnStatus(strOut, 1);
				}
				
				
			} catch (Exception e) {
				notifier.fireOnError("-->Error occured in SmsPush: "
						+ e.getMessage());
				continue;
			}
		}
	}

}

⌨️ 快捷键说明

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