]> WPIA git - gigi.git/blobdiff - lib/jetty/org/eclipse/jetty/io/IdleTimeout.java
updating jetty to jetty-9.2.16.v2016040
[gigi.git] / lib / jetty / org / eclipse / jetty / io / IdleTimeout.java
index 8b251ac862c92bd592400445f7408890d031d4ab..d8a6c274d82391eaa9d8de08186c1482cfc7b098 100644 (file)
@@ -1,6 +1,6 @@
 //
 //  ========================================================================
 //
 //  ========================================================================
-//  Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
+//  Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd.
 //  ------------------------------------------------------------------------
 //  All rights reserved. This program and the accompanying materials
 //  are made available under the terms of the Eclipse Public License v1.0
 //  ------------------------------------------------------------------------
 //  All rights reserved. This program and the accompanying materials
 //  are made available under the terms of the Eclipse Public License v1.0
@@ -66,6 +66,11 @@ public abstract class IdleTimeout
         return _idleTimestamp;
     }
 
         return _idleTimestamp;
     }
 
+    public long getIdleFor()
+    {
+        return System.currentTimeMillis() - getIdleTimestamp();
+    }
+
     public long getIdleTimeout()
     {
         return _idleTimeout;
     public long getIdleTimeout()
     {
         return _idleTimeout;
@@ -142,13 +147,15 @@ public abstract class IdleTimeout
             long idleElapsed = System.currentTimeMillis() - idleTimestamp;
             long idleLeft = idleTimeout - idleElapsed;
 
             long idleElapsed = System.currentTimeMillis() - idleTimestamp;
             long idleLeft = idleTimeout - idleElapsed;
 
-            LOG.debug("{} idle timeout check, elapsed: {} ms, remaining: {} ms", this, idleElapsed, idleLeft);
+            if (LOG.isDebugEnabled())
+                LOG.debug("{} idle timeout check, elapsed: {} ms, remaining: {} ms", this, idleElapsed, idleLeft);
 
             if (idleTimestamp != 0 && idleTimeout > 0)
             {
                 if (idleLeft <= 0)
                 {
 
             if (idleTimestamp != 0 && idleTimeout > 0)
             {
                 if (idleLeft <= 0)
                 {
-                    LOG.debug("{} idle timeout expired", this);
+                    if (LOG.isDebugEnabled())
+                        LOG.debug("{} idle timeout expired", this);
                     try
                     {
                         onIdleExpired(new TimeoutException("Idle timeout expired: " + idleElapsed + "/" + idleTimeout + " ms"));
                     try
                     {
                         onIdleExpired(new TimeoutException("Idle timeout expired: " + idleElapsed + "/" + idleTimeout + " ms"));