本文整理汇总了Java中org.apache.catalina.Session.expire方法的典型用法代码示例。如果您正苦于以下问题:Java Session.expire方法的具体用法?Java Session.expire怎么用?Java Session.expire使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.Session
的用法示例。
在下文中一共展示了Session.expire方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: expireSession
import org.apache.catalina.Session; //导入方法依赖的package包/类
public void expireSession( String sessionId ) {
Session s=sessions.get(sessionId);
if( s==null ) {
if(log.isInfoEnabled())
log.info("Session not found " + sessionId);
return;
}
s.expire();
}
示例2: expire
import org.apache.catalina.Session; //导入方法依赖的package包/类
private void expire(SingleSignOnSessionKey key) {
if (engine == null) {
containerLog.warn(sm.getString("singleSignOn.sessionExpire.engineNull", key));
return;
}
Container host = engine.findChild(key.getHostName());
if (host == null) {
containerLog.warn(sm.getString("singleSignOn.sessionExpire.hostNotFound", key));
return;
}
Context context = (Context) host.findChild(key.getContextName());
if (context == null) {
containerLog.warn(sm.getString("singleSignOn.sessionExpire.contextNotFound", key));
return;
}
Manager manager = context.getManager();
if (manager == null) {
containerLog.warn(sm.getString("singleSignOn.sessionExpire.managerNotFound", key));
return;
}
Session session = null;
try {
session = manager.findSession(key.getSessionId());
} catch (IOException e) {
containerLog.warn(sm.getString("singleSignOn.sessionExpire.managerError", key), e);
return;
}
if (session == null) {
containerLog.warn(sm.getString("singleSignOn.sessionExpire.sessionNotFound", key));
return;
}
session.expire();
}
示例3: run
import org.apache.catalina.Session; //导入方法依赖的package包/类
@Override
public void run() {
for (int i = 0; i < count; i++) {
Session session = mgr.createSession(mgr.generateSessionId());
session.expire();
}
}
示例4: expireSession
import org.apache.catalina.Session; //导入方法依赖的package包/类
public void expireSession( String sessionId ) {
Session s=(Session)sessions.get(sessionId);
if( s==null ) {
if(log.isInfoEnabled())
log.info("Session not found " + sessionId);
return;
}
s.expire();
}
示例5: swapIn
import org.apache.catalina.Session; //导入方法依赖的package包/类
/**
* Look for a session in the Store and, if found, restore
* it in the Manager's list of active sessions if appropriate.
* The session will be removed from the Store after swapping
* in, but will not be added to the active session list if it
* is invalid or past its expiration.
*/
protected Session swapIn(String id) throws IOException {
if (store == null)
return null;
Session session = null;
try {
session = store.load(id);
} catch (ClassNotFoundException e) {
log(sm.getString("persistentManager.deserializeError", id, e));
throw new IllegalStateException
(sm.getString("persistentManager.deserializeError", id, e));
}
if (session == null)
return (null);
if (!session.isValid()
|| isSessionStale(session, System.currentTimeMillis())) {
log("session swapped in is invalid or expired");
session.expire();
store.remove(id);
return (null);
}
if(debug > 2)
log(sm.getString("persistentManager.swapIn", id));
session.setManager(this);
add(session);
((StandardSession)session).activate();
return (session);
}
示例6: expireSession
import org.apache.catalina.Session; //导入方法依赖的package包/类
public void expireSession(String sessionId) {
Session s = sessions.get(sessionId);
if (s == null) {
if (log.isInfoEnabled())
log.info("Session not found " + sessionId);
return;
}
s.expire();
}
示例7: expire
import org.apache.catalina.Session; //导入方法依赖的package包/类
private void expire(SingleSignOnSessionKey key) {
if (engine == null) {
containerLog.warn(sm.getString("singleSignOn.sessionExpire.engineNull", key));
return;
}
Container host = engine.findChild(key.getHostName());
if (host == null) {
containerLog.warn(sm.getString("singleSignOn.sessionExpire.hostNotFound", key));
return;
}
Context context = (Context) host.findChild(key.getContextName());
if (context == null) {
containerLog.warn(sm.getString("singleSignOn.sessionExpire.contextNotFound", key));
return;
}
Manager manager = context.getManager();
if (manager == null) {
containerLog.warn(sm.getString("singleSignOn.sessionExpire.managerNotFound", key));
return;
}
Session session = null;
try {
session = manager.findSession(key.getSessionId());
} catch (IOException e) {
containerLog.warn(sm.getString("singleSignOn.sessionExpire.managerError", key), e);
return;
}
if (session == null) {
containerLog.warn(sm.getString("singleSignOn.sessionExpire.sessionNotFound", key));
return;
}
session.expire();
}