001package co.codewizards.cloudstore.ls.core.dto; 002 003import java.io.Serializable; 004 005import co.codewizards.cloudstore.core.Uid; 006import co.codewizards.cloudstore.core.io.TimeoutException; 007 008public interface InverseServiceRequest extends Serializable { 009 010 Uid getRequestId(); 011 012 /** 013 * Indicates whether encountering a timeout causes the entire {@code InverseInvoker} to be marked dead. 014 * <p> 015 * If this is <code>true</code>, the first {@link TimeoutException} thrown by 016 * {@code InverseInvoker.performInverseServiceRequest(InverseServiceRequest)} causes the 017 * {@code InverseInvoker} to be marked {@code diedOfTimeout} and all future requests will fail 018 * immediately without waiting for the timeout again. 019 * <p> 020 * An implementation of {@code InverseServiceRequest} should return <code>false</code>, if it cannot 021 * guarantee that handling this request will never exceed the timeout. If, however, it knows for sure 022 * (really 100%!) that the timeout means the communication partner is dead (JVM crashed, shut down or whatever), 023 * it should return <code>true</code> to prevent unnecessary waiting. 024 * @return whether encountering a timeout once means to render the {@code InverseInvoker} out of order. 025 */ 026 boolean isTimeoutDeadly(); 027 028}