com.tangosol.util.fsm.Event Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of coherence Show documentation
Show all versions of coherence Show documentation
Oracle Coherence Community Edition
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
package com.tangosol.util.fsm;
/**
* An {@link Event} captures the information that may trigger a {@link Transition}
* in a {@link FiniteStateMachine} from one state to another.
*
* @param the type of the state of the {@link FiniteStateMachine}
*
* @author Brian Oliver
* @since Coherence 12.2.1
*/
public interface Event>
{
/**
* Determines the desired state of the {@link FiniteStateMachine} for the
* {@link Event} given the current state of the {@link FiniteStateMachine}.
*
* @param state the current state of the {@link FiniteStateMachine}
* @param context the {@link ExecutionContext} for the {@link Event}
*
* @return the desired state of the {@link FiniteStateMachine} or
* null
if no transition is required
*/
public S getDesiredState(S state, ExecutionContext context);
}