zoukankan      html  css  js  c++  java
  • 创建classic 得到函数 调用函数

    Class manager = null;

            try
            {
                //1. 创建class
                manager = Class.forName(name);
            }
            catch (ClassNotFoundException e)
            {
             }

            Method oMethod = null;

            try
            {
                //2. 得到函数
                oMethod = manager.getMethod("getInstance", null);
            }
            catch (Exception e)
            {
             }

           IInitializable initializable = null;

            try
            {
                //3. 调用函数
                initializable = (IInitializable) oMethod.invoke(null, null);
            }
            catch (Exception e)
            {
            }

            try
            {
                initializable.init(xmlStatic);
            }
            catch (Throwable e)
            {
             if (blockingError)
                {
                    FatalHandler.manage(this, CoreMessages.format("BSSE0004", name),e);
                }
             else
                {
                 logger.warn(CoreMessages.format("BSSE0004", name));
                 logger.error(e);
                }
                return;
            }

  • 相关阅读:
    统计学——平均数
    JSON与JAVA的数据转换
    Linux使用笔记
    vim代码折叠命令
    让ubuntu的ssh保持长时间连接
    Ubuntu通过xinput禁用及启用联想笔记本的触摸板
    linux下Oracle 相关命令
    linux机械磁盘服务器分区方案
    centos 6.5搭建LNMP环境
    centos6.5下搭建oracle 11g
  • 原文地址:https://www.cnblogs.com/kevinge/p/1549632.html
Copyright © 2011-2022 走看看