KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > spi > orbutil > fsm > Action


1 /*
2  * Action.java
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.spi.orbutil.fsm;
9
10 /**
11  * Description goes here
12  *
13  * @version @(#)Action.java 1.11 03/12/19
14  * @author Ken Cavanaugh
15  */

16 public interface Action
17 {
18     /** Called by the state engine to perform an action
19     * before a state transition takes place. The FSM is
20     * passed so that the Action may set the next state in
21     * cases when that is required. FSM and Input together
22     * allow actions to be written that depend on the state and
23     * input, but this should generally be avoided, as the
24     * reason for a state machine in the first place is to cleanly
25     * separate the actions and control flow. Note that an
26     * action should complete in a timely manner. If the state machine
27     * is used for concurrency control with multiple threads, the
28     * action must not allow multiple threads to run simultaneously
29     * in the state machine, as the state could be corrupted.
30     * Any exception thrown by the Action for the transition
31     * will be propagated to doIt.
32     * @param FSM fsm is the state machine causing this action.
33     * @param Input in is the input that caused the transition.
34     */

35     public void doIt( FSM fsm, Input in ) ;
36 }
37
38 // end of Action.java
39

40
Popular Tags