So the meaning of getInstance is changed. It more like createInstance(param, param), eh, but this is more like a factory method. If I write a static method
then if getInstance() throw IllegalStateException, the message will be "no database mounted"
The state of Data can be "idle", "mounted". Still thinking, no conclusion.
Your solution is cool. But there is a dependence between those two getInstance methods. And the real meaning of getInstance(param, param) is opening database file, preparing lockMap and then return the instance.