|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RecordReaper | Line # 17 | 9 | 0% | 10 | 9 | 57.1% |
0.5714286
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (21) | |||
| Result | |||
|
0.5714286
|
javax.jmdns.test.JmDNSTest.testUnregisterService
javax.jmdns.test.JmDNSTest.testUnregisterService
|
1 PASS | |
|
0.5714286
|
javax.jmdns.test.TextUpdateTest.testSubtype
javax.jmdns.test.TextUpdateTest.testSubtype
|
1 PASS | |
|
0.5714286
|
javax.jmdns.test.TextUpdateTest.testListenForTextUpdateOnOtherRegistry
javax.jmdns.test.TextUpdateTest.testListenForTextUpdateOnOtherRegistry
|
1 PASS | |
|
0.5714286
|
javax.jmdns.test.TextUpdateTest.testRegisterCaseSensitiveField
javax.jmdns.test.TextUpdateTest.testRegisterCaseSensitiveField
|
1 PASS | |
|
0.5714286
|
javax.jmdns.test.JmDNSTest.testUnregisterAndReregisterService
javax.jmdns.test.JmDNSTest.testUnregisterAndReregisterService
|
1 PASS | |
|
0.5714286
|
javax.jmdns.test.JmDNSTest.testWaitAndQueryForServiceOnOtherRegistry
javax.jmdns.test.JmDNSTest.testWaitAndQueryForServiceOnOtherRegistry
|
1 PASS | |
|
0.5714286
|
javax.jmdns.test.JmDNSTest.testListMyServiceWithToLowerCase
javax.jmdns.test.JmDNSTest.testListMyServiceWithToLowerCase
|
1 PASS | |
|
0.5714286
|
javax.jmdns.test.JmDNSTest.testListMyService
javax.jmdns.test.JmDNSTest.testListMyService
|
1 PASS | |
|
0.5714286
|
javax.jmdns.test.TextUpdateTest.testRenewExpiringRequests
javax.jmdns.test.TextUpdateTest.testRenewExpiringRequests
|
1 PASS | |
|
0.5714286
|
javax.jmdns.test.JmDNSTest.testListMyServiceWithoutLowerCase
javax.jmdns.test.JmDNSTest.testListMyServiceWithoutLowerCase
|
1 PASS | |
|
0.5714286
|
javax.jmdns.test.TextUpdateTest.testRegisterEmptyTXTField
javax.jmdns.test.TextUpdateTest.testRegisterEmptyTXTField
|
1 PASS | |
|
0.5714286
|
javax.jmdns.test.JmDNSTest.testListenForMyServiceAndList
javax.jmdns.test.JmDNSTest.testListenForMyServiceAndList
|
1 PASS | |
|
0.5714286
|
javax.jmdns.test.JmDNSTest.testListMyServiceIPV6
javax.jmdns.test.JmDNSTest.testListMyServiceIPV6
|
1 PASS | |
|
0.5714286
|
javax.jmdns.test.JmDNSTest.testRegisterAndListServiceOnOtherRegistry
javax.jmdns.test.JmDNSTest.testRegisterAndListServiceOnOtherRegistry
|
1 PASS | |
|
0.5714286
|
javax.jmdns.test.JmDNSTest.testListenForServiceOnOtherRegistry
javax.jmdns.test.JmDNSTest.testListenForServiceOnOtherRegistry
|
1 PASS | |
|
0.2857143
|
javax.jmdns.test.JmDNSTest.testCreate
javax.jmdns.test.JmDNSTest.testCreate
|
1 PASS | |
|
0.2857143
|
javax.jmdns.test.JmDNSTest.testRegisterServiceTwice
javax.jmdns.test.JmDNSTest.testRegisterServiceTwice
|
1 PASS | |
|
0.2857143
|
javax.jmdns.test.JmDNSTest.testRegisterService
javax.jmdns.test.JmDNSTest.testRegisterService
|
1 PASS | |
|
0.2857143
|
javax.jmdns.test.JmDNSTest.testQueryMyService
javax.jmdns.test.JmDNSTest.testQueryMyService
|
1 PASS | |
|
0.2857143
|
javax.jmdns.test.JmDNSTest.testListenForMyService
javax.jmdns.test.JmDNSTest.testListenForMyService
|
1 PASS | |
|
0.2857143
|
javax.jmdns.test.JmDNSTest.testCreateINet
javax.jmdns.test.JmDNSTest.testCreateINet
|
1 PASS | |
| 1 | // Copyright 2003-2005 Arthur van Hoff, Rick Blair | |
| 2 | // Licensed under Apache License version 2.0 | |
| 3 | // Original license LGPL | |
| 4 | ||
| 5 | package javax.jmdns.impl.tasks; | |
| 6 | ||
| 7 | import java.util.Timer; | |
| 8 | import java.util.logging.Level; | |
| 9 | import java.util.logging.Logger; | |
| 10 | ||
| 11 | import javax.jmdns.impl.JmDNSImpl; | |
| 12 | import javax.jmdns.impl.constants.DNSConstants; | |
| 13 | ||
| 14 | /** | |
| 15 | * Periodically removes expired entries from the cache. | |
| 16 | */ | |
| 17 | public class RecordReaper extends DNSTask { | |
| 18 | static Logger logger = Logger.getLogger(RecordReaper.class.getName()); | |
| 19 | ||
| 20 | /** | |
| 21 | * @param jmDNSImpl | |
| 22 | */ | |
| 23 | 29 |
public RecordReaper(JmDNSImpl jmDNSImpl) { |
| 24 | 29 | super(jmDNSImpl); |
| 25 | } | |
| 26 | ||
| 27 | /* | |
| 28 | * (non-Javadoc) | |
| 29 | * @see javax.jmdns.impl.tasks.DNSTask#getName() | |
| 30 | */ | |
| 31 | 0 |
@Override |
| 32 | public String getName() { | |
| 33 | 0 | return "RecordReaper(" + (this.getDns() != null ? this.getDns().getName() : "") + ")"; |
| 34 | } | |
| 35 | ||
| 36 | /* | |
| 37 | * (non-Javadoc) | |
| 38 | * @see javax.jmdns.impl.tasks.DNSTask#start(java.util.Timer) | |
| 39 | */ | |
| 40 | 29 |
@Override |
| 41 | public void start(Timer timer) { | |
| 42 | 29 | if (!this.getDns().isCanceling() && !this.getDns().isCanceled()) { |
| 43 | 29 | timer.schedule(this, DNSConstants.RECORD_REAPER_INTERVAL, DNSConstants.RECORD_REAPER_INTERVAL); |
| 44 | } | |
| 45 | } | |
| 46 | ||
| 47 | 51 |
@Override |
| 48 | public void run() { | |
| 49 | 49 | if (this.getDns().isCanceling() || this.getDns().isCanceled()) { |
| 50 | 0 | return; |
| 51 | } | |
| 52 | 48 | if (logger.isLoggable(Level.FINEST)) { |
| 53 | 0 | logger.finest(this.getName() + ".run() JmDNS reaping cache"); |
| 54 | } | |
| 55 | ||
| 56 | // Remove expired answers from the cache | |
| 57 | // ------------------------------------- | |
| 58 | 47 | this.getDns().cleanCache(); |
| 59 | } | |
| 60 | ||
| 61 | } | |
|
||||||||||||