MCPcopy Create free account
hub / github.com/apache/tomcat / isValid

Method isValid

java/org/apache/catalina/ha/session/DeltaSession.java:398–427  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

396 }
397
398 @Override
399 public boolean isValid() {
400 if (!this.isValid) {
401 return false;
402 }
403 if (this.expiring) {
404 return true;
405 }
406 if (activityCheck && accessCount.get() > 0) {
407 return true;
408 }
409 if (maxInactiveInterval > 0) {
410 int timeIdle = (int) (getIdleTimeInternal() / 1000L);
411 if (isPrimarySession()) {
412 if (timeIdle >= maxInactiveInterval) {
413 expire(true);
414 }
415 } else {
416 if (timeIdle >= (2 * maxInactiveInterval)) {
417 // if the session has been idle twice as long as allowed,
418 // the primary session has probably crashed, and no other
419 // requests are coming in. that is why we do this. otherwise
420 // we would have a memory leak
421 expire(true, false);
422 }
423 }
424 }
425
426 return this.isValid;
427 }
428
429 @Override
430 public void endAccess() {

Callers 2

removeAttributeMethod · 0.95
stopInternalMethod · 0.95

Calls 4

isPrimarySessionMethod · 0.95
expireMethod · 0.95
getMethod · 0.65
getIdleTimeInternalMethod · 0.65

Tested by

no test coverage detected