Class OneShotLock


  • public class OneShotLock
    extends LockSupport
    Logic for handling one shot semantics for classes; classes that include a method (or methods) that "locks down" the instance, to prevent it from being used again in the future.
    • Method Detail

      • check

        public void check()
        Checks to see if the lock has been set (via lock()).
        Throws:
        java.lang.IllegalStateException - if the lock is set
      • lock

        public void lock()
        Checks the lock, then sets it.