本文整理汇总了Java中org.apache.catalina.Session.getThisAccessedTime方法的典型用法代码示例。如果您正苦于以下问题:Java Session.getThisAccessedTime方法的具体用法?Java Session.getThisAccessedTime怎么用?Java Session.getThisAccessedTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.Session
的用法示例。
在下文中一共展示了Session.getThisAccessedTime方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isSessionStale
import org.apache.catalina.Session; //导入方法依赖的package包/类
/**
* Indicate whether the session has been idle for longer
* than its expiration date as of the supplied time.
*
* FIXME: Probably belongs in the Session class.
*/
protected boolean isSessionStale(Session session, long timeNow) {
if (session != null) {
int maxInactiveInterval = session.getMaxInactiveInterval();
if (maxInactiveInterval >= 0) {
int timeIdle = // Truncate, do not round up
(int) ((timeNow - session.getThisAccessedTime()) / 1000L);
if (timeIdle >= maxInactiveInterval) {
return true;
}
}
}
return false;
}
示例2: isSessionStale
import org.apache.catalina.Session; //导入方法依赖的package包/类
/**
* Indicate whether the session has been idle for longer than its expiration
* date as of the supplied time.
*
* FIXME: Probably belongs in the Session class.
*/
protected boolean isSessionStale(Session session, long timeNow) {
if (session != null) {
int maxInactiveInterval = session.getMaxInactiveInterval();
if (maxInactiveInterval >= 0) {
int timeIdle = // Truncate, do not round up
(int) ((timeNow - session.getThisAccessedTime()) / 1000L);
if (timeIdle >= maxInactiveInterval) {
return true;
}
}
}
return false;
}
示例3: getUsedTimeForSession
import org.apache.catalina.Session; //导入方法依赖的package包/类
public static long getUsedTimeForSession(Session in_session) {
try {
long diffMilliSeconds = in_session.getThisAccessedTime() - in_session.getCreationTime();
return diffMilliSeconds;
} catch (IllegalStateException ise) {
//ignore: invalidated session
return -1;
}
}
示例4: getTTLForSession
import org.apache.catalina.Session; //导入方法依赖的package包/类
public static long getTTLForSession(Session in_session) {
try {
long diffMilliSeconds = (1000*in_session.getMaxInactiveInterval()) - (System.currentTimeMillis() - in_session.getThisAccessedTime());
return diffMilliSeconds;
} catch (IllegalStateException ise) {
//ignore: invalidated session
return -1;
}
}
示例5: getInactiveTimeForSession
import org.apache.catalina.Session; //导入方法依赖的package包/类
public static long getInactiveTimeForSession(Session in_session) {
try {
long diffMilliSeconds = System.currentTimeMillis() - in_session.getThisAccessedTime();
return diffMilliSeconds;
} catch (IllegalStateException ise) {
//ignore: invalidated session
return -1;
}
}
示例6: getUsedTimeForSession
import org.apache.catalina.Session; //导入方法依赖的package包/类
public static long getUsedTimeForSession(Session in_session) {
try {
long diffMilliSeconds = in_session.getThisAccessedTime() - in_session.getCreationTime();
return diffMilliSeconds;
} catch (IllegalStateException ise) {
// ignore: invalidated session
return -1;
}
}
示例7: getTTLForSession
import org.apache.catalina.Session; //导入方法依赖的package包/类
public static long getTTLForSession(Session in_session) {
try {
long diffMilliSeconds = (1000 * in_session.getMaxInactiveInterval())
- (System.currentTimeMillis() - in_session.getThisAccessedTime());
return diffMilliSeconds;
} catch (IllegalStateException ise) {
// ignore: invalidated session
return -1;
}
}
示例8: getInactiveTimeForSession
import org.apache.catalina.Session; //导入方法依赖的package包/类
public static long getInactiveTimeForSession(Session in_session) {
try {
long diffMilliSeconds = System.currentTimeMillis() - in_session.getThisAccessedTime();
return diffMilliSeconds;
} catch (IllegalStateException ise) {
// ignore: invalidated session
return -1;
}
}
示例9: getThisAccessedTimestamp
import org.apache.catalina.Session; //导入方法依赖的package包/类
public long getThisAccessedTimestamp( String sessionId ) {
Session s=sessions.get(sessionId);
if(s== null)
return -1 ;
return s.getThisAccessedTime();
}
示例10: getThisAccessedTimestamp
import org.apache.catalina.Session; //导入方法依赖的package包/类
public long getThisAccessedTimestamp(String sessionId) {
Session s = sessions.get(sessionId);
if (s == null)
return -1;
return s.getThisAccessedTime();
}