本文整理匯總了Java中org.eclipse.jetty.server.session.SessionHandler.getSessionManager方法的典型用法代碼示例。如果您正苦於以下問題:Java SessionHandler.getSessionManager方法的具體用法?Java SessionHandler.getSessionManager怎麽用?Java SessionHandler.getSessionManager使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jetty.server.session.SessionHandler
的用法示例。
在下文中一共展示了SessionHandler.getSessionManager方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: invalidateAll
import org.eclipse.jetty.server.session.SessionHandler; //導入方法依賴的package包/類
public void invalidateAll(String sessionId) {
synchronized (sessionsIds) {
sessionsIds.remove(sessionId);
//tell all contexts that may have a session object with this id to
//get rid of them
Handler[] contexts = server.getChildHandlersByClass(ContextHandler.class);
for (int i = 0; contexts != null && i < contexts.length; i++) {
SessionHandler sessionHandler = ((ContextHandler) contexts[i]).getChildHandlerByClass(SessionHandler.class);
if (sessionHandler != null) {
SessionManager manager = sessionHandler.getSessionManager();
if (manager != null && manager instanceof HazelcastSessionManager) {
((HazelcastSessionManager) manager).invalidateSession(sessionId);
}
}
}
}
}
示例2: renewSessionId
import org.eclipse.jetty.server.session.SessionHandler; //導入方法依賴的package包/類
@Override
public void renewSessionId(String oldClusterId, String oldNodeId, HttpServletRequest request) {
//generate a new id
String newClusterId = newSessionId(request.hashCode());
synchronized (sessionsIds) {
//remove the old one from the list
sessionsIds.remove(oldClusterId);
//add in the new session id to the list
sessionsIds.add(newClusterId);
//tell all contexts to update the id
Handler[] contexts = server.getChildHandlersByClass(ContextHandler.class);
for (int i = 0; contexts != null && i < contexts.length; i++) {
SessionHandler sessionHandler = ((ContextHandler) contexts[i]).getChildHandlerByClass(SessionHandler.class);
if (sessionHandler != null) {
SessionManager manager = sessionHandler.getSessionManager();
if (manager != null && manager instanceof HazelcastSessionManager) {
((HazelcastSessionManager) manager).
renewSessionId(oldClusterId, oldNodeId, newClusterId, getNodeId(newClusterId, request));
}
}
}
}
}
示例3: invalidateAll
import org.eclipse.jetty.server.session.SessionHandler; //導入方法依賴的package包/類
@Override
public void invalidateAll(String sessionId) {
synchronized (sessionsIds) {
sessionsIds.remove(sessionId);
//tell all contexts that may have a session object with this id to
//get rid of them
Handler[] contexts = server.getChildHandlersByClass(ContextHandler.class);
for (int i = 0; contexts != null && i < contexts.length; i++) {
SessionHandler sessionHandler = ((ContextHandler) contexts[i]).getChildHandlerByClass(SessionHandler.class);
if (sessionHandler != null) {
SessionManager manager = sessionHandler.getSessionManager();
if (manager != null && manager instanceof HazelcastSessionManager) {
((HazelcastSessionManager) manager).invalidateSession(sessionId);
}
}
}
}
}
示例4: forEachSessionManager
import org.eclipse.jetty.server.session.SessionHandler; //導入方法依賴的package包/類
private void forEachSessionManager(final SessionManagerCallback callback) {
Handler[] contexts = server.getChildHandlersByClass(ContextHandler.class);
for (int i = 0; contexts != null && i < contexts.length; i++) {
final SessionHandler sessionHandler = ((ContextHandler) contexts[i]).getChildHandlerByClass(SessionHandler.class);
if (sessionHandler != null) {
final SessionManager manager = sessionHandler.getSessionManager();
if (manager != null && manager instanceof AbstractSessionManager) {
callback.execute((AbstractSessionManager) manager);
}
}
}
}