Search in sources :

Example 56 with Session

use of org.apache.catalina.Session in project Payara by payara.

the class PESessionLocker method getSession.

private Session getSession(ServletRequest request) {
    javax.servlet.http.HttpServletRequest httpReq = (javax.servlet.http.HttpServletRequest) request;
    javax.servlet.http.HttpSession httpSess = httpReq.getSession(false);
    if (httpSess == null) {
        return null;
    }
    String id = httpSess.getId();
    Manager mgr = _context.getManager();
    Session sess = null;
    try {
        sess = mgr.findSession(id);
    } catch (java.io.IOException ex) {
    }
    return sess;
}
Also used : Manager(org.apache.catalina.Manager) Session(org.apache.catalina.Session) StandardSession(org.apache.catalina.session.StandardSession)

Example 57 with Session

use of org.apache.catalina.Session in project Payara by payara.

the class ReplicationManagerBase method removeSessionFromManagerCache.

public void removeSessionFromManagerCache(Session session) {
    if (_logger.isLoggable(Level.FINE)) {
        _logger.fine("in " + this.getClass().getName() + ">>removeSessionFromManagerCache:session = " + session);
    }
    if (session == null) {
        return;
    }
    Session removed = null;
    removed = sessions.remove(session.getIdInternal());
    if (removed != null && _logger.isLoggable(Level.FINE)) {
        _logger.fine("Remove from manager cache id=" + session.getId());
    }
}
Also used : Session(org.apache.catalina.Session)

Example 58 with Session

use of org.apache.catalina.Session in project Payara by payara.

the class ReplicationStore method loadFromBackingStore.

private Session loadFromBackingStore(String id, String version) throws IOException, ClassNotFoundException, BackingStoreException {
    SimpleMetadata metaData = getSimpleMetadataBackingStore().load(id, version);
    if (_logger.isLoggable(Level.FINEST)) {
        _logger.finest("ReplicationStore>>loadFromBackingStore:id=" + id + ", metaData=" + metaData);
    }
    Session session = getSession(metaData);
    if (_logger.isLoggable(Level.FINEST)) {
        _logger.finest("ReplicationStore->Session is " + session);
    }
    return session;
}
Also used : SimpleMetadata(org.glassfish.ha.store.util.SimpleMetadata) Session(org.apache.catalina.Session)

Aggregations

Session (org.apache.catalina.Session)58 HttpSession (javax.servlet.http.HttpSession)17 Manager (org.apache.catalina.Manager)16 IOException (java.io.IOException)13 StandardSession (org.apache.catalina.session.StandardSession)8 HttpServletRequest (javax.servlet.http.HttpServletRequest)7 Context (org.apache.catalina.Context)7 StringManager (org.apache.tomcat.util.res.StringManager)7 StandardContext (org.apache.catalina.core.StandardContext)5 Principal (java.security.Principal)3 Container (org.apache.catalina.Container)3 LifecycleException (org.apache.catalina.LifecycleException)3 Realm (org.apache.catalina.Realm)3 File (java.io.File)2 ArrayList (java.util.ArrayList)2 ServletContext (javax.servlet.ServletContext)2 ServletRequest (javax.servlet.ServletRequest)2 Cookie (javax.servlet.http.Cookie)2 HttpServletResponse (javax.servlet.http.HttpServletResponse)2 Loader (org.apache.catalina.Loader)2