Java Doc for EhCacheFactoryBean.java in  » J2EE » spring-framework-2.0.6 » org » springframework » cache » ehcache » 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
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » spring framework 2.0.6 » org.springframework.cache.ehcache 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.springframework.cache.ehcache.EhCacheFactoryBean

EhCacheFactoryBean
public class EhCacheFactoryBean implements FactoryBean,BeanNameAware,InitializingBean(Code)
FactoryBean that creates a named EHCache net.sf.ehcache.Cache instance (or a decorator that implements the net.sf.ehcache.Ehcache interface), representing a cache region within an EHCache net.sf.ehcache.CacheManager .

If the specified named cache is not configured in the cache configuration descriptor, this FactoryBean will construct an instance of a Cache with the provided name and the specified cache properties and add it to the CacheManager for later retrieval. If some or all properties are not set at configuration time, this FactoryBean will use defaults.

Note: If the named Cache instance is found, the properties will be ignored and the Cache instance will be retrieved from the CacheManager.

Note: As of Spring 2.0, this FactoryBean is based on EHCache 1.2's API (in particular the Ehcache interface and the extended Cache constructor). It is not compatible with EHCache 1.1 anymore; please upgrade to EHCache 1.2.3 or higher.
author:
   Dmitriy Kopylenko
author:
   Juergen Hoeller
since:
   1.1.1
See Also:   EhCacheFactoryBean.setCacheManager
See Also:   EhCacheManagerFactoryBean
See Also:   net.sf.ehcache.Cache



Field Summary
final protected  Loglogger
    


Method Summary
public  voidafterPropertiesSet()
    
protected  EhcachedecorateCache(Cache cache)
     Decorate the given Cache, if necessary.
public  ObjectgetObject()
    
public  ClassgetObjectType()
    
public  booleanisSingleton()
    
public  voidsetBeanName(String name)
    
public  voidsetBlocking(boolean blocking)
     Set whether to use a blocking cache that lets read attempts block until the requested element is created.
public  voidsetCacheEntryFactory(CacheEntryFactory cacheEntryFactory)
     Set an EHCache net.sf.ehcache.constructs.blocking.CacheEntryFactory to use for a self-populating cache.
public  voidsetCacheManager(CacheManager cacheManager)
     Set a CacheManager from which to retrieve a named Cache instance.
public  voidsetCacheName(String cacheName)
     Set a name for which to retrieve or create a cache instance.
public  voidsetDiskExpiryThreadIntervalSeconds(int diskExpiryThreadIntervalSeconds)
     Set the number of seconds between runs of the disk expiry thread.
public  voidsetDiskPersistent(boolean diskPersistent)
     Set whether the disk store persists between restarts of the Virtual Machine.
public  voidsetDiskStorePath(String diskStorePath)
     Set the location of temporary files for the disk store of this cache.
public  voidsetEternal(boolean eternal)
     Set whether elements are considered as eternal.
public  voidsetMaxElementsInMemory(int maxElementsInMemory)
     Specify the maximum number of cached objects in memory.
public  voidsetMemoryStoreEvictionPolicy(MemoryStoreEvictionPolicy memoryStoreEvictionPolicy)
     Set the memory style eviction policy for this cache.
public  voidsetOverflowToDisk(boolean overflowToDisk)
     Set whether elements can overflow to disk when the in-memory cache has reached the maximum size limit.
public  voidsetTimeToIdle(int timeToIdle)
     Set the time in seconds to idle for an element before it expires, that is, the maximum amount of time between accesses before an element expires. This is only used if the element is not eternal.
public  voidsetTimeToLive(int timeToLive)
     Set t he time in seconds to live for an element before it expires, i.e.

Field Detail
logger
final protected Log logger(Code)





Method Detail
afterPropertiesSet
public void afterPropertiesSet() throws CacheException, IOException(Code)



decorateCache
protected Ehcache decorateCache(Cache cache)(Code)
Decorate the given Cache, if necessary.

The default implementation simply returns the given cache object as-is.
Parameters:
  cache - the raw Cache object, based on the configuration of this FactoryBean the (potentially decorated) cache object to be registered with the CacheManager




getObject
public Object getObject()(Code)



getObjectType
public Class getObjectType()(Code)



isSingleton
public boolean isSingleton()(Code)



setBeanName
public void setBeanName(String name)(Code)



setBlocking
public void setBlocking(boolean blocking)(Code)
Set whether to use a blocking cache that lets read attempts block until the requested element is created.

If you intend to build a self-populating blocking cache, consider specifying a EhCacheFactoryBean.setCacheEntryFactory CacheEntryFactory .
See Also:   net.sf.ehcache.constructs.blocking.BlockingCache
See Also:   EhCacheFactoryBean.setCacheEntryFactory




setCacheEntryFactory
public void setCacheEntryFactory(CacheEntryFactory cacheEntryFactory)(Code)
Set an EHCache net.sf.ehcache.constructs.blocking.CacheEntryFactory to use for a self-populating cache. If such a factory is specified, the cache will be decorated with EHCache's net.sf.ehcache.constructs.blocking.SelfPopulatingCache .

The specified factory can be of type net.sf.ehcache.constructs.blocking.UpdatingCacheEntryFactory , which will lead to the use of an net.sf.ehcache.constructs.blocking.UpdatingSelfPopulatingCache .

Note: Any such self-populating cache is automatically a blocking cache.
See Also:   net.sf.ehcache.constructs.blocking.SelfPopulatingCache
See Also:   net.sf.ehcache.constructs.blocking.UpdatingSelfPopulatingCache
See Also:   net.sf.ehcache.constructs.blocking.UpdatingCacheEntryFactory




setCacheManager
public void setCacheManager(CacheManager cacheManager)(Code)
Set a CacheManager from which to retrieve a named Cache instance. By default, CacheManager.getInstance() will be called.

Note that in particular for persistent caches, it is advisable to properly handle the shutdown of the CacheManager: Set up a separate EhCacheManagerFactoryBean and pass a reference to this bean property.

A separate EhCacheManagerFactoryBean is also necessary for loading EHCache configuration from a non-default config location.
See Also:   EhCacheManagerFactoryBean
See Also:   net.sf.ehcache.CacheManager.getInstance




setCacheName
public void setCacheName(String cacheName)(Code)
Set a name for which to retrieve or create a cache instance. Default is the bean name of this EhCacheFactoryBean.



setDiskExpiryThreadIntervalSeconds
public void setDiskExpiryThreadIntervalSeconds(int diskExpiryThreadIntervalSeconds)(Code)
Set the number of seconds between runs of the disk expiry thread. The default is 120 seconds.



setDiskPersistent
public void setDiskPersistent(boolean diskPersistent)(Code)
Set whether the disk store persists between restarts of the Virtual Machine. The default is "false".



setDiskStorePath
public void setDiskStorePath(String diskStorePath)(Code)
Set the location of temporary files for the disk store of this cache. Default is the CacheManager's disk store path.



setEternal
public void setEternal(boolean eternal)(Code)
Set whether elements are considered as eternal. If "true", timeouts are ignored and the element is never expired. Default is "false".



setMaxElementsInMemory
public void setMaxElementsInMemory(int maxElementsInMemory)(Code)
Specify the maximum number of cached objects in memory. Default is 10000 elements.



setMemoryStoreEvictionPolicy
public void setMemoryStoreEvictionPolicy(MemoryStoreEvictionPolicy memoryStoreEvictionPolicy)(Code)
Set the memory style eviction policy for this cache. Supported values are "LRU", "LFU" and "FIFO", according to the constants defined in EHCache's MemoryStoreEvictionPolicy class. Default is "LRU".



setOverflowToDisk
public void setOverflowToDisk(boolean overflowToDisk)(Code)
Set whether elements can overflow to disk when the in-memory cache has reached the maximum size limit. Default is "true".



setTimeToIdle
public void setTimeToIdle(int timeToIdle)(Code)
Set the time in seconds to idle for an element before it expires, that is, the maximum amount of time between accesses before an element expires. This is only used if the element is not eternal. Default is 120 seconds.



setTimeToLive
public void setTimeToLive(int timeToLive)(Code)
Set t he time in seconds to live for an element before it expires, i.e. the maximum time between creation time and when an element expires. It is only used if the element is not eternal. Default is 120 seconds.



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 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.