本文整理汇总了Java中org.apache.catalina.Session.getIdInternal方法的典型用法代码示例。如果您正苦于以下问题:Java Session.getIdInternal方法的具体用法?Java Session.getIdInternal怎么用?Java Session.getIdInternal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.Session
的用法示例。
在下文中一共展示了Session.getIdInternal方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: remove
import org.apache.catalina.Session; //导入方法依赖的package包/类
@Override
public void remove(Session session, boolean update) {
// If the session has expired - as opposed to just being removed from
// the manager because it is being persisted - update the expired stats
if (update) {
long timeNow = System.currentTimeMillis();
int timeAlive =
(int) (timeNow - session.getCreationTimeInternal())/1000;
updateSessionMaxAliveTime(timeAlive);
expiredSessions.incrementAndGet();
SessionTiming timing = new SessionTiming(timeNow, timeAlive);
synchronized (sessionExpirationTiming) {
sessionExpirationTiming.add(timing);
sessionExpirationTiming.poll();
}
}
if (session.getIdInternal() != null) {
sessions.remove(session.getIdInternal());
}
}
示例2: remove
import org.apache.catalina.Session; //导入方法依赖的package包/类
@Override
public void remove(Session session, boolean update) {
// If the session has expired - as opposed to just being removed from
// the manager because it is being persisted - update the expired stats
if (update) {
long timeNow = System.currentTimeMillis();
int timeAlive = (int) (timeNow - session.getCreationTimeInternal()) / 1000;
updateSessionMaxAliveTime(timeAlive);
expiredSessions.incrementAndGet();
SessionTiming timing = new SessionTiming(timeNow, timeAlive);
synchronized (sessionExpirationTiming) {
sessionExpirationTiming.add(timing);
sessionExpirationTiming.poll();
}
}
if (session.getIdInternal() != null) {
sessions.remove(session.getIdInternal());
}
}
示例3: sendMessage
import org.apache.catalina.Session; //导入方法依赖的package包/类
/**
* Send message delta message from request session
* @param session current session
* @param manager session manager
* @param cluster replication cluster
*/
protected void sendMessage(Session session,
ClusterManager manager, CatalinaCluster cluster) {
String id = session.getIdInternal();
if (id != null) {
send(manager, cluster, id);
}
}
示例4: findSession
import org.apache.catalina.Session; //导入方法依赖的package包/类
/**
* {@inheritDoc}
* <p>
* This method checks the persistence store if persistence is enabled,
* otherwise just uses the functionality from ManagerBase.
*/
@Override
public Session findSession(String id) throws IOException {
Session session = super.findSession(id);
// OK, at this point, we're not sure if another thread is trying to
// remove the session or not so the only way around this is to lock it
// (or attempt to) and then try to get it by this session id again. If
// the other code ran swapOut, then we should get a null back during
// this run, and if not, we lock it out so we can access the session
// safely.
if(session != null) {
synchronized(session){
session = super.findSession(session.getIdInternal());
if(session != null){
// To keep any external calling code from messing up the
// concurrency.
session.access();
session.endAccess();
}
}
}
if (session != null)
return session;
// See if the Session is in the Store
session = swapIn(id);
return session;
}
示例5: changeSessionId
import org.apache.catalina.Session; //导入方法依赖的package包/类
@Override
public void changeSessionId(Session session) {
String oldId = session.getIdInternal();
session.setId(generateSessionId(), false);
String newId = session.getIdInternal();
container.fireContainerEvent(Context.CHANGE_SESSION_ID_EVENT,
new String[] {oldId, newId});
}
示例6: findSession
import org.apache.catalina.Session; //导入方法依赖的package包/类
/**
* Return the active Session, associated with this Manager, with the
* specified session id (if any); otherwise return <code>null</code>.
* This method checks the persistence store if persistence is enabled,
* otherwise just uses the functionality from ManagerBase.
*
* @param id The session id for the session to be returned
*
* @exception IllegalStateException if a new session cannot be
* instantiated for any reason
* @exception IOException if an input/output error occurs while
* processing this request
*/
public Session findSession(String id) throws IOException {
Session session = super.findSession(id);
// OK, at this point, we're not sure if another thread is trying to
// remove the session or not so the only way around this is to lock it
// (or attempt to) and then try to get it by this session id again. If
// the other code ran swapOut, then we should get a null back during
// this run, and if not, we lock it out so we can access the session
// safely.
if(session != null) {
synchronized(session){
session = super.findSession(session.getIdInternal());
if(session != null){
// To keep any external calling code from messing up the
// concurrency.
session.access();
session.endAccess();
}
}
}
if (session != null)
return (session);
// See if the Session is in the Store
session = swapIn(id);
return (session);
}
示例7: findSession
import org.apache.catalina.Session; //导入方法依赖的package包/类
/**
* {@inheritDoc}
* <p>
* This method checks the persistence store if persistence is enabled,
* otherwise just uses the functionality from ManagerBase.
*/
@Override
public Session findSession(String id) throws IOException {
Session session = super.findSession(id);
// OK, at this point, we're not sure if another thread is trying to
// remove the session or not so the only way around this is to lock it
// (or attempt to) and then try to get it by this session id again. If
// the other code ran swapOut, then we should get a null back during
// this run, and if not, we lock it out so we can access the session
// safely.
if (session != null) {
synchronized (session) {
session = super.findSession(session.getIdInternal());
if (session != null) {
// To keep any external calling code from messing up the
// concurrency.
session.access();
session.endAccess();
}
}
}
if (session != null)
return session;
// See if the Session is in the Store
session = swapIn(id);
return session;
}
示例8: changeSessionId
import org.apache.catalina.Session; //导入方法依赖的package包/类
@Override
public void changeSessionId(Session session) {
String oldId = session.getIdInternal();
session.setId(generateSessionId(), false);
String newId = session.getIdInternal();
container.fireContainerEvent(Context.CHANGE_SESSION_ID_EVENT, new String[] { oldId, newId });
}
示例9: sendMessage
import org.apache.catalina.Session; //导入方法依赖的package包/类
/**
* Send message delta message from request session
*
* @param session
* current session
* @param manager
* session manager
* @param cluster
* replication cluster
*/
protected void sendMessage(Session session, ClusterManager manager, CatalinaCluster cluster) {
String id = session.getIdInternal();
if (id != null) {
send(manager, cluster, id);
}
}