Modify the trader demo so it doesn't need a shell script to start it anymore. Now all configuration is in the driver program.

This commit is contained in:
Mike Hearn
2016-05-16 19:06:55 +02:00
parent 8211a7937b
commit e1f899647a
5 changed files with 60 additions and 121 deletions

View File

@ -94,11 +94,16 @@ class StateMachineManager(val serviceHub: ServiceHub, val executor: AffinityExec
field.get(null)
}
companion object {
var restoreCheckpointsOnStart = true
}
init {
Fiber.setDefaultUncaughtExceptionHandler { fiber, throwable ->
(fiber as ProtocolStateMachineImpl<*>).logger.error("Caught exception from protocol", throwable)
}
restoreCheckpoints()
if (restoreCheckpointsOnStart)
restoreCheckpoints()
}
/** Reads the database map and resurrects any serialised state machines. */