net.sf.ehcache.hibernate
Class Provider

java.lang.Object
  extended bynet.sf.ehcache.hibernate.Provider
All Implemented Interfaces:
net.sf.hibernate.cache.CacheProvider

public class Provider
extends java.lang.Object
implements net.sf.hibernate.cache.CacheProvider

Cache Provider plugin for Hibernate Use hibernate.cache.provider_class=net.sf.ehcache.hibernate.Provider in Hibernate 2.1 or later.

Version:
$Id: Provider.java,v 1.4 2003/12/04 15:30:05 oneovthafew Exp $
Author:
Greg Luck

Constructor Summary
Provider()
           
 
Method Summary
 net.sf.hibernate.cache.Cache buildCache(java.lang.String name, java.util.Properties properties)
          Builds a Cache.
 long nextTimestamp()
          Returns the next timestamp.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Provider

public Provider()
Method Detail

buildCache

public net.sf.hibernate.cache.Cache buildCache(java.lang.String name,
                                               java.util.Properties properties)
                                        throws net.sf.hibernate.cache.CacheException
Builds a Cache.

Even though this method provides properties, they are not used. Properties for EHCache are specified in the ehcache.xml file. Configuration will be read from ehcache.xml for a cache declaration where the name attribute matches the name parameter in this builder.

Specified by:
buildCache in interface net.sf.hibernate.cache.CacheProvider
Parameters:
name - the name of the cache. Must match a cache configured in ehcache.xml
properties - not used
Returns:
a newly built cache will be built and initialised
Throws:
net.sf.hibernate.cache.CacheException - inter alia, if a cache of the same name already exists

nextTimestamp

public long nextTimestamp()
Returns the next timestamp.

Specified by:
nextTimestamp in interface net.sf.hibernate.cache.CacheProvider