您的位置:首页 > 其它

创建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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐