Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class DebugEnabledTimedLock implements DebuggableTimedLock {

private final Lock lock;
private final Logger logger;
private static final Logger logger = LoggerFactory.getLogger(TimedLock.class.getName());
private long lockTime = 0L;

private final Map<String, Long> lockIterations = new HashMap<>();
Expand All @@ -40,7 +40,6 @@ public DebugEnabledTimedLock(final Lock lock, final String name, final int itera
this.lock = lock;
this.name = name;
this.iterationFrequency = iterationFrequency;
logger = LoggerFactory.getLogger(TimedLock.class.getName() + "." + name);
}

/**
Expand All @@ -54,7 +53,7 @@ public boolean tryLock() {
logger.trace("TryLock failed for Lock: {}", name);
return false;
}
logger.trace("TryLock successful");
logger.trace("TryLock successful for Lock: {}", name);

return true;
}
Expand All @@ -78,7 +77,7 @@ public boolean tryLock(final long timeout, final TimeUnit timeUnit) {
logger.trace("TryLock failed for Lock {} with a timeout of {} {}", name, timeout, timeUnit);
return false;
}
logger.trace("TryLock successful");
logger.trace("TryLock successful for Lock: {}", name);
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ public class TimedLock {
private final DebugEnabledTimedLock enabled;
private final DebugDisabledTimedLock disabled;

private final Logger logger;
private static final Logger logger = LoggerFactory.getLogger(TimedLock.class.getName());

public TimedLock(final Lock lock, final String name, final int iterationFrequency) {
this.enabled = new DebugEnabledTimedLock(lock, name, iterationFrequency);
this.disabled = new DebugDisabledTimedLock(lock);

logger = LoggerFactory.getLogger(TimedLock.class.getName() + "." + name);
}

private DebuggableTimedLock getLock() {
Expand Down