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

org.wildfly.clustering.ejb.cache.timer.ImmutableTimerMetaDataEntry 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.lang.reflect.Method;
import java.time.Duration;
import java.time.Instant;
import java.util.function.Predicate;
import java.util.function.UnaryOperator;

import org.wildfly.clustering.ejb.timer.TimerConfiguration;
import org.wildfly.clustering.ejb.timer.TimerType;

/**
 * @author Paul Ferraro
 * @param  the timer context type
 */
public interface ImmutableTimerMetaDataEntry extends TimerConfiguration, UnaryOperator {
    /**
     * Returns the type of this timer
     * @return the timer type
     */
    TimerType getType();

    /**
     * Returns the context with which this timer was created.
     * @return the timer context
     */
    C getContext();

    /**
     * Returns the timeout matcher, used to locate the timeout method within the associated component.
     * @return an timeout matcher
     */
    default Predicate getTimeoutMatcher() {
        return DefaultTimeoutMatcher.INSTANCE;
    }

    /**
     * Supplies the time of the most recent timeout event of this timer, or null if there are no previous timeout events
     * @return a reference to the time of the last timeout event, if one exists
     */
    Duration getLastTimeout();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy