创建classic 得到函数 调用函数
2009-08-19 10:50
302 查看
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;
}
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;
}
相关文章推荐
- 如果改变了形参数组的值 从而在调用函数期间 形参数组就和实参数组共占同一段内存单元 为什么形参数组从实参数组那里得到起始地址后 请问各位C语言高手:当用数组名作函数参数时 也就该变了实参数组的值
- 1、通过函数实现打印*号组成的直角三角形,函数要求传入行数即可。在main 方法中,通过用户输入得到行数,然后调用函数做打印。 三角形样式: * ** *** **** ***** ******
- 得到扩展名,得到验证码的函数,创建表格
- MYSQL创建一个 “将一个字符串以某个分隔符分隔得到多个值” 的函数,并为多个值加上序号
- Sessions, Window Stations and Desktops(GetDesktopWindow函数得到的桌面句柄, 是Csrss.exe创建的一个窗口)
- Sessions, Window Stations and Desktops(GetDesktopWindow函数得到的桌面句柄, 是Csrss.exe创建的一个窗口)
- 创建能够记住其状态的函数
- Linux中临时文件创建函数mkstemp的用法
- Js函数的三种创建、四种调用
- 第6章创建函数-----------(向函数传递数组、从函数返回数组)
- 创建一个模块calculator.py,完成任意两个数的加(add)、减(sub)、乘(mult)、除(div)运算;导入该模块,分别调用其中的函数,完成如下操作: 1、25+56 2、86-68 3
- 【程序39】 题目:编写一个函数,输入n为偶数时,调用函数 求1/2+1/4+...+1/n,当输入n为奇数时,调用函数 1/1+1/3+...+1/n
- Sql得到(去除)字符串中所有汉字,字母,数字的函数
- 实现一个函数,对一个正整数n,算得到1需要的最少操作次数?
- MySQL 开启bin-log,创建函数出错。DETERMINISTIC
- onsubmit及调用函数实现函数校验(33)
- Linux 内核--fork()函数创建进程 (续)之copy_mem(int nr, struct task_struct *p)
- 自已写的js函数,用来通过传入年月(字符串,如‘201007’)得到前一个月的年月
- 函数的调用过程,栈帧的创建和销毁
- Oracle中如何导出存储过程、函数、包和触发器的定义语句?如何导出表的结构?如何导出索引的创建语句?