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

📄 cmppinit.java

📁 短信平台CMPP30 的JAVA程序,(含SQL数据库)
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   CMPPInit.java

package com.cmpp3_0.config;

import com.cmpp3_0.util.Logger;
import java.io.IOException;
import java.io.PrintStream;
import org.apache.xerces.parsers.DOMParser;
import org.w3c.dom.*;
import org.xml.sax.*;

public class CMPPInit
{
    class MyErrorHandle
        implements ErrorHandler
    {

        public void error(SAXParseException e)
            throws SAXException
        {
            System.out.println("an error was found at line:" + e.getLineNumber() + ",row:" + e.getColumnNumber() + "!");
        }

        public void fatalError(SAXParseException e)
            throws SAXException
        {
            System.out.println("A Fatal Error occured at line:" + e.getLineNumber() + ",row:" + e.getColumnNumber() + "!");
            System.out.println("The CMPPInit is not completed!Please check the xml file!");
        }

        public void warning(SAXParseException e)
            throws SAXException
        {
            System.out.println("A Warning was found when parsing the xml file!");
        }

        public MyErrorHandle()
        {
        }
    }


    private int activeTestMaxSendCounts;
    private int activeTestReSendTime;
    private int activeTestThreadSleepTime;
    private int activeTestWaitedTime;
    private String connectBind;
    private String enterpriseCode;
    private String gatewayBind;
    private String gatewayHost;
    private String gatewayLicence;
    private String gatewayName;
    private String gatewayType;
    private boolean hasNullPointerException;
    private boolean hasNumberFormatException;
    private String hostIp;
    private boolean internalDebugMode;
    private boolean isDebugMode;
    private int maxMsgLenAscii;
    private int maxMsgLenOther;
    private int moPort;
    private int mtPort;
    private int packetsMaxSendCounts;
    private int packetsReSendTime;
    private int reConnectWaitedTime;
    private int recvThreadSleepTime;
    private int sendQueueCapacity;
    private int sendThreadSleepTime;
    private String serviceCode;
    private int slideWindowSize;
    private int socketTimeOut;
    private String spId;
    private String spPwd;
    private String user;
    private String version;

    public CMPPInit()
    {
        hasNullPointerException = false;
        hasNumberFormatException = false;
        internalDebugMode = true;
    }

    public int getActiveTestMaxSendCounts()
    {
        return activeTestMaxSendCounts;
    }

    public int getActiveTestReSendTime()
    {
        return activeTestReSendTime * 1000;
    }

    public int getActiveTestThreadSleepTime()
    {
        return activeTestThreadSleepTime;
    }

    public int getActiveTestWaitedTime()
    {
        return activeTestWaitedTime * 1000;
    }

    public String getEnterpriseCode()
    {
        return enterpriseCode;
    }

    public String getHostIP()
    {
        return gatewayHost;
    }

    public int getMaxMsgLenAscii()
    {
        return maxMsgLenAscii;
    }

    public int getMaxMsgLenOther()
    {
        return maxMsgLenOther;
    }

    public int getMoPort()
    {
        return moPort;
    }

    public int getMtPort()
    {
        return mtPort;
    }

    private void getNodeData(Node node)
    {
        if(node == null)
            return;
        node.getNodeType();
        JVM INSTR lookupswitch 1: default 2243
    //                   1: 28;
           goto _L1 _L2
_L1:
        break MISSING_BLOCK_LABEL_2243;
_L2:
        if(node.getNodeName().equals("gateway"))
        {
            NamedNodeMap attr = node.getAttributes();
            if(attr != null)
            {
                int attrlen = attr.getLength();
                for(int i = 0; i < attrlen; i++)
                {
                    if(attr.item(i).getNodeName().equals("name"))
                        gatewayName = attr.item(i).getNodeValue();
                    else
                    if(attr.item(i).getNodeName().equals("type"))
                        gatewayType = attr.item(i).getNodeValue();
                    else
                    if(attr.item(i).getNodeName().equals("host"))
                        gatewayHost = attr.item(i).getNodeValue();
                    else
                    if(attr.item(i).getNodeName().equals("bind"))
                        gatewayBind = attr.item(i).getNodeValue();
                    else
                    if(attr.item(i).getNodeName().equals("licence"))
                        gatewayLicence = attr.item(i).getNodeValue();
                }

            }
            if(internalDebugMode)
                System.out.println("name: " + gatewayName + " type: " + gatewayType + "  gatewayHost: " + gatewayHost + " gatewayBind: " + gatewayBind + "gatewayLicence: " + gatewayLicence);
        } else
        if(node.getNodeName().equals("serviceCode"))
        {
            serviceCode = node.getFirstChild().getNodeValue();
            if(internalDebugMode)
                System.out.println("serviceCode:" + serviceCode);
        } else
        if(node.getNodeName().equals("enterpriseCode"))
        {
            enterpriseCode = node.getFirstChild().getNodeValue();
            if(internalDebugMode)
                System.out.println("enterpriseCode:" + enterpriseCode);
        } else
        if(node.getNodeName().equals("spId"))
        {
            spId = node.getFirstChild().getNodeValue();
            if(internalDebugMode)
                System.out.println("spId:" + spId);
        } else
        if(node.getNodeName().equals("user"))
        {
            Node userNode = node.getFirstChild();
            if(userNode == null)
                user = "";
            else
                user = userNode.getNodeValue();
            if(internalDebugMode)
                System.out.println("user:" + user);
        } else
        if(node.getNodeName().equals("password"))
        {
            Node spPwdNode = node.getFirstChild();
            if(spPwdNode == null)
                spPwd = "";
            else
                spPwd = spPwdNode.getNodeValue();
            if(internalDebugMode)
                System.out.println("spPwd:" + spPwd);
        } else
        if(node.getNodeName().equals("connect"))
        {
            NamedNodeMap attr = node.getAttributes();
            if(attr != null)
            {
                int attrlen = attr.getLength();
                for(int i = 0; i < attrlen; i++)
                {
                    if(attr.item(i).getNodeName().equals("mtPort"))
                        mtPort = Integer.parseInt(attr.item(i).getNodeValue());
                    else
                    if(attr.item(i).getNodeName().equals("moPort"))
                        moPort = Integer.parseInt(attr.item(i).getNodeValue());
                    else
                    if(attr.item(i).getNodeName().equals("bind"))
                        connectBind = attr.item(i).getNodeValue();
                }

            }
            if(internalDebugMode)
                System.out.println("mtPort : " + mtPort + "\tmoPort :" + moPort + "\tconnectBind: " + connectBind);
        } else
        if(node.getNodeName().equals("reConnectWaitedTime"))
        {
            reConnectWaitedTime = Integer.parseInt(node.getFirstChild().getNodeValue());
            if(internalDebugMode)
                System.out.println("reConnectWaitedTime : " + reConnectWaitedTime + "s");
        } else
        if(node.getNodeName().equals("maxMsgLenAscii"))
        {

⌨️ 快捷键说明

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