您的位置:首页 > 运维架构 > Linux

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;
}
}

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: