Interface DocumentDataProvider<S extends Source,SH extends PageSegmentHandle>

Type Parameters:
S - The Source defining where the document data comes from
SH - The PageSegmentHandle handles.
All Known Subinterfaces:
UriBasedDocumentDataProvider
All Known Implementing Classes:
AbstractDocumentDataProvider, ClassPathDocumentDataProvider, ClassPathWithAnnoAndPermissionDocumentDataProvider, ClassPathWithAnnoDocumentDataProvider, ClassPathWithRenderControlsDocumentDataProvider, CompositeDocumentDataProvider, DocumentUploadRepositoryDataProvider, ServerBasedDnDDataProvider, SimpleDocumentDataProvider, UploadSchemeDocumentDataProvider, UrlRelativeDataProvider

public interface DocumentDataProvider<S extends Source,SH extends PageSegmentHandle>
A provider for reading documents based on Sources. Implementations of this class have to be registered using DocumentDataProviderRegistry.registerProvider(Class, Class, DocumentDataProvider) which will enable the jadice webtoolkit engine to correctly load the appropriate DocumentDataProvider implementation for a given Source.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a SourceHandle from a given Source.
    void
    read(com.levigo.jadice.document.read.Reader reader, S source)
    Reads a part of the document to load.
    void
    recover(com.levigo.jadice.document.read.Reader reader, SH handle)
    Partially recovers a Document identified by the given PageSegmentHandle.
  • Method Details

    • createSourceHandle

      SH createSourceHandle(S source)
      Creates a SourceHandle from a given Source. The information required to recover the document must be stored in the PageSegmentHandle. The web toolkit server will call the recover(Reader, PageSegmentHandle) method with a PageSegmentHandle. Typical scenarios include garbage-collected documents, a server restart, or moving a request to another server for load-balancing or fail-over purposes.
      Parameters:
      source - The Source the Handle should be created from.
      Returns:
      The PageSegmentHandle to recover the document stream.
    • read

      void read(com.levigo.jadice.document.read.Reader reader, S source) throws com.levigo.jadice.document.JadiceException, IOException
      Reads a part of the document to load. This will be used to initially load the document when a client initiates displaying a document. Please note, that the read method will be called only once during a server-side document read lifecycle. Subsequent reads will trigger the recover method, not a read.
      Parameters:
      reader - The Reader to load the document.
      source - The Source to read the document from, including a unique identifier.
      Throws:
      com.levigo.jadice.document.JadiceException - Any rendering exceptions reported by the Jadice core.
      IOException - Other exceptions while reading the document.
    • recover

      void recover(com.levigo.jadice.document.read.Reader reader, SH handle) throws RecoverFailedException, com.levigo.jadice.document.JadiceException
      Partially recovers a Document identified by the given PageSegmentHandle. Sometimes, client applications may request Document instances that have either been removed from cache, garbage-collected due to long inactivity or in consequence of a server switch. This method will be used for subsequent document reads.
      Parameters:
      reader - The Reader to load the Document with
      handle - The information specifying which Document to recover
      Throws:
      RecoverFailedException - Thrown if the document cannot be recovered.
      com.levigo.jadice.document.JadiceException - Any rendering exceptions reported by the Jadice core.