Java Doc for EhCacheProvider.java in  » Cache » ehcache » net » sf » ehcache » hibernate » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Cache » ehcache » net.sf.ehcache.hibernate 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sf.ehcache.hibernate.EhCacheProvider

EhCacheProvider
final public class EhCacheProvider implements CacheProvider(Code)
Cache Provider plugin for Hibernate 3.2 and ehcache-1.2. New in this provider are ehcache support for multiple Hibernate session factories, each with its own ehcache configuration, and non Serializable keys and values. Ehcache-1.2 also has many other features such as cluster support and listeners, which can be used seamlessly simply by configurion in ehcache.xml.

Use hibernate.cache.provider_class=net.sf.ehcache.hibernate.EhCacheProvider in the Hibernate configuration to enable this provider for Hibernate's second level cache.

When configuring multiple ehcache CacheManagers, as you would where you have multiple Hibernate Configurations and multiple SessionFactories, specify in each Hibernate configuration the ehcache configuration using the property net.sf.ehcache.configurationResourceName An example to set an ehcach configuration called ehcache-2.xml would be net.sf.ehcache.configurationResourceName=/ehcache-2.xml. If the leading slash is not there one will be added. The configuration file will be looked for in the root of the classpath.

Updated for ehcache-1.2. Note this provider requires ehcache-1.2.jar. Make sure ehcache-1.1.jar or earlier is not in the classpath or it will not work.

See http://ehcache.sf.net for documentation on ehcache


author:
   Greg Luck
author:
   Emmanuel Bernard
version:
   $Id: EhCacheProvider.java 519 2007-07-27 07:11:45Z gregluck $



Field Summary
final public static  StringNET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME
     The Hibernate system property specifying the location of the ehcache configuration file name.


Method Summary
final public  CachebuildCache(String name, Properties properties)
     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.
Parameters:
  name - the name of the cache.

final public  booleanisMinimalPutsEnabledByDefault()
     Not sure what this is supposed to do.
final public  longnextTimestamp()
     Returns the next timestamp.
final public  voidstart(Properties properties)
     Callback to perform any necessary initialization of the underlying cache implementation during SessionFactory construction.
final public  voidstop()
     Callback to perform any necessary cleanup of the underlying cache implementation during SessionFactory.close().

Field Detail
NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME
final public static String NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME(Code)
The Hibernate system property specifying the location of the ehcache configuration file name.

If set to say ehcache-1.xml, ehcache-1.xml will be looked for in the root of the classpath.






Method Detail
buildCache
final public Cache buildCache(String name, Properties properties) throws CacheException(Code)
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.
Parameters:
  name - the name of the cache. Must match a cache configured in ehcache.xml
Parameters:
  properties - not used a newly built cache will be built and initialised
throws:
  org.hibernate.cache.CacheException - inter alia, if a cache of the same name already exists




isMinimalPutsEnabledByDefault
final public boolean isMinimalPutsEnabledByDefault()(Code)
Not sure what this is supposed to do. false to be safe



nextTimestamp
final public long nextTimestamp()(Code)
Returns the next timestamp.



start
final public void start(Properties properties) throws CacheException(Code)
Callback to perform any necessary initialization of the underlying cache implementation during SessionFactory construction.


Parameters:
  properties - current configuration settings.




stop
final public void stop()(Code)
Callback to perform any necessary cleanup of the underlying cache implementation during SessionFactory.close().



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2010 - 2030 Java Source and Support. All rights reserved.
All other trademarks are property of their respective owners.