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

📄 cmppfactory.java

📁 使用华为cmpp2.0网关
💻 JAVA
字号:
package com.hoten.cmpp.type;import com.hoten.cmpp.CMPP_Service;import java.util.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public abstract class CMPPFactory {  protected abstract CMPP_Service creat();  private static Map factories = new HashMap();  protected static void addFactory(String id ,CMPPFactory cmpp){    factories.put(id,cmpp);  }  public static final CMPP_Service creatCMPP(String id){    if(!factories.containsKey(id)){      try {        Class.forName(id);      }      catch (ClassNotFoundException ex) {        throw new RuntimeException("Error:"+id);      }      if(!factories.containsKey(id)){        throw new RuntimeException("Bad Shape Creation:"+id);      }    }    return ((CMPPFactory)factories.get(id)).creat();  }}

⌨️ 快捷键说明

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