All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.wildfly.clustering.ejb.cache.timer.TimerMetaDataEntryFunction Maven / Gradle / Ivy

Go to download

Contains code common to the wildfly-clustering-ejb-hotrod and wildfly-clustering-ejb-infinispan modules.

There is a newer version: 34.0.1.Final
Show newest version
/*
 * 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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy