Mercurial Hosting > luan
comparison src/org/eclipse/jetty/io/AbstractConnection.java @ 820:8e9db0bbf4f9
remove org.eclipse.jetty.util.log and upgrade slf4j
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Tue, 13 Sep 2016 23:13:06 -0600 |
| parents | 3428c60d7cfc |
| children | 4d9fe9cc554d |
comparison
equal
deleted
inserted
replaced
| 819:17bd0b170ed6 | 820:8e9db0bbf4f9 |
|---|---|
| 18 | 18 |
| 19 package org.eclipse.jetty.io; | 19 package org.eclipse.jetty.io; |
| 20 | 20 |
| 21 import java.io.IOException; | 21 import java.io.IOException; |
| 22 | 22 |
| 23 import org.eclipse.jetty.util.log.Log; | 23 import org.slf4j.Logger; |
| 24 import org.eclipse.jetty.util.log.Logger; | 24 import org.slf4j.LoggerFactory; |
| 25 | 25 |
| 26 | 26 |
| 27 public abstract class AbstractConnection implements Connection | 27 public abstract class AbstractConnection implements Connection |
| 28 { | 28 { |
| 29 private static final Logger LOG = Log.getLogger(AbstractConnection.class); | 29 private static final Logger LOG = LoggerFactory.getLogger(AbstractConnection.class); |
| 30 | 30 |
| 31 private final long _timeStamp; | 31 private final long _timeStamp; |
| 32 protected final EndPoint _endp; | 32 protected final EndPoint _endp; |
| 33 | 33 |
| 34 public AbstractConnection(EndPoint endp) | 34 public AbstractConnection(EndPoint endp) |
| 35 { | 35 { |
| 36 _endp=(EndPoint)endp; | 36 _endp=(EndPoint)endp; |
| 37 _timeStamp = System.currentTimeMillis(); | 37 _timeStamp = System.currentTimeMillis(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 public AbstractConnection(EndPoint endp,long timestamp) | 40 public AbstractConnection(EndPoint endp,long timestamp) |
| 41 { | 41 { |
| 42 _endp=(EndPoint)endp; | 42 _endp=(EndPoint)endp; |
| 43 _timeStamp = timestamp; | 43 _timeStamp = timestamp; |
| 44 } | 44 } |
| 45 | 45 |
| 46 public long getTimeStamp() | 46 public long getTimeStamp() |
| 47 { | 47 { |
| 48 return _timeStamp; | 48 return _timeStamp; |
| 49 } | 49 } |
| 50 | 50 |
| 51 public EndPoint getEndPoint() | 51 public EndPoint getEndPoint() |
| 52 { | 52 { |
| 53 return _endp; | 53 return _endp; |
| 54 } | 54 } |
| 55 | 55 |
| 56 public void onIdleExpired(long idleForMs) | 56 public void onIdleExpired(long idleForMs) |
| 57 { | 57 { |
| 58 try | 58 try |
| 59 { | 59 { |
| 60 LOG.debug("onIdleExpired {}ms {} {}",idleForMs,this,_endp); | 60 LOG.debug("onIdleExpired {}ms {} {}",idleForMs,this,_endp); |
| 61 if (_endp.isInputShutdown() || _endp.isOutputShutdown()) | 61 if (_endp.isInputShutdown() || _endp.isOutputShutdown()) |
| 62 _endp.close(); | 62 _endp.close(); |
| 63 else | 63 else |
| 64 _endp.shutdownOutput(); | 64 _endp.shutdownOutput(); |
| 65 } | 65 } |
| 66 catch(IOException e) | 66 catch(IOException e) |
| 67 { | 67 { |
| 68 LOG.ignore(e); | 68 LOG.trace("",e); |
| 69 | 69 |
| 70 try | 70 try |
| 71 { | 71 { |
| 72 _endp.close(); | 72 _endp.close(); |
| 73 } | 73 } |
| 74 catch(IOException e2) | 74 catch(IOException e2) |
| 75 { | 75 { |
| 76 LOG.ignore(e2); | 76 LOG.trace("",e2); |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 | 80 |
| 81 public String toString() | 81 public String toString() |
| 82 { | 82 { |
| 83 return String.format("%s@%x", getClass().getSimpleName(), hashCode()); | 83 return String.format("%s@%x", getClass().getSimpleName(), hashCode()); |
| 84 } | 84 } |
| 85 } | 85 } |
