()
| 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() { |
no test coverage detected