/**
* 获取后台的服务接口
* @param bundle Bundle名
* @param service 服务名称
* @return Object 服务接口
*/
protected Object getBundleService(String bundle, String service)
{
ServiceContext context = ServiceContext.getInstance();
User currentUser = (User) this.getSession()
.getAttribute(UserConstant.CURRENT_USER_SESSION);
Locale locale = (Locale) this.getSession()
.getAttribute("WW_TRANS_I18N_LOCALE");
// 获取后台服务
Map<String, Object> map = new HashMap<String, Object>();
map.put(ServiceContext.KEY_CONTEXT_USER, currentUser);
map.put(ServiceContext.KEY_CONTEXT_LOCALIZE, locale);
Object obj = context.lookup(bundle + "/" + service, map);
if (obj == null)
{
String[] parStrArr = new String[1];
parStrArr[0] = this.getText("lego.dic.module." + bundle);
LegoCheckedException le = new LegoCheckedException(CONERR,
parStrArr);
log.error("getBundleService error :" + bundle + "/" + service,
le,
ModuleDefine.MODULE_LEGO_FE);
throw le;
}
return obj;
}
* 获取后台的服务接口
* @param bundle Bundle名
* @param service 服务名称
* @return Object 服务接口
*/
protected Object getBundleService(String bundle, String service)
{
ServiceContext context = ServiceContext.getInstance();
User currentUser = (User) this.getSession()
.getAttribute(UserConstant.CURRENT_USER_SESSION);
Locale locale = (Locale) this.getSession()
.getAttribute("WW_TRANS_I18N_LOCALE");
// 获取后台服务
Map<String, Object> map = new HashMap<String, Object>();
map.put(ServiceContext.KEY_CONTEXT_USER, currentUser);
map.put(ServiceContext.KEY_CONTEXT_LOCALIZE, locale);
Object obj = context.lookup(bundle + "/" + service, map);
if (obj == null)
{
String[] parStrArr = new String[1];
parStrArr[0] = this.getText("lego.dic.module." + bundle);
LegoCheckedException le = new LegoCheckedException(CONERR,
parStrArr);
log.error("getBundleService error :" + bundle + "/" + service,
le,
ModuleDefine.MODULE_LEGO_FE);
throw le;
}
return obj;
}