Class OneTimeExecutable

    • Constructor Detail

      • OneTimeExecutable

        public OneTimeExecutable()
    • Method Detail

      • tryExecute

        protected boolean tryExecute()
        Invoke doExecute() unless it has been executed already. Also, ensure that it will not be invoked a second time.
        Returns:
        whether the method invocation resulted in invoking doExecute()
      • execute

        protected void execute()
                        throws java.lang.IllegalStateException
        Invoke doExecute(). Also, ensure that it will not be invoked a second time.
        Throws:
        java.lang.IllegalStateException - if doExecute() has been already invoked
      • doExecute

        protected abstract void doExecute()
        Performs the actual work of this instance. Should only be invoked via execute() and tryExecute().