org.wildfly.clustering.ejb.cache.timer.TimerMetaDataEntryFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wildfly-clustering-ejb-cache Show documentation
Show all versions of wildfly-clustering-ejb-cache Show documentation
Contains code common to the wildfly-clustering-ejb-hotrod and wildfly-clustering-ejb-infinispan modules.
/*
* Copyright The WildFly Authors
* SPDX-License-Identifier: Apache-2.0
*/
package org.wildfly.clustering.ejb.cache.timer;
import java.time.Duration;
import java.util.function.Supplier;
import org.wildfly.clustering.cache.function.RemappingFunction;
import org.wildfly.clustering.server.offset.Offset;
import org.wildfly.clustering.server.offset.OffsetValue;
import org.wildfly.common.function.Functions;
/**
* @author Paul Ferraro
* @param the timer context type
*/
public class TimerMetaDataEntryFunction extends RemappingFunction, Supplier>> {
public TimerMetaDataEntryFunction(OffsetValue lastTimeoutDelta) {
super(lastTimeoutDelta::getOffset);
}
TimerMetaDataEntryFunction(Offset lastTimeoutOffsetDelta) {
super(Functions.constantSupplier(lastTimeoutOffsetDelta));
}
Offset getOffset() {
return super.getOperand().get();
}
}