linux命令-touch
2016-01-29 11:34
483 查看
package service; public interface IService { Object call(String serviceid, Object... params) throws Exception; }
package service; import java.lang.reflect.InvocationTargetException; import org.apache.commons.beanutils.MethodUtils; import org.apache.commons.lang.StringUtils; public class Service implements IService { public Object call(String serviceid, Object... params) { String className = StringUtils.substringBeforeLast(serviceid, "."); String methodName = StringUtils.substringAfterLast(serviceid, "."); Object ret = null; try { ClassLoader clsLoader = Thread.currentThread() .getContextClassLoader(); ret = MethodUtils.invokeMethod(clsLoader.loadClass(className) .newInstance(), methodName, params); } catch(ClassNotFoundException e1) { throw new RuntimeException("=====业务接口未定义====="); } catch(InstantiationException e1) { throw new RuntimeException(e1.getMessage()); } catch(IllegalAccessException e1) { throw new RuntimeException("=====非法访问业务接口====="); } catch(InvocationTargetException e1) { throw new RuntimeException(e1.getMessage()); } catch(NoSuchMethodException e1) { throw new RuntimeException("=====业务接口方法未定义====="); } return ret; } }
相关文章推荐
- Linux如何实现开机启动程序详解
- Linux内核驱动加载过程
- linux后台进程管理工具supervisor
- kali linux下安装wingide
- Linux学习笔记--mkdir命令(建立目录)
- linux下mysql数据的导出和导
- 查看linux占用内存/CPU最多的进程
- linux支持中文
- CentOS6.5下openssl加密解密及CA自签颁发证书详解
- Linux 关机和重启命令
- Linux下查看CPU型号,内存大小,硬盘空间命令
- linux命令-mkdir
- Linux软连接和硬链接
- linux tar.xz文件解压
- centos6.5 Confluence5.1 最新版的安装&破解&汉化
- 安装kali linux
- linux命令-cp
- Linux 内核启动过程
- rsync 数据同步
- Centos 下源码安装MySQL