org.wildfly.clustering.ejb.bean.BeanExpirationMetaData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wildfly-clustering-ejb-spi Show documentation
Show all versions of wildfly-clustering-ejb-spi Show documentation
A set of SPIs for managing distributable @Stateful bean instances for use by the the distributed Jakarta Enterprise Beans cache implementation found in the wildfly-ejb3 module.
This module decouples the mechanism for managing @Stateful bean instances from the Jakarta Enterprise Beans subsystem.
/*
* Copyright The WildFly Authors
* SPDX-License-Identifier: Apache-2.0
*/
package org.wildfly.clustering.ejb.bean;
import java.time.Duration;
import org.wildfly.clustering.ee.expiration.ExpirationMetaData;
/**
* Encapsulates the expiration-related meta data of a cached bean.
* Overrides the inherited semantics for zero timeout behavior.
* @author Paul Ferraro
*/
public interface BeanExpirationMetaData extends BeanExpiration, ExpirationMetaData {
@Override
default boolean isExpired() {
Duration timeout = this.getTimeout();
// EJB specification considers a zero timeout to be expired.
if ((timeout != null) && timeout.isZero()) return true;
return ExpirationMetaData.super.isExpired();
}
}