Class FileHandler.AbstractUpdater

  • Enclosing class:
    FileHandler

    private abstract class FileHandler.AbstractUpdater
    extends java.lang.Object
    An internal class that performs all update operations of the handler's FileLocator in a safe way even if there is concurrent access. This class implements anon-blocking algorithm for replacing the immutable FileLocator instance stored in an atomic reference by a manipulated instance. (If we already had lambdas, this could be done without a class in a more elegant way.)
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private AbstractUpdater()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void update()
      Performs an update of the enclosing file handler's FileLocator object.
      protected abstract void updateBuilder​(FileLocator.FileLocatorBuilder builder)
      Updates the passed in builder object to apply the manipulation to be performed by this Updater.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractUpdater

        private AbstractUpdater()
    • Method Detail

      • update

        public void update()
        Performs an update of the enclosing file handler's FileLocator object.
      • updateBuilder

        protected abstract void updateBuilder​(FileLocator.FileLocatorBuilder builder)
        Updates the passed in builder object to apply the manipulation to be performed by this Updater. The builder has been setup with the former content of the FileLocator to be manipulated.
        Parameters:
        builder - the builder for creating an updated FileLocator