Class FileBackingStore<K extends Serializable,​V extends Serializable>


  • public class FileBackingStore<K extends Serializable,​V extends Serializable>
    extends org.glassfish.ha.store.api.BackingStore<K,​V>
    An implementation of BackingStore that uses file system to persist any Serializable data
    Author:
    Mahesh Kannan
    • Field Detail

      • logger

        protected Logger logger
      • baseDir

        protected File baseDir
    • Constructor Detail

      • FileBackingStore

        public FileBackingStore()
        No arg constructor
    • Method Detail

      • initialize

        protected void initialize​(org.glassfish.ha.store.api.BackingStoreConfiguration<K,​V> conf)
                           throws org.glassfish.ha.store.api.BackingStoreException
        Overrides:
        initialize in class org.glassfish.ha.store.api.BackingStore<K extends Serializable,​V extends Serializable>
        Throws:
        org.glassfish.ha.store.api.BackingStoreException
      • getBackingStoreFactory

        public org.glassfish.ha.store.api.BackingStoreFactory getBackingStoreFactory()
        Specified by:
        getBackingStoreFactory in class org.glassfish.ha.store.api.BackingStore<K extends Serializable,​V extends Serializable>
      • load

        public V load​(K key,
                      String version)
               throws org.glassfish.ha.store.api.BackingStoreException
        Specified by:
        load in class org.glassfish.ha.store.api.BackingStore<K extends Serializable,​V extends Serializable>
        Throws:
        org.glassfish.ha.store.api.BackingStoreException
      • remove

        public void remove​(K sessionKey)
        Specified by:
        remove in class org.glassfish.ha.store.api.BackingStore<K extends Serializable,​V extends Serializable>
      • destroy

        public void destroy()
        Overrides:
        destroy in class org.glassfish.ha.store.api.BackingStore<K extends Serializable,​V extends Serializable>
      • removeExpired

        public int removeExpired()
        Overrides:
        removeExpired in class org.glassfish.ha.store.api.BackingStore<K extends Serializable,​V extends Serializable>
      • removeExpired

        public int removeExpired​(long idleForMillis)
        Overrides:
        removeExpired in class org.glassfish.ha.store.api.BackingStore<K extends Serializable,​V extends Serializable>
      • shutdown

        public void shutdown()
      • size

        public int size()
                 throws org.glassfish.ha.store.api.BackingStoreException
        Specified by:
        size in class org.glassfish.ha.store.api.BackingStore<K extends Serializable,​V extends Serializable>
        Throws:
        org.glassfish.ha.store.api.BackingStoreException
      • save

        public String save​(K sessionKey,
                           V value,
                           boolean isNew)
                    throws org.glassfish.ha.store.api.BackingStoreException
        Specified by:
        save in class org.glassfish.ha.store.api.BackingStore<K extends Serializable,​V extends Serializable>
        Throws:
        org.glassfish.ha.store.api.BackingStoreException
      • updateTimeStamp

        public void updateTimeStamp​(K k,
                                    String version,
                                    long timeStamp)
                             throws org.glassfish.ha.store.api.BackingStoreException
        Throws:
        org.glassfish.ha.store.api.BackingStoreException
      • updateTimestamp

        public void updateTimestamp​(K sessionKey,
                                    long time)
                             throws org.glassfish.ha.store.api.BackingStoreException
        Overrides:
        updateTimestamp in class org.glassfish.ha.store.api.BackingStore<K extends Serializable,​V extends Serializable>
        Throws:
        org.glassfish.ha.store.api.BackingStoreException