org.ehcache.spi.service
Interface PersistableResourceService

All Superinterfaces:
MaintainableService, Service
All Known Subinterfaces:
LocalPersistenceService
All Known Implementing Classes:
DefaultLocalPersistenceService

public interface PersistableResourceService
extends MaintainableService

Specific interface for services that are dedicated to handling a ResourceType which is persistable.


Method Summary
 java.util.Collection<ServiceConfiguration<?>> additionalConfigurationsForPool(java.lang.String alias, ResourcePool pool)
          Enables this service to create additional configurations to enable support of the passed in resource pool in the context of the given alias.
 void create()
          Creates the persistent storage.
 void destroy(java.lang.String name)
          Destroys the persistence space with the given name.
 void destroyAll()
          Destroys all persistence spaces Note that this method can be called without creating the persistence space beforehand in the same JVM.
 boolean handlesResourceType(ResourceType resourceType)
          Indicates whether this service handles the type of resource passed in.
 
Methods inherited from interface org.ehcache.spi.service.MaintainableService
startForMaintenance
 
Methods inherited from interface org.ehcache.spi.service.Service
start, stop
 

Method Detail

handlesResourceType

boolean handlesResourceType(ResourceType resourceType)
Indicates whether this service handles the type of resource passed in.

Parameters:
resourceType - the resource type to handle
Returns:
true if this service handles this resource type, false otherwise

additionalConfigurationsForPool

java.util.Collection<ServiceConfiguration<?>> additionalConfigurationsForPool(java.lang.String alias,
                                                                              ResourcePool pool)
                                                                              throws CachePersistenceException
Enables this service to create additional configurations to enable support of the passed in resource pool in the context of the given alias.

Parameters:
alias - the alias context
pool - the resource pool
Returns:
a Collection of ServiceConfiguration, can be empty
Throws:
CachePersistenceException - in case of a persistence related problem
java.lang.IllegalArgumentException - if handlesResourceType(pool.getType) != true

destroy

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

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

create

void create()
Creates the persistent storage.


destroyAll

void destroyAll()
Destroys all persistence spaces Note that this method can be called without creating the persistence space beforehand in the same JVM. It will nonetheless try to delete any persistent data associated with the base configuration provided in the service.