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

org.wildfly.clustering.ejb.cache.timer.MutableTimerMetaDataEntry 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: 35.0.0.Final
Show newest version
/*
 * Copyright The WildFly Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package org.wildfly.clustering.ejb.cache.timer;

import java.lang.reflect.Method;
import java.time.Duration;
import java.time.Instant;
import java.util.function.Predicate;

import org.wildfly.clustering.server.offset.OffsetValue;
import org.wildfly.clustering.ejb.timer.TimerType;

/**
 * @author Paul Ferraro
 * @param  the timer context type
 */
public class MutableTimerMetaDataEntry implements TimerMetaDataEntry {

    private final ImmutableTimerMetaDataEntry entry;
    private final OffsetValue lastTimeout;

    public MutableTimerMetaDataEntry(ImmutableTimerMetaDataEntry entry, OffsetValue lastTimeout) {
        this.entry = entry;
        this.lastTimeout = lastTimeout;
    }

    @Override
    public TimerType getType() {
        return this.entry.getType();
    }

    @Override
    public C getContext() {
        return this.entry.getContext();
    }

    @Override
    public Instant getStart() {
        return this.entry.getStart();
    }

    @Override
    public Predicate getTimeoutMatcher() {
        return this.entry.getTimeoutMatcher();
    }

    @Override
    public Duration getLastTimeout() {
        return this.lastTimeout.get();
    }

    @Override
    public void setLastTimeout(Duration timeout) {
        this.lastTimeout.set(timeout);
    }

    @Override
    public Instant apply(Instant instant) {
        return this.entry.apply(instant);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy