use of org.wildfly.clustering.web.cache.session.ValidSession in project wildfly by wildfly.
the class HotRodSessionManager method findSession.
@Override
public Session<LC> findSession(String id) {
Map.Entry<MV, AV> entry = this.factory.findValue(id);
if (entry == null) {
Logger.ROOT_LOGGER.tracef("Session %s not found", id);
return null;
}
ImmutableSession session = this.factory.createImmutableSession(id, entry);
if (session.getMetaData().isExpired()) {
Logger.ROOT_LOGGER.tracef("Session %s was found, but has expired", id);
this.expirationListener.sessionExpired(session);
this.factory.remove(id);
return null;
}
return new ValidSession<>(this.factory.createSession(id, entry, this.context), this.closeTask);
}
use of org.wildfly.clustering.web.cache.session.ValidSession in project wildfly by wildfly.
the class InfinispanSessionManager method findSession.
@Override
public Session<LC> findSession(String id) {
Map.Entry<MV, AV> value = this.factory.findValue(id);
if (value == null) {
InfinispanWebLogger.ROOT_LOGGER.tracef("Session %s not found", id);
return null;
}
ImmutableSession session = this.factory.createImmutableSession(id, value);
if (session.getMetaData().isExpired()) {
InfinispanWebLogger.ROOT_LOGGER.tracef("Session %s was found, but has expired", id);
this.expirationListener.sessionExpired(session);
this.factory.remove(id);
return null;
}
this.expirationScheduler.cancel(id);
return new ValidSession<>(this.factory.createSession(id, value, this.context), this.closeTask);
}
Aggregations