Class MarshallingItemCache

  • All Implemented Interfaces:
    ComponentLifecycle, ProcessedItemCache
    Direct Known Subclasses:
    XStreamItemCache

    public abstract class MarshallingItemCache
    extends InlineItemCache
    Extension to InlineItemCache that stores the procssed items to disk.

    The items are stored and to disk upon close() and save() respectively; Items are only read from disk upon init(). If multiple instances of this class point to the same persistentStore then results are undefined.

    • Constructor Detail

      • MarshallingItemCache

        public MarshallingItemCache()
                             throws java.lang.Exception
        Default Constructor
        • PersistentStore = System.getProperty("user.dir")+ "/uniqueid"
        Throws:
        java.lang.Exception
      • MarshallingItemCache

        public MarshallingItemCache​(java.lang.String store)
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • initMarshaller

        protected abstract AdaptrisMarshaller initMarshaller()
                                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • close

        public void close()
        Description copied from interface: ComponentLifecycle
        Closes the component.

        A closed component should release any connections it uses, etc. and clean up completely. Throwing a RuntimeException may cause unintended consequences

        Specified by:
        close in interface ComponentLifecycle
        Overrides:
        close in class InlineItemCache
      • getPersistentStore

        public java.lang.String getPersistentStore()
        Returns:
        the filename
      • setPersistentStore

        public void setPersistentStore​(java.lang.String filename)
        Parameters:
        filename - the file where to store cached items.