org.ehcache.spi.service
Interface LocalPersistenceService

All Superinterfaces:
Service
All Known Implementing Classes:
DefaultLocalPersistenceService

public interface LocalPersistenceService
extends Service

Service to provide persistence context to caches requiring it. Will be used by caches with a disk store, whether or not the data should survive a program restart.


Method Summary
 FileBasedPersistenceContext createPersistenceContext(java.lang.Object identifier, Store.PersistentStoreConfiguration<?,?,?> storeConfiguration)
          Creates a new persistence context
 void destroyAllPersistenceContext()
          Destroys all persistence context Note that this method can be called without creating the persistence context beforehand in the same JVM.
 void destroyPersistenceContext(java.lang.Object identifier)
          Destroys the persistence context with the given identifier.
 
Methods inherited from interface org.ehcache.spi.service.Service
start, stop
 

Method Detail

createPersistenceContext

FileBasedPersistenceContext createPersistenceContext(java.lang.Object identifier,
                                                     Store.PersistentStoreConfiguration<?,?,?> storeConfiguration)
                                                     throws CachePersistenceException
Creates a new persistence context

Parameters:
identifier - the identifier to be used for the persistence context
storeConfiguration - the configuration of the Store that will use the persistence context
Returns:
a FileBasedPersistenceContext
Throws:
CachePersistenceException - if the persistence context cannot be created

destroyPersistenceContext

void destroyPersistenceContext(java.lang.Object identifier)
                               throws CachePersistenceException
Destroys the persistence context with the given identifier. Note that this method can be called without creating the persistence context beforehand in the same JVM. It will nonetheless try to delete any persistent data that could have been associated with the identifier.

Parameters:
identifier - the identifier of the persistence context
Throws:
CachePersistenceException - if the persistence context cannot be destroyed

destroyAllPersistenceContext

void destroyAllPersistenceContext()
Destroys all persistence context Note that this method can be called without creating the persistence context beforehand in the same JVM. It will nonetheless try to delete any persistent data associated with the root directory provided in the service.