use of com.netsteadfast.greenstep.po.hbm.TbSysCtxBean in project bamboobsc by billchen198318.
the class WebSystemCtxBeanSupportListener method processBean.
private void processBean(ServletContextEvent event, String type) {
try {
List<TbSysCtxBean> ctxBeans = this.findSysCtxBeanList(type);
for (int i = 0; ctxBeans != null && i < ctxBeans.size(); i++) {
TbSysCtxBean bean = ctxBeans.get(i);
try {
Object executerObj = Class.forName(bean.getClassName()).newInstance();
if (!(executerObj instanceof ContextInitializedAndDestroyedBean)) {
logger.warn("class not instanceof ContextInitializedAndDestroyedBean : " + bean.getClassName());
continue;
}
Method[] methods = executerObj.getClass().getMethods();
for (Method method : methods) {
if (method.getName().equals("execute")) {
try {
method.invoke(executerObj, event);
} catch (ServiceException se) {
se.printStackTrace();
logger.warn(se.getMessage().toString());
} catch (Exception e) {
e.printStackTrace();
logger.error(e.getMessage().toString());
}
}
}
} catch (ClassNotFoundException cnfe) {
cnfe.printStackTrace();
logger.error(cnfe.getMessage().toString());
}
}
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations