Having mission models implement AutoClosable would allow them to clean up, for example, network resources or, specific to our discussion, save off a cache/log.
This would additionally allow us to resolve the TODO on L298 of LocalMissionModelService by wrapping the return in a try-with-resources to get the model. By having the close run explicitly outside of the simulation context, this should also prevent the model's close from doing anything sneaky with simulation/sim resources.
Follow up from a discussion with @DavidLegg.
Having mission models implement
AutoClosable
would allow them to clean up, for example, network resources or, specific to our discussion, save off a cache/log.This would additionally allow us to resolve the TODO on L298 of
LocalMissionModelService
by wrapping the return in a try-with-resources to get the model. By having the close run explicitly outside of the simulation context, this should also prevent the model'sclose
from doing anything sneaky with simulation/sim resources.