【Java开源代码栏目提醒】:网学会员,鉴于大家对Java开源代码十分关注,论文会员在此为大家搜集整理了“ClientContextMgr.java”一文,供大家参考学习!
package com.cownew.PIS.framework.client;
import java.util.Date;
import com.cownew.PIS.base.permission.common.UserInfo;
import com.cownew.PIS.framework.common.services.ICommonService;
import com.cownew.ctk.common.DateUtils;
public class ClientContextMgr
{
private static UserInfo curUserInfo;
/**
* 得到当前登录用户
*
* @return
* @
*/
public static UserInfo getCurrencyUser()
{
if (curUserInfo == null)
{
ICommonService cs = (ICommonService) RemoteServiceLocator
.getRemoteService(ICommonService.class);
curUserInfo = cs.getCurrentUser();
}
return curUserInfo;
}
/**
* 得到当前服务器时间,java.util.Date类型,(不精确,网络延时会造成误差,因此不能用于关键性应用)
*
* @return
* @
*/
public static Date getServerNow()
{
ICommonService cs = (ICommonService) RemoteServiceLocator
.getRemoteService(ICommonService.class);
return cs.now();
}
/**
* @see getServerNow,返回值是java.sql.Date类型
* @return
* @
*/
public static java.sql.Date getServerSQLNow()
{
return DateUtils.getSQLDate(getServerNow());
}
}