@Test public void testIsReplaceableByTimestampBeforeTimeout() throws Exception { ExpiryMarker marker = new ExpiryMarker(null, 100L, "the-marker-id"); assertFalse("marker is not replaceable when it hasn't timed out", marker.isReplaceableBy(99L, null, null)); }
@Override public boolean isReplaceableBy(final long txTimestamp, final Object newVersion, final Comparator versionComparator) { if (txTimestamp > timeout) { return true; } if (multiplicity > 0) { return false; } if (version == null) { return expiredTimestamp != NOT_COMPLETELY_EXPIRED && txTimestamp > expiredTimestamp; } return versionComparator.compare(version, newVersion) < 0; }
ExpiryMarker extends Expirable implements Serializable { @Override public boolean isReplaceableBy(final long txTimestamp, final Object newVersion, final Comparator versionComparator) { if (txTimestamp > timeout) { return true; } if (multiplicity > 0) { return false; } if (version == null) { return expiredTimestamp != NOT_COMPLETELY_EXPIRED && txTimestamp > expiredTimestamp; } return versionComparator.compare(version, newVersion) < 0; } }
ExpiryMarker extends Expirable implements Serializable { @Override public boolean isReplaceableBy(final long txTimestamp, final Object newVersion, final Comparator versionComparator) { if (txTimestamp > timeout) { return true; } if (multiplicity > 0) { return false; } if (version == null) { return expiredTimestamp != NOT_COMPLETELY_EXPIRED && txTimestamp > expiredTimestamp; } return versionComparator.compare(version, newVersion) < 0; } ExpiryMarker();  ExpiryMarker(final Object version, final long timeout, final String markerId); private  ExpiryMarker(final Object version, final boolean concurrent, final long expiredTimestamp,
                         final String markerId, final int multiplicity, final long timeout); }
ExpiryMarker extends Expirable implements Serializable { @Override public boolean isReplaceableBy(final long txTimestamp, final Object newVersion, final Comparator versionComparator) { if (txTimestamp > timeout) { return true; } if (multiplicity > 0) { return false; } if (version == null) { return expiredTimestamp != NOT_COMPLETELY_EXPIRED && txTimestamp > expiredTimestamp; } return versionComparator.compare(version, newVersion) < 0; } ExpiryMarker();  ExpiryMarker(final Object version, final long timeout, final String markerId); private  ExpiryMarker(final Object version, final boolean concurrent, final long expiredTimestamp,
                         final String markerId, final int multiplicity, final long timeout); @Override boolean isReplaceableBy(final long txTimestamp, final Object newVersion,
                                   final Comparator versionComparator); @Override Object getValue(); @Override Object getValue(final long txTimestamp); @Override boolean matches(final ExpiryMarker lock); boolean isConcurrent(); @Override ExpiryMarker markForExpiration(final long timeout, final String nextMarkerId); ExpiryMarker expire(final long timestamp); @Override void writeData(final ObjectDataOutput out); @Override void readData(final ObjectDataInput in); @Override int getFactoryId(); @Override int getClassId(); }
ExpiryMarker extends Expirable implements Serializable { @Override public boolean isReplaceableBy(final long txTimestamp, final Object newVersion, final Comparator versionComparator) { if (txTimestamp > timeout) { return true; } if (multiplicity > 0) { return false; } if (version == null) { return expiredTimestamp != NOT_COMPLETELY_EXPIRED && txTimestamp > expiredTimestamp; } return versionComparator.compare(version, newVersion) < 0; } ExpiryMarker();  ExpiryMarker(final Object version, final long timeout, final String markerId); private  ExpiryMarker(final Object version, final boolean concurrent, final long expiredTimestamp,
                         final String markerId, final int multiplicity, final long timeout); @Override boolean isReplaceableBy(final long txTimestamp, final Object newVersion,
                                   final Comparator versionComparator); @Override Object getValue(); @Override Object getValue(final long txTimestamp); @Override boolean matches(final ExpiryMarker lock); boolean isConcurrent(); @Override ExpiryMarker markForExpiration(final long timeout, final String nextMarkerId); ExpiryMarker expire(final long timestamp); @Override void writeData(final ObjectDataOutput out); @Override void readData(final ObjectDataInput in); @Override int getFactoryId(); @Override int getClassId();  }