• Control flow during a restart:
    • A restart is triggered by setting the state of a primitive to RESTART. Never directly call restart().
    • After the current call to process() is done Command will automatically check the primitive state. If the state is set to RESTART it will call restart().
      • While this may seem trivial, it is very important because it ensures that the current call to process() is not interrupted.
    • The restart() method restarts a primitive by calling close() and then open() before allowing the primitive to return to process().
      • To most primitives a restart is nothing more than "typical" operation because it sees open(), process(), ..., process(), close() just like it normally does. The only difference is that the close() is immediately followed by whole "new" execution of the primitive.
    Click image for larger view.