static { s_fsm.addTransition(State.Stopped, VirtualMachine.Event.StartRequested, State.Starting); s_fsm.addTransition(State.Stopped, VirtualMachine.Event.DestroyRequested, State.Destroyed); s_fsm.addTransition(State.Stopped, VirtualMachine.Event.StopRequested, State.Stopped); s_fsm.addTransition(State.Stopped, VirtualMachine.Event.AgentReportStopped, State.Stopped); // please pay attention about state transition to Error state, there should be only one case // (failed in VM // creation process) // that can have such transition s_fsm.addTransition(State.Stopped, VirtualMachine.Event.OperationFailedToError, State.Error); s_fsm.addTransition(State.Stopped, VirtualMachine.Event.OperationFailed, State.Stopped); s_fsm.addTransition(State.Stopped, VirtualMachine.Event.ExpungeOperation, State.Expunging); s_fsm.addTransition(State.Stopped, VirtualMachine.Event.AgentReportShutdowned, State.Stopped); s_fsm.addTransition( State.Stopped, VirtualMachine.Event.StorageMigrationRequested, State.Migrating); s_fsm.addTransition(State.Starting, VirtualMachine.Event.OperationRetry, State.Starting); s_fsm.addTransition(State.Starting, VirtualMachine.Event.OperationSucceeded, State.Running); s_fsm.addTransition(State.Starting, VirtualMachine.Event.OperationFailed, State.Stopped); s_fsm.addTransition(State.Starting, VirtualMachine.Event.AgentReportRunning, State.Running); s_fsm.addTransition(State.Starting, VirtualMachine.Event.AgentReportStopped, State.Stopped); s_fsm.addTransition( State.Starting, VirtualMachine.Event.AgentReportShutdowned, State.Stopped); s_fsm.addTransition(State.Destroyed, VirtualMachine.Event.RecoveryRequested, State.Stopped); s_fsm.addTransition(State.Destroyed, VirtualMachine.Event.ExpungeOperation, State.Expunging); s_fsm.addTransition(State.Running, VirtualMachine.Event.MigrationRequested, State.Migrating); s_fsm.addTransition(State.Running, VirtualMachine.Event.AgentReportRunning, State.Running); s_fsm.addTransition(State.Running, VirtualMachine.Event.AgentReportStopped, State.Stopped); s_fsm.addTransition(State.Running, VirtualMachine.Event.StopRequested, State.Stopping); s_fsm.addTransition(State.Running, VirtualMachine.Event.AgentReportShutdowned, State.Stopped); s_fsm.addTransition(State.Running, VirtualMachine.Event.AgentReportMigrated, State.Running); s_fsm.addTransition( State.Migrating, VirtualMachine.Event.MigrationRequested, State.Migrating); s_fsm.addTransition(State.Migrating, VirtualMachine.Event.OperationSucceeded, State.Running); s_fsm.addTransition(State.Migrating, VirtualMachine.Event.OperationFailed, State.Running); s_fsm.addTransition(State.Migrating, VirtualMachine.Event.AgentReportRunning, State.Running); s_fsm.addTransition(State.Migrating, VirtualMachine.Event.AgentReportStopped, State.Stopped); s_fsm.addTransition( State.Migrating, VirtualMachine.Event.AgentReportShutdowned, State.Stopped); s_fsm.addTransition(State.Stopping, VirtualMachine.Event.OperationSucceeded, State.Stopped); s_fsm.addTransition(State.Stopping, VirtualMachine.Event.OperationFailed, State.Running); s_fsm.addTransition(State.Stopping, VirtualMachine.Event.AgentReportRunning, State.Running); s_fsm.addTransition(State.Stopping, VirtualMachine.Event.AgentReportStopped, State.Stopped); s_fsm.addTransition(State.Stopping, VirtualMachine.Event.StopRequested, State.Stopping); s_fsm.addTransition( State.Stopping, VirtualMachine.Event.AgentReportShutdowned, State.Stopped); s_fsm.addTransition(State.Expunging, VirtualMachine.Event.OperationFailed, State.Expunging); s_fsm.addTransition(State.Expunging, VirtualMachine.Event.ExpungeOperation, State.Expunging); s_fsm.addTransition(State.Error, VirtualMachine.Event.DestroyRequested, State.Expunging); s_fsm.addTransition(State.Error, VirtualMachine.Event.ExpungeOperation, State.Expunging); }
static { s_fsm.addTransition(Allocated, Event.CreateRequested, Creating); s_fsm.addTransition(Allocated, Event.DestroyRequested, Destroy); s_fsm.addTransition(Creating, Event.OperationRetry, Creating); s_fsm.addTransition(Creating, Event.OperationFailed, Allocated); s_fsm.addTransition(Creating, Event.OperationSucceeded, Ready); s_fsm.addTransition(Creating, Event.DestroyRequested, Destroy); s_fsm.addTransition(Creating, Event.CreateRequested, Creating); s_fsm.addTransition(Allocated, Event.UploadRequested, UploadOp); s_fsm.addTransition(Creating, Event.CopySucceeded, Ready); s_fsm.addTransition(UploadOp, Event.CopySucceeded, Ready); s_fsm.addTransition(UploadOp, Event.DestroyRequested, Destroy); s_fsm.addTransition(Ready, Event.DestroyRequested, Destroy); s_fsm.addTransition(Destroy, Event.ExpungingRequested, Expunging); s_fsm.addTransition(Ready, Event.SnapshotRequested, Snapshotting); s_fsm.addTransition(Snapshotting, Event.OperationSucceeded, Ready); s_fsm.addTransition(Snapshotting, Event.OperationFailed, Ready); s_fsm.addTransition(Ready, Event.MigrationRequested, Migrating); s_fsm.addTransition(Migrating, Event.OperationSucceeded, Ready); s_fsm.addTransition(Migrating, Event.OperationFailed, Ready); s_fsm.addTransition(Destroy, Event.OperationSucceeded, Destroy); }