1. /*
  2. * @(#)State.java 1.7 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.spi.orbutil.fsm ;
  8. /**
  9. * This interface must be implemented by any class that is used as
  10. * a state in a FSM. The FSM only needs the identity of this
  11. * object, so all that is really needs is the default equals implementation.
  12. * The toString() method should also be overridden to give a concise
  13. * description or name of the state. The StateImpl class handles this.
  14. * <P>
  15. * Pre- and post- actions are taken only on completed transitions between
  16. * different states. Assume that the FSM is in state A, and the FSM will
  17. * transition to state B under input I with action X. If A != B and X completes
  18. * successfully, then after X completes execution, A.postAction is executed,
  19. * followed by B.preAction.
  20. *
  21. * @version @(#)State.java 1.7 03/12/19
  22. * @author Ken Cavanaugh
  23. */
  24. public interface State
  25. {
  26. /** Method that defines action that occurs whenever this state is entered.
  27. * Any exceptions thrown by this method are ignored.
  28. */
  29. void preAction( FSM fsm ) ;
  30. /** Method that defines action that occurs whenever this state is exited.
  31. * Any exceptions thrown by this method are ignored.
  32. */
  33. void postAction( FSM fsm ) ;
  34. }
  35. // end of State.java