Class DefaultFilePersistenceManager

java.lang.Object
org.jppf.client.persistence.DefaultFilePersistenceManager
All Implemented Interfaces:
JobPersistence<String>

public class DefaultFilePersistenceManager extends Object implements JobPersistence<String>
This implementation of JobPersistence stores jobs on the file system using Java serialization to a file for each job, and uses the jobs uuids as keys to retrieve them.

The underlying datastore is a file folder with a flat structure, where each file represents a serialized job.

This implementation will use the serialisation scheme, if any, that is configured for the JPPF client.

Note that this implementation is very naive and has a sub-optimal performance, as it stores jobs data in a synchronous, blocking way.

Author:
Laurent Cohen
  • Field Details

    • DEFAULT_PREFIX

      public static final String DEFAULT_PREFIX
      The default prefix for the files in the store.
      See Also:
    • DEFAULT_EXT

      public static final String DEFAULT_EXT
      The default extension for the files in the store.
      See Also:
  • Constructor Details

    • DefaultFilePersistenceManager

      public DefaultFilePersistenceManager(File root)
      Initialize this persistence manager with the specified root path, using DEFAULT_PREFIX as the files prefix and DEFAULT_EXT as the extension. If the root does not exist, the persistence manager attempts to create it.
      Parameters:
      root - the root path for this persistence manager, where the persisted jobs are stored.
      Throws:
      IllegalArgumentException - if the root path is invalid or could not be created.
    • DefaultFilePersistenceManager

      public DefaultFilePersistenceManager(File root, String prefix, String ext)
      Initialize this persistence manager with the specified root path, file prefix and extension. If the root does not exist, the persistence manager attempts to create it.
      Parameters:
      root - the root path for this persistence manager, where the persisted jobs are stored.
      prefix - the prefix for the names of the files in the store.
      ext - the extension for the names of the files in the store.
      Throws:
      IllegalArgumentException - if the root path is invalid or could not be created.
    • DefaultFilePersistenceManager

      public DefaultFilePersistenceManager(String root)
      Initialize this persistence manager with the specified root path, using "job" as the files prefix and ".ser" as the extension.
      Parameters:
      root - the root path for this persistence manager, where the persisted jobs are stored.
      Throws:
      IllegalArgumentException - if the root path is invalid or could not be created.
    • DefaultFilePersistenceManager

      public DefaultFilePersistenceManager(String root, String prefix, String ext)
      Initialize this persistence manager with the specified root path.
      Parameters:
      root - the root path for this persistence manager, where the persisted jobs are stored.
      prefix - the prefix for the names of the files in the store.
      ext - the extension for the names of the files in the store.
      Throws:
      IllegalArgumentException - if the root path is invalid or could not be created.
  • Method Details