Sun GlassFish Communications Server 2.0 发行说明

getLastAccessedTime 方法不能提供准确的结果(问题 1351)

说明

SIP 会话的 getLastAccessedTime 方法不能提供准确的结果。

解决方法

需要准确跟踪 lastAccessedTime 的应用程序必须自行将其存储到 SipApplicationSession 中。

synchronized (sas) {
	Long last = (Long) sas.getAttribute("myLastAccessedTime");
	if (last == null) {last = 0};
	// do something with the last one
	// and...
	// set the new one.
	sas.setAttribute("myLastAccessedTime", System.currentTimeMillis());
}