Class PersistentItem<T extends Serializable>

  • All Implemented Interfaces:
    PersistenceHandler<T>

    public abstract class PersistentItem<T extends Serializable>
    extends Object
    implements PersistenceHandler<T>
    Wrapping for data that can be persisted on the filesystem.
     new PersistentItem<DataTypeToPersist>(fileToStore, refreshDelay) {
      public void onLoad() {
             //...
      }
      
      // The other methods to overload
      // ...
      
     }
     
    Author:
    Daniele Strollo (ISTI-CNR)
    • Constructor Detail

      • PersistentItem

        public PersistentItem()
        Deprecated.
        for internal use only.
      • PersistentItem

        public PersistentItem​(String persistenceFileName)
      • PersistentItem

        public PersistentItem​(String persistenceFileName,
                              long refreshDelay)
      • PersistentItem

        public PersistentItem​(T data,
                              String persistenceFileName,
                              long refreshDelay)
    • Method Detail

      • setPersistenceFileName

        protected final void setPersistenceFileName​(String persistenceFileName)
      • setRefreshDelay

        protected final void setRefreshDelay​(long refreshDelay)
      • destroy

        public final void destroy()
        Description copied from interface: PersistenceHandler
        Requires the destroy of the persistent resource. The persistent file will be deleted and the onDestroy event will be raised.
        Specified by:
        destroy in interface PersistenceHandler<T extends Serializable>