Ebook Coder

How to lock instantiation by a condition in Java?