@Test public void shouldThrowAnInterruptedExceptionIfTheThreadIsInterrupted() { try { exception.expect(PalantirInterruptedException.class); Thread.currentThread().interrupt(); store.storeUpperLimit(1_000); } finally { Thread.interrupted(); } }
@Override public synchronized void storeUpperLimit(long limit) { failures.verifyWeShouldIssueMoreTimestamps(); throwIfInterrupted(); try { delegate.storeUpperLimit(limit); } catch (Throwable t) { throw failures.responseTo(t); } }
ErrorCheckingTimestampBoundStore implements TimestampBoundStore { @Override public synchronized void storeUpperLimit(long limit) { failures.verifyWeShouldIssueMoreTimestamps(); throwIfInterrupted(); try { delegate.storeUpperLimit(limit); } catch (Throwable t) { throw failures.responseTo(t); } } }
ErrorCheckingTimestampBoundStore implements TimestampBoundStore { @Override public synchronized void storeUpperLimit(long limit) { failures.verifyWeShouldIssueMoreTimestamps(); throwIfInterrupted(); try { delegate.storeUpperLimit(limit); } catch (Throwable t) { throw failures.responseTo(t); } } ErrorCheckingTimestampBoundStore(TimestampBoundStore delegate); @VisibleForTesting  ErrorCheckingTimestampBoundStore(TimestampBoundStore delegate, TimestampAllocationFailures failures); }
ErrorCheckingTimestampBoundStore implements TimestampBoundStore { @Override public synchronized void storeUpperLimit(long limit) { failures.verifyWeShouldIssueMoreTimestamps(); throwIfInterrupted(); try { delegate.storeUpperLimit(limit); } catch (Throwable t) { throw failures.responseTo(t); } } ErrorCheckingTimestampBoundStore(TimestampBoundStore delegate); @VisibleForTesting  ErrorCheckingTimestampBoundStore(TimestampBoundStore delegate, TimestampAllocationFailures failures); @Override long getUpperLimit(); @Override synchronized void storeUpperLimit(long limit); }
ErrorCheckingTimestampBoundStore implements TimestampBoundStore { @Override public synchronized void storeUpperLimit(long limit) { failures.verifyWeShouldIssueMoreTimestamps(); throwIfInterrupted(); try { delegate.storeUpperLimit(limit); } catch (Throwable t) { throw failures.responseTo(t); } } ErrorCheckingTimestampBoundStore(TimestampBoundStore delegate); @VisibleForTesting  ErrorCheckingTimestampBoundStore(TimestampBoundStore delegate, TimestampAllocationFailures failures); @Override long getUpperLimit(); @Override synchronized void storeUpperLimit(long limit);  }