mirror of https://github.com/apache/cloudstack.git
3376 lines
170 KiB
HTML
Executable File
3376 lines
170 KiB
HTML
Executable File
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<!--NewPage-->
|
|
<HTML>
|
|
<HEAD>
|
|
<!-- Generated by javadoc (build 1.5.0_13) on Sun Jul 13 13:05:38 EST 2008 -->
|
|
<TITLE>
|
|
Cache (ehcache)
|
|
</TITLE>
|
|
|
|
<META NAME="keywords" CONTENT="net.sf.ehcache.Cache class">
|
|
|
|
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
|
|
|
<SCRIPT type="text/javascript">
|
|
function windowTitle()
|
|
{
|
|
parent.document.title="Cache (ehcache)";
|
|
}
|
|
</SCRIPT>
|
|
<NOSCRIPT>
|
|
</NOSCRIPT>
|
|
|
|
</HEAD>
|
|
|
|
<BODY BGCOLOR="white" onload="windowTitle();">
|
|
|
|
|
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
|
<A NAME="navbar_top"><!-- --></A>
|
|
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
|
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
|
<TR>
|
|
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
|
<A NAME="navbar_top_firstrow"><!-- --></A>
|
|
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
|
<TR ALIGN="center" VALIGN="top">
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Cache.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
|
</TR>
|
|
</TABLE>
|
|
</TD>
|
|
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
|
<a href="/" target="_top">ehcache</a></EM>
|
|
</TD>
|
|
</TR>
|
|
|
|
<TR>
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
PREV CLASS
|
|
<A HREF="../../../net/sf/ehcache/Cache.KeyedFuture.html" title="class in net.sf.ehcache"><B>NEXT CLASS</B></A></FONT></TD>
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
<A HREF="../../../index.html?net/sf/ehcache/Cache.html" target="_top"><B>FRAMES</B></A>
|
|
<A HREF="Cache.html" target="_top"><B>NO FRAMES</B></A>
|
|
<SCRIPT type="text/javascript">
|
|
<!--
|
|
if(window==top) {
|
|
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
|
}
|
|
//-->
|
|
</SCRIPT>
|
|
<NOSCRIPT>
|
|
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
|
</NOSCRIPT>
|
|
|
|
|
|
</FONT></TD>
|
|
</TR>
|
|
<TR>
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
|
</TR>
|
|
</TABLE>
|
|
<A NAME="skip-navbar_top"></A>
|
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
|
|
|
<HR>
|
|
<!-- ======== START OF CLASS DATA ======== -->
|
|
<H2>
|
|
<FONT SIZE="-1">
|
|
net.sf.ehcache</FONT>
|
|
<BR>
|
|
Class Cache</H2>
|
|
<PRE>
|
|
java.lang.Object
|
|
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>net.sf.ehcache.Cache</B>
|
|
</PRE>
|
|
<DL>
|
|
<DT><B>All Implemented Interfaces:</B> <DD>java.lang.Cloneable, <A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></DD>
|
|
</DL>
|
|
<HR>
|
|
<DL>
|
|
<DT><PRE>public class <B>Cache</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></DL>
|
|
</PRE>
|
|
|
|
<P>
|
|
Cache is the central class in ehcache. Caches have <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache"><CODE>Element</CODE></A>s and are managed
|
|
by the <A HREF="../../../net/sf/ehcache/CacheManager.html" title="class in net.sf.ehcache"><CODE>CacheManager</CODE></A>. The Cache performs logical actions. It delegates physical
|
|
implementations to its <A HREF="../../../net/sf/ehcache/store/Store.html" title="interface in net.sf.ehcache.store"><CODE>Store</CODE></A>s.
|
|
<p/>
|
|
A reference to a Cache can be obtained through the <A HREF="../../../net/sf/ehcache/CacheManager.html" title="class in net.sf.ehcache"><CODE>CacheManager</CODE></A>. A Cache thus obtained
|
|
is guaranteed to have status <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A>. This status is checked for any method which
|
|
throws <CODE>IllegalStateException</CODE> and the same thrown if it is not alive. This would normally
|
|
happen if a call is made after <A HREF="../../../net/sf/ehcache/CacheManager.html#shutdown()"><CODE>CacheManager.shutdown()</CODE></A> is invoked.
|
|
<p/>
|
|
Cache is threadsafe.
|
|
<p/>
|
|
Statistics on cache usage are collected and made available through the <A HREF="../../../net/sf/ehcache/Cache.html#getStatistics()"><CODE>getStatistics()</CODE></A> methods.
|
|
<p/>
|
|
Various decorators are available for Cache, such as BlockingCache, SelfPopulatingCache and the dynamic proxy
|
|
ExceptionHandlingDynamicCacheProxy. See each class for details.
|
|
<P>
|
|
|
|
<P>
|
|
<DL>
|
|
<DT><B>Version:</B></DT>
|
|
<DD>$Id: Cache.java 704 2008-07-13 00:17:52Z gregluck $</DD>
|
|
<DT><B>Author:</B></DT>
|
|
<DD>Greg Luck</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<P>
|
|
<!-- ======== NESTED CLASS SUMMARY ======== -->
|
|
|
|
<A NAME="nested_class_summary"><!-- --></A>
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
|
<B>Nested Class Summary</B></FONT></TH>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>(package private) class</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.KeyedFuture.html" title="class in net.sf.ehcache">Cache.KeyedFuture</A></B></CODE>
|
|
|
|
<BR>
|
|
Used to store a future and the key it is in respect of</TD>
|
|
</TR>
|
|
</TABLE>
|
|
<!-- =========== FIELD SUMMARY =========== -->
|
|
|
|
<A NAME="field_summary"><!-- --></A>
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
|
<B>Field Summary</B></FONT></TH>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static java.lang.String</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#DEFAULT_CACHE_NAME">DEFAULT_CACHE_NAME</A></B></CODE>
|
|
|
|
<BR>
|
|
A reserved word for cache names.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static long</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#DEFAULT_EXPIRY_THREAD_INTERVAL_SECONDS">DEFAULT_EXPIRY_THREAD_INTERVAL_SECONDS</A></B></CODE>
|
|
|
|
<BR>
|
|
The default interval between runs of the expiry thread.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static java.lang.String</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#NET_SF_EHCACHE_DISABLED">NET_SF_EHCACHE_DISABLED</A></B></CODE>
|
|
|
|
<BR>
|
|
System Property based method of disabling ehcache.</TD>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
|
|
|
<A NAME="constructor_summary"><!-- --></A>
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
|
<B>Constructor Summary</B></FONT></TH>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#Cache(java.lang.String, int, boolean, boolean, long, long)">Cache</A></B>(java.lang.String name,
|
|
int maxElementsInMemory,
|
|
boolean overflowToDisk,
|
|
boolean eternal,
|
|
long timeToLiveSeconds,
|
|
long timeToIdleSeconds)</CODE>
|
|
|
|
<BR>
|
|
1.0 Constructor.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#Cache(java.lang.String, int, boolean, boolean, long, long, boolean, long)">Cache</A></B>(java.lang.String name,
|
|
int maxElementsInMemory,
|
|
boolean overflowToDisk,
|
|
boolean eternal,
|
|
long timeToLiveSeconds,
|
|
long timeToIdleSeconds,
|
|
boolean diskPersistent,
|
|
long diskExpiryThreadIntervalSeconds)</CODE>
|
|
|
|
<BR>
|
|
1.1 Constructor.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#Cache(java.lang.String, int, net.sf.ehcache.store.MemoryStoreEvictionPolicy, boolean, java.lang.String, boolean, long, long, boolean, long, net.sf.ehcache.event.RegisteredEventListeners)">Cache</A></B>(java.lang.String name,
|
|
int maxElementsInMemory,
|
|
<A HREF="../../../net/sf/ehcache/store/MemoryStoreEvictionPolicy.html" title="class in net.sf.ehcache.store">MemoryStoreEvictionPolicy</A> memoryStoreEvictionPolicy,
|
|
boolean overflowToDisk,
|
|
java.lang.String diskStorePath,
|
|
boolean eternal,
|
|
long timeToLiveSeconds,
|
|
long timeToIdleSeconds,
|
|
boolean diskPersistent,
|
|
long diskExpiryThreadIntervalSeconds,
|
|
<A HREF="../../../net/sf/ehcache/event/RegisteredEventListeners.html" title="class in net.sf.ehcache.event">RegisteredEventListeners</A> registeredEventListeners)</CODE>
|
|
|
|
<BR>
|
|
1.2 Constructor
|
|
<p/>
|
|
The <A HREF="../../../net/sf/ehcache/config/ConfigurationFactory.html" title="class in net.sf.ehcache.config"><CODE>ConfigurationFactory</CODE></A> and clients can create these.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#Cache(java.lang.String, int, net.sf.ehcache.store.MemoryStoreEvictionPolicy, boolean, java.lang.String, boolean, long, long, boolean, long, net.sf.ehcache.event.RegisteredEventListeners, net.sf.ehcache.bootstrap.BootstrapCacheLoader)">Cache</A></B>(java.lang.String name,
|
|
int maxElementsInMemory,
|
|
<A HREF="../../../net/sf/ehcache/store/MemoryStoreEvictionPolicy.html" title="class in net.sf.ehcache.store">MemoryStoreEvictionPolicy</A> memoryStoreEvictionPolicy,
|
|
boolean overflowToDisk,
|
|
java.lang.String diskStorePath,
|
|
boolean eternal,
|
|
long timeToLiveSeconds,
|
|
long timeToIdleSeconds,
|
|
boolean diskPersistent,
|
|
long diskExpiryThreadIntervalSeconds,
|
|
<A HREF="../../../net/sf/ehcache/event/RegisteredEventListeners.html" title="class in net.sf.ehcache.event">RegisteredEventListeners</A> registeredEventListeners,
|
|
<A HREF="../../../net/sf/ehcache/bootstrap/BootstrapCacheLoader.html" title="interface in net.sf.ehcache.bootstrap">BootstrapCacheLoader</A> bootstrapCacheLoader)</CODE>
|
|
|
|
<BR>
|
|
1.2.1 Constructor
|
|
<p/>
|
|
The <A HREF="../../../net/sf/ehcache/config/ConfigurationFactory.html" title="class in net.sf.ehcache.config"><CODE>ConfigurationFactory</CODE></A> and clients can create these.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#Cache(java.lang.String, int, net.sf.ehcache.store.MemoryStoreEvictionPolicy, boolean, java.lang.String, boolean, long, long, boolean, long, net.sf.ehcache.event.RegisteredEventListeners, net.sf.ehcache.bootstrap.BootstrapCacheLoader, int)">Cache</A></B>(java.lang.String name,
|
|
int maxElementsInMemory,
|
|
<A HREF="../../../net/sf/ehcache/store/MemoryStoreEvictionPolicy.html" title="class in net.sf.ehcache.store">MemoryStoreEvictionPolicy</A> memoryStoreEvictionPolicy,
|
|
boolean overflowToDisk,
|
|
java.lang.String diskStorePath,
|
|
boolean eternal,
|
|
long timeToLiveSeconds,
|
|
long timeToIdleSeconds,
|
|
boolean diskPersistent,
|
|
long diskExpiryThreadIntervalSeconds,
|
|
<A HREF="../../../net/sf/ehcache/event/RegisteredEventListeners.html" title="class in net.sf.ehcache.event">RegisteredEventListeners</A> registeredEventListeners,
|
|
<A HREF="../../../net/sf/ehcache/bootstrap/BootstrapCacheLoader.html" title="interface in net.sf.ehcache.bootstrap">BootstrapCacheLoader</A> bootstrapCacheLoader,
|
|
int maxElementsOnDisk)</CODE>
|
|
|
|
<BR>
|
|
1.2.4 Constructor
|
|
<p/>
|
|
The <A HREF="../../../net/sf/ehcache/config/ConfigurationFactory.html" title="class in net.sf.ehcache.config"><CODE>ConfigurationFactory</CODE></A> and clients can create these.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#Cache(java.lang.String, int, net.sf.ehcache.store.MemoryStoreEvictionPolicy, boolean, java.lang.String, boolean, long, long, boolean, long, net.sf.ehcache.event.RegisteredEventListeners, net.sf.ehcache.bootstrap.BootstrapCacheLoader, int, int)">Cache</A></B>(java.lang.String name,
|
|
int maxElementsInMemory,
|
|
<A HREF="../../../net/sf/ehcache/store/MemoryStoreEvictionPolicy.html" title="class in net.sf.ehcache.store">MemoryStoreEvictionPolicy</A> memoryStoreEvictionPolicy,
|
|
boolean overflowToDisk,
|
|
java.lang.String diskStorePath,
|
|
boolean eternal,
|
|
long timeToLiveSeconds,
|
|
long timeToIdleSeconds,
|
|
boolean diskPersistent,
|
|
long diskExpiryThreadIntervalSeconds,
|
|
<A HREF="../../../net/sf/ehcache/event/RegisteredEventListeners.html" title="class in net.sf.ehcache.event">RegisteredEventListeners</A> registeredEventListeners,
|
|
<A HREF="../../../net/sf/ehcache/bootstrap/BootstrapCacheLoader.html" title="interface in net.sf.ehcache.bootstrap">BootstrapCacheLoader</A> bootstrapCacheLoader,
|
|
int maxElementsOnDisk,
|
|
int diskSpoolBufferSizeMB)</CODE>
|
|
|
|
<BR>
|
|
1.2.4 Constructor
|
|
<p/>
|
|
The <A HREF="../../../net/sf/ehcache/config/ConfigurationFactory.html" title="class in net.sf.ehcache.config"><CODE>ConfigurationFactory</CODE></A> and clients can create these.</TD>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<!-- ========== METHOD SUMMARY =========== -->
|
|
|
|
<A NAME="method_summary"><!-- --></A>
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
|
<B>Method Summary</B></FONT></TH>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>(package private) edu.emory.mathcs.backport.java.util.concurrent.Future</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#asynchronousLoad(java.lang.Object, net.sf.ehcache.loader.CacheLoader, java.lang.Object)">asynchronousLoad</A></B>(java.lang.Object key,
|
|
<A HREF="../../../net/sf/ehcache/loader/CacheLoader.html" title="interface in net.sf.ehcache.loader">CacheLoader</A> specificLoader,
|
|
java.lang.Object argument)</CODE>
|
|
|
|
<BR>
|
|
Does the asynchronous loading.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>(package private) edu.emory.mathcs.backport.java.util.concurrent.Future</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#asynchronousLoadAll(java.util.Collection, java.lang.Object)">asynchronousLoadAll</A></B>(java.util.Collection keys,
|
|
java.lang.Object argument)</CODE>
|
|
|
|
<BR>
|
|
Does the asynchronous loading.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#bootstrap()">bootstrap</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Bootstrap command.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> long</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#calculateInMemorySize()">calculateInMemorySize</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Gets the size of the memory store for this cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#clearStatistics()">clearStatistics</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Resets statistics counters back to 0.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> java.lang.Object</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#clone()">clone</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Clones a cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>protected <A HREF="../../../net/sf/ehcache/store/Store.html" title="interface in net.sf.ehcache.store">Store</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#createDiskStore()">createDiskStore</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Creates a disk store when either:
|
|
|
|
overflowToDisk is enabled
|
|
diskPersistent is enabled
|
|
</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#dispose()">dispose</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Starts an orderly shutdown of the Cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#equals(java.lang.Object)">equals</A></B>(java.lang.Object object)</CODE>
|
|
|
|
<BR>
|
|
An equals method which follows the contract of <CODE>Object.equals(Object)</CODE>
|
|
<p/>
|
|
An Cache is equal to another one if it implements Ehcache and has the same GUID.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#evictExpiredElements()">evictExpiredElements</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Causes all elements stored in the Cache to be synchronously checked for expiry, and if expired, evicted.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#flush()">flush</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Flushes all cache items from memory to the disk store, and from the DiskStore to disk.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache">Element</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#get(java.lang.Object)">get</A></B>(java.lang.Object key)</CODE>
|
|
|
|
<BR>
|
|
Gets an element from the cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache">Element</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#get(java.io.Serializable)">get</A></B>(java.io.Serializable key)</CODE>
|
|
|
|
<BR>
|
|
Gets an element from the cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> java.util.Map</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getAllWithLoader(java.util.Collection, java.lang.Object)">getAllWithLoader</A></B>(java.util.Collection keys,
|
|
java.lang.Object loaderArgument)</CODE>
|
|
|
|
<BR>
|
|
Warning: This method is related to the JSR107 specification, which is in draft.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> float</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getAverageGetTime()">getAverageGetTime</A></B>()</CODE>
|
|
|
|
<BR>
|
|
The average get time in ms.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../../net/sf/ehcache/bootstrap/BootstrapCacheLoader.html" title="interface in net.sf.ehcache.bootstrap">BootstrapCacheLoader</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getBootstrapCacheLoader()">getBootstrapCacheLoader</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Accessor for the BootstrapCacheLoader associated with this cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../../net/sf/ehcache/config/CacheConfiguration.html" title="class in net.sf.ehcache.config">CacheConfiguration</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getCacheConfiguration()">getCacheConfiguration</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Gets the cache configuration this cache was created with.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../../net/sf/ehcache/event/RegisteredEventListeners.html" title="class in net.sf.ehcache.event">RegisteredEventListeners</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getCacheEventNotificationService()">getCacheEventNotificationService</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Use this to access the service in order to register and unregister listeners</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../../net/sf/ehcache/exceptionhandler/CacheExceptionHandler.html" title="interface in net.sf.ehcache.exceptionhandler">CacheExceptionHandler</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getCacheExceptionHandler()">getCacheExceptionHandler</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Gets the ExceptionHandler on this Cache, or null if there isn't one.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../../net/sf/ehcache/loader/CacheLoader.html" title="interface in net.sf.ehcache.loader">CacheLoader</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getCacheLoader()">getCacheLoader</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Gets the CacheLoader registered in this cache</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../../net/sf/ehcache/CacheManager.html" title="class in net.sf.ehcache">CacheManager</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getCacheManager()">getCacheManager</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Gets the CacheManager managing this cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> long</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getDiskExpiryThreadIntervalSeconds()">getDiskExpiryThreadIntervalSeconds</A></B>()</CODE>
|
|
|
|
<BR>
|
|
<B>Deprecated.</B> <I>Get this from the configuration</I></TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>(package private) <A HREF="../../../net/sf/ehcache/store/Store.html" title="interface in net.sf.ehcache.store">Store</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getDiskStore()">getDiskStore</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Gets the internal DiskStore.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> int</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getDiskStoreHitCount()">getDiskStoreHitCount</A></B>()</CODE>
|
|
|
|
<BR>
|
|
<B>Deprecated.</B> <I>Use <A HREF="../../../net/sf/ehcache/Statistics.html" title="class in net.sf.ehcache"><CODE>Statistics</CODE></A></I></TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> int</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getDiskStoreSize()">getDiskStoreSize</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Returns the number of elements in the disk store.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>(package private) edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getExecutorService()">getExecutorService</A></B>()</CODE>
|
|
|
|
<BR>
|
|
</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> java.lang.String</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getGuid()">getGuid</A></B>()</CODE>
|
|
|
|
<BR>
|
|
The GUID for this cache instance can be used to determine whether two cache instance references
|
|
are pointing to the same cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> int</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getHitCount()">getHitCount</A></B>()</CODE>
|
|
|
|
<BR>
|
|
<B>Deprecated.</B> <I>Use <A HREF="../../../net/sf/ehcache/Statistics.html" title="class in net.sf.ehcache"><CODE>Statistics</CODE></A></I></TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> java.util.List</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getKeys()">getKeys</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Returns a list of all element keys in the cache, whether or not they are expired.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> java.util.List</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getKeysNoDuplicateCheck()">getKeysNoDuplicateCheck</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Returns a list of all elements in the cache, whether or not they are expired.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> java.util.List</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getKeysWithExpiryCheck()">getKeysWithExpiryCheck</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Returns a list of all element keys in the cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> int</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getMaxElementsInMemory()">getMaxElementsInMemory</A></B>()</CODE>
|
|
|
|
<BR>
|
|
<B>Deprecated.</B> <I>Get this from the configuration</I></TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> int</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getMaxElementsOnDisk()">getMaxElementsOnDisk</A></B>()</CODE>
|
|
|
|
<BR>
|
|
<B>Deprecated.</B> <I>Get this from the configuration</I></TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>(package private) <A HREF="../../../net/sf/ehcache/store/MemoryStore.html" title="class in net.sf.ehcache.store">MemoryStore</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getMemoryStore()">getMemoryStore</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Gets the internal MemoryStore.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../../net/sf/ehcache/store/MemoryStoreEvictionPolicy.html" title="class in net.sf.ehcache.store">MemoryStoreEvictionPolicy</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getMemoryStoreEvictionPolicy()">getMemoryStoreEvictionPolicy</A></B>()</CODE>
|
|
|
|
<BR>
|
|
<B>Deprecated.</B> <I>Get this from the configuration</I></TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> int</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getMemoryStoreHitCount()">getMemoryStoreHitCount</A></B>()</CODE>
|
|
|
|
<BR>
|
|
<B>Deprecated.</B> <I>Use <A HREF="../../../net/sf/ehcache/Statistics.html" title="class in net.sf.ehcache"><CODE>Statistics</CODE></A></I></TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> long</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getMemoryStoreSize()">getMemoryStoreSize</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Returns the number of elements in the memory store.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> int</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getMissCountExpired()">getMissCountExpired</A></B>()</CODE>
|
|
|
|
<BR>
|
|
<B>Deprecated.</B> <I>Use <A HREF="../../../net/sf/ehcache/Statistics.html" title="class in net.sf.ehcache"><CODE>Statistics</CODE></A></I></TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> int</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getMissCountNotFound()">getMissCountNotFound</A></B>()</CODE>
|
|
|
|
<BR>
|
|
<B>Deprecated.</B> <I>Use <A HREF="../../../net/sf/ehcache/Statistics.html" title="class in net.sf.ehcache"><CODE>Statistics</CODE></A></I></TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> java.lang.String</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getName()">getName</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Gets the cache name.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache">Element</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getQuiet(java.lang.Object)">getQuiet</A></B>(java.lang.Object key)</CODE>
|
|
|
|
<BR>
|
|
Gets an element from the cache, without updating Element statistics.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache">Element</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getQuiet(java.io.Serializable)">getQuiet</A></B>(java.io.Serializable key)</CODE>
|
|
|
|
<BR>
|
|
Gets an element from the cache, without updating Element statistics.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> int</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getSize()">getSize</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Gets the size of the cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../../net/sf/ehcache/Statistics.html" title="class in net.sf.ehcache">Statistics</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getStatistics()">getStatistics</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Gets an immutable Statistics object representing the Cache statistics at the time.
|
|
<p/>
|
|
Note, the <A HREF="../../../net/sf/ehcache/Cache.html#getSize()"><CODE>getSize()</CODE></A> method will have the same value as the size reported by Statistics
|
|
for the statistics accuracy of <A HREF="../../../net/sf/ehcache/Statistics.html#STATISTICS_ACCURACY_BEST_EFFORT"><CODE>Statistics.STATISTICS_ACCURACY_BEST_EFFORT</CODE></A>.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> int</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getStatisticsAccuracy()">getStatisticsAccuracy</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Accurately measuring statistics can be expensive.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../../net/sf/ehcache/Status.html" title="class in net.sf.ehcache">Status</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getStatus()">getStatus</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Gets the status attribute of the Cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> long</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getTimeToIdleSeconds()">getTimeToIdleSeconds</A></B>()</CODE>
|
|
|
|
<BR>
|
|
<B>Deprecated.</B> <I>Get this from the configuration</I></TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> long</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getTimeToLiveSeconds()">getTimeToLiveSeconds</A></B>()</CODE>
|
|
|
|
<BR>
|
|
<B>Deprecated.</B> <I>Get this from the configuration</I></TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache">Element</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#getWithLoader(java.lang.Object, net.sf.ehcache.loader.CacheLoader, java.lang.Object)">getWithLoader</A></B>(java.lang.Object key,
|
|
<A HREF="../../../net/sf/ehcache/loader/CacheLoader.html" title="interface in net.sf.ehcache.loader">CacheLoader</A> loader,
|
|
java.lang.Object loaderArgument)</CODE>
|
|
|
|
<BR>
|
|
Warning: This method is related to the JSR107 specification, which is in draft.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> int</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#hashCode()">hashCode</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Returns a hash code value for the object.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#initialise()">initialise</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Newly created caches do not have a <A HREF="../../../net/sf/ehcache/store/MemoryStore.html" title="class in net.sf.ehcache.store"><CODE>MemoryStore</CODE></A> or a <A HREF="../../../net/sf/ehcache/store/DiskStore.html" title="class in net.sf.ehcache.store"><CODE>DiskStore</CODE></A>.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#isDisabled()">isDisabled</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Whether this cache is disabled.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#isDiskPersistent()">isDiskPersistent</A></B>()</CODE>
|
|
|
|
<BR>
|
|
<B>Deprecated.</B> <I>Get this from the configuration *</I></TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>protected boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#isDiskStore()">isDiskStore</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Whether this cache uses a disk store</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#isElementInMemory(java.lang.Object)">isElementInMemory</A></B>(java.lang.Object key)</CODE>
|
|
|
|
<BR>
|
|
Whether an Element is stored in the cache in Memory, indicating a very low cost of retrieval.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#isElementInMemory(java.io.Serializable)">isElementInMemory</A></B>(java.io.Serializable key)</CODE>
|
|
|
|
<BR>
|
|
Whether an Element is stored in the cache in Memory, indicating a very low cost of retrieval.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#isElementOnDisk(java.lang.Object)">isElementOnDisk</A></B>(java.lang.Object key)</CODE>
|
|
|
|
<BR>
|
|
Whether an Element is stored in the cache on Disk, indicating a higher cost of retrieval.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#isElementOnDisk(java.io.Serializable)">isElementOnDisk</A></B>(java.io.Serializable key)</CODE>
|
|
|
|
<BR>
|
|
Whether an Element is stored in the cache on Disk, indicating a higher cost of retrieval.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#isEternal()">isEternal</A></B>()</CODE>
|
|
|
|
<BR>
|
|
<B>Deprecated.</B> <I>Get this from the configuration</I></TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#isExpired(net.sf.ehcache.Element)">isExpired</A></B>(<A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache">Element</A> element)</CODE>
|
|
|
|
<BR>
|
|
Checks whether this cache element has expired.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#isKeyInCache(java.lang.Object)">isKeyInCache</A></B>(java.lang.Object key)</CODE>
|
|
|
|
<BR>
|
|
An inexpensive check to see if the key exists in the cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#isOverflowToDisk()">isOverflowToDisk</A></B>()</CODE>
|
|
|
|
<BR>
|
|
<B>Deprecated.</B> <I>Get this from the configuration</I></TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#isValueInCache(java.lang.Object)">isValueInCache</A></B>(java.lang.Object value)</CODE>
|
|
|
|
<BR>
|
|
An extremely expensive check to see if the value exists in the cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#load(java.lang.Object)">load</A></B>(java.lang.Object key)</CODE>
|
|
|
|
<BR>
|
|
Warning: This method is related to the JSR107 specification, which is in draft.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#loadAll(java.util.Collection, java.lang.Object)">loadAll</A></B>(java.util.Collection keys,
|
|
java.lang.Object argument)</CODE>
|
|
|
|
<BR>
|
|
Warning: This method is related to the JSR107 specification, which is in draft.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#put(net.sf.ehcache.Element)">put</A></B>(<A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache">Element</A> element)</CODE>
|
|
|
|
<BR>
|
|
Put an element in the cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#put(net.sf.ehcache.Element, boolean)">put</A></B>(<A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache">Element</A> element,
|
|
boolean doNotNotifyCacheReplicators)</CODE>
|
|
|
|
<BR>
|
|
Put an element in the cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#putQuiet(net.sf.ehcache.Element)">putQuiet</A></B>(<A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache">Element</A> element)</CODE>
|
|
|
|
<BR>
|
|
Put an element in the cache, without updating statistics, or updating listeners.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#registerCacheExtension(net.sf.ehcache.extension.CacheExtension)">registerCacheExtension</A></B>(<A HREF="../../../net/sf/ehcache/extension/CacheExtension.html" title="interface in net.sf.ehcache.extension">CacheExtension</A> cacheExtension)</CODE>
|
|
|
|
<BR>
|
|
Register a <A HREF="../../../net/sf/ehcache/extension/CacheExtension.html" title="interface in net.sf.ehcache.extension"><CODE>CacheExtension</CODE></A> with the cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#remove(java.lang.Object)">remove</A></B>(java.lang.Object key)</CODE>
|
|
|
|
<BR>
|
|
Removes an <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache"><CODE>Element</CODE></A> from the Cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#remove(java.lang.Object, boolean)">remove</A></B>(java.lang.Object key,
|
|
boolean doNotNotifyCacheReplicators)</CODE>
|
|
|
|
<BR>
|
|
Removes an <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache"><CODE>Element</CODE></A> from the Cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#remove(java.io.Serializable)">remove</A></B>(java.io.Serializable key)</CODE>
|
|
|
|
<BR>
|
|
Removes an <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache"><CODE>Element</CODE></A> from the Cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#remove(java.io.Serializable, boolean)">remove</A></B>(java.io.Serializable key,
|
|
boolean doNotNotifyCacheReplicators)</CODE>
|
|
|
|
<BR>
|
|
Removes an <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache"><CODE>Element</CODE></A> from the Cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#removeAll()">removeAll</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Removes all cached items.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#removeAll(boolean)">removeAll</A></B>(boolean doNotNotifyCacheReplicators)</CODE>
|
|
|
|
<BR>
|
|
Removes all cached items.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#removeQuiet(java.lang.Object)">removeQuiet</A></B>(java.lang.Object key)</CODE>
|
|
|
|
<BR>
|
|
Removes an <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache"><CODE>Element</CODE></A> from the Cache, without notifying listeners.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> boolean</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#removeQuiet(java.io.Serializable)">removeQuiet</A></B>(java.io.Serializable key)</CODE>
|
|
|
|
<BR>
|
|
Removes an <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache"><CODE>Element</CODE></A> from the Cache, without notifying listeners.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#setBootstrapCacheLoader(net.sf.ehcache.bootstrap.BootstrapCacheLoader)">setBootstrapCacheLoader</A></B>(<A HREF="../../../net/sf/ehcache/bootstrap/BootstrapCacheLoader.html" title="interface in net.sf.ehcache.bootstrap">BootstrapCacheLoader</A> bootstrapCacheLoader)</CODE>
|
|
|
|
<BR>
|
|
Sets the bootstrap cache loader.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#setCacheExceptionHandler(net.sf.ehcache.exceptionhandler.CacheExceptionHandler)">setCacheExceptionHandler</A></B>(<A HREF="../../../net/sf/ehcache/exceptionhandler/CacheExceptionHandler.html" title="interface in net.sf.ehcache.exceptionhandler">CacheExceptionHandler</A> cacheExceptionHandler)</CODE>
|
|
|
|
<BR>
|
|
Sets an ExceptionHandler on the Cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#setCacheLoader(net.sf.ehcache.loader.CacheLoader)">setCacheLoader</A></B>(<A HREF="../../../net/sf/ehcache/loader/CacheLoader.html" title="interface in net.sf.ehcache.loader">CacheLoader</A> cacheLoader)</CODE>
|
|
|
|
<BR>
|
|
Setter for the CacheLoader.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#setCacheManager(net.sf.ehcache.CacheManager)">setCacheManager</A></B>(<A HREF="../../../net/sf/ehcache/CacheManager.html" title="class in net.sf.ehcache">CacheManager</A> cacheManager)</CODE>
|
|
|
|
<BR>
|
|
For use by CacheManager.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#setDisabled(boolean)">setDisabled</A></B>(boolean disabled)</CODE>
|
|
|
|
<BR>
|
|
Disables or enables this cache.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#setDiskStorePath(java.lang.String)">setDiskStorePath</A></B>(java.lang.String diskStorePath)</CODE>
|
|
|
|
<BR>
|
|
DiskStore paths can conflict between CacheManager instances.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#setName(java.lang.String)">setName</A></B>(java.lang.String name)</CODE>
|
|
|
|
<BR>
|
|
Sets the cache name which will name.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#setStatisticsAccuracy(int)">setStatisticsAccuracy</A></B>(int statisticsAccuracy)</CODE>
|
|
|
|
<BR>
|
|
Sets the statistics accuracy.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> java.lang.String</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#toString()">toString</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Returns a <CODE>String</CODE> representation of <A HREF="../../../net/sf/ehcache/Cache.html" title="class in net.sf.ehcache"><CODE>Cache</CODE></A>.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../net/sf/ehcache/Cache.html#unregisterCacheExtension(net.sf.ehcache.extension.CacheExtension)">unregisterCacheExtension</A></B>(<A HREF="../../../net/sf/ehcache/extension/CacheExtension.html" title="interface in net.sf.ehcache.extension">CacheExtension</A> cacheExtension)</CODE>
|
|
|
|
<BR>
|
|
Unregister a <A HREF="../../../net/sf/ehcache/extension/CacheExtension.html" title="interface in net.sf.ehcache.extension"><CODE>CacheExtension</CODE></A> with the cache.</TD>
|
|
</TR>
|
|
</TABLE>
|
|
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
|
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD><CODE>finalize, getClass, notify, notifyAll, wait, wait, wait</CODE></TD>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<P>
|
|
|
|
<!-- ============ FIELD DETAIL =========== -->
|
|
|
|
<A NAME="field_detail"><!-- --></A>
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
|
<B>Field Detail</B></FONT></TH>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<A NAME="DEFAULT_CACHE_NAME"><!-- --></A><H3>
|
|
DEFAULT_CACHE_NAME</H3>
|
|
<PRE>
|
|
public static final java.lang.String <B>DEFAULT_CACHE_NAME</B></PRE>
|
|
<DL>
|
|
<DD>A reserved word for cache names. It denotes a default configuration
|
|
which is applied to caches created without configuration.
|
|
<P>
|
|
<DL>
|
|
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#net.sf.ehcache.Cache.DEFAULT_CACHE_NAME">Constant Field Values</A></DL>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="NET_SF_EHCACHE_DISABLED"><!-- --></A><H3>
|
|
NET_SF_EHCACHE_DISABLED</H3>
|
|
<PRE>
|
|
public static final java.lang.String <B>NET_SF_EHCACHE_DISABLED</B></PRE>
|
|
<DL>
|
|
<DD>System Property based method of disabling ehcache. If disabled no elements will be added to a cache.
|
|
<p/>
|
|
Set the property "net.sf.ehcache.disabled=true" to disable ehcache.
|
|
<p/>
|
|
This can easily be done using <code>java -Dnet.sf.ehcache.disabled=true</code> in the command line.
|
|
<P>
|
|
<DL>
|
|
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#net.sf.ehcache.Cache.NET_SF_EHCACHE_DISABLED">Constant Field Values</A></DL>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="DEFAULT_EXPIRY_THREAD_INTERVAL_SECONDS"><!-- --></A><H3>
|
|
DEFAULT_EXPIRY_THREAD_INTERVAL_SECONDS</H3>
|
|
<PRE>
|
|
public static final long <B>DEFAULT_EXPIRY_THREAD_INTERVAL_SECONDS</B></PRE>
|
|
<DL>
|
|
<DD>The default interval between runs of the expiry thread.
|
|
<P>
|
|
<DL>
|
|
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#net.sf.ehcache.Cache.DEFAULT_EXPIRY_THREAD_INTERVAL_SECONDS">Constant Field Values</A></DL>
|
|
</DL>
|
|
|
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
|
|
|
<A NAME="constructor_detail"><!-- --></A>
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
|
<B>Constructor Detail</B></FONT></TH>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<A NAME="Cache(java.lang.String, int, boolean, boolean, long, long)"><!-- --></A><H3>
|
|
Cache</H3>
|
|
<PRE>
|
|
public <B>Cache</B>(java.lang.String name,
|
|
int maxElementsInMemory,
|
|
boolean overflowToDisk,
|
|
boolean eternal,
|
|
long timeToLiveSeconds,
|
|
long timeToIdleSeconds)</PRE>
|
|
<DL>
|
|
<DD>1.0 Constructor.
|
|
<p/>
|
|
The <A HREF="../../../net/sf/ehcache/config/ConfigurationFactory.html" title="class in net.sf.ehcache.config"><CODE>ConfigurationFactory</CODE></A> and clients can create these.
|
|
<p/>
|
|
A client can specify their own settings here and pass the <A HREF="../../../net/sf/ehcache/Cache.html" title="class in net.sf.ehcache"><CODE>Cache</CODE></A> object
|
|
into <A HREF="../../../net/sf/ehcache/CacheManager.html#addCache(java.lang.String)"><CODE>CacheManager.addCache(java.lang.String)</CODE></A> to specify parameters other than the defaults.
|
|
<p/>
|
|
Only the CacheManager can initialise them.
|
|
<p/>
|
|
This constructor creates disk stores, if specified, that do not persist between restarts.
|
|
<p/>
|
|
The default expiry thread interval of 120 seconds is used. This is the interval between runs
|
|
of the expiry thread, where it checks the disk store for expired elements. It is not the
|
|
the timeToLiveSeconds.
|
|
<P>
|
|
<DL>
|
|
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the cache. Note that "default" is a reserved name for the defaultCache.<DD><CODE>maxElementsInMemory</CODE> - the maximum number of elements in memory, before they are evicted<DD><CODE>overflowToDisk</CODE> - whether to use the disk store<DD><CODE>eternal</CODE> - whether the elements in the cache are eternal, i.e. never expire<DD><CODE>timeToLiveSeconds</CODE> - the default amount of time to live for an element from its creation date<DD><CODE>timeToIdleSeconds</CODE> - the default amount of time to live for an element from its last accessed or modified date<DT><B>Since:</B></DT>
|
|
<DD>1.0</DD>
|
|
</DL>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="Cache(java.lang.String, int, boolean, boolean, long, long, boolean, long)"><!-- --></A><H3>
|
|
Cache</H3>
|
|
<PRE>
|
|
public <B>Cache</B>(java.lang.String name,
|
|
int maxElementsInMemory,
|
|
boolean overflowToDisk,
|
|
boolean eternal,
|
|
long timeToLiveSeconds,
|
|
long timeToIdleSeconds,
|
|
boolean diskPersistent,
|
|
long diskExpiryThreadIntervalSeconds)</PRE>
|
|
<DL>
|
|
<DD>1.1 Constructor.
|
|
<p/>
|
|
The <A HREF="../../../net/sf/ehcache/config/ConfigurationFactory.html" title="class in net.sf.ehcache.config"><CODE>ConfigurationFactory</CODE></A> and clients can create these.
|
|
<p/>
|
|
A client can specify their own settings here and pass the <A HREF="../../../net/sf/ehcache/Cache.html" title="class in net.sf.ehcache"><CODE>Cache</CODE></A> object
|
|
into <A HREF="../../../net/sf/ehcache/CacheManager.html#addCache(java.lang.String)"><CODE>CacheManager.addCache(java.lang.String)</CODE></A> to specify parameters other than the defaults.
|
|
<p/>
|
|
Only the CacheManager can initialise them.
|
|
<P>
|
|
<DL>
|
|
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the cache. Note that "default" is a reserved name for the defaultCache.<DD><CODE>maxElementsInMemory</CODE> - the maximum number of elements in memory, before they are evicted<DD><CODE>overflowToDisk</CODE> - whether to use the disk store<DD><CODE>eternal</CODE> - whether the elements in the cache are eternal, i.e. never expire<DD><CODE>timeToLiveSeconds</CODE> - the default amount of time to live for an element from its creation date<DD><CODE>timeToIdleSeconds</CODE> - the default amount of time to live for an element from its last accessed or modified date<DD><CODE>diskPersistent</CODE> - whether to persist the cache to disk between JVM restarts<DD><CODE>diskExpiryThreadIntervalSeconds</CODE> - how often to run the disk store expiry thread. A large number of 120 seconds plus is recommended<DT><B>Since:</B></DT>
|
|
<DD>1.1</DD>
|
|
</DL>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="Cache(java.lang.String, int, net.sf.ehcache.store.MemoryStoreEvictionPolicy, boolean, java.lang.String, boolean, long, long, boolean, long, net.sf.ehcache.event.RegisteredEventListeners)"><!-- --></A><H3>
|
|
Cache</H3>
|
|
<PRE>
|
|
public <B>Cache</B>(java.lang.String name,
|
|
int maxElementsInMemory,
|
|
<A HREF="../../../net/sf/ehcache/store/MemoryStoreEvictionPolicy.html" title="class in net.sf.ehcache.store">MemoryStoreEvictionPolicy</A> memoryStoreEvictionPolicy,
|
|
boolean overflowToDisk,
|
|
java.lang.String diskStorePath,
|
|
boolean eternal,
|
|
long timeToLiveSeconds,
|
|
long timeToIdleSeconds,
|
|
boolean diskPersistent,
|
|
long diskExpiryThreadIntervalSeconds,
|
|
<A HREF="../../../net/sf/ehcache/event/RegisteredEventListeners.html" title="class in net.sf.ehcache.event">RegisteredEventListeners</A> registeredEventListeners)</PRE>
|
|
<DL>
|
|
<DD>1.2 Constructor
|
|
<p/>
|
|
The <A HREF="../../../net/sf/ehcache/config/ConfigurationFactory.html" title="class in net.sf.ehcache.config"><CODE>ConfigurationFactory</CODE></A> and clients can create these.
|
|
<p/>
|
|
A client can specify their own settings here and pass the <A HREF="../../../net/sf/ehcache/Cache.html" title="class in net.sf.ehcache"><CODE>Cache</CODE></A> object
|
|
into <A HREF="../../../net/sf/ehcache/CacheManager.html#addCache(java.lang.String)"><CODE>CacheManager.addCache(java.lang.String)</CODE></A> to specify parameters other than the defaults.
|
|
<p/>
|
|
Only the CacheManager can initialise them.
|
|
<P>
|
|
<DL>
|
|
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the cache. Note that "default" is a reserved name for the defaultCache.<DD><CODE>maxElementsInMemory</CODE> - the maximum number of elements in memory, before they are evicted<DD><CODE>memoryStoreEvictionPolicy</CODE> - one of LRU, LFU and FIFO. Optionally null, in which case it will be set to LRU.<DD><CODE>overflowToDisk</CODE> - whether to use the disk store<DD><CODE>diskStorePath</CODE> - this parameter is ignored. CacheManager sets it using setter injection.<DD><CODE>eternal</CODE> - whether the elements in the cache are eternal, i.e. never expire<DD><CODE>timeToLiveSeconds</CODE> - the default amount of time to live for an element from its creation date<DD><CODE>timeToIdleSeconds</CODE> - the default amount of time to live for an element from its last accessed or modified date<DD><CODE>diskPersistent</CODE> - whether to persist the cache to disk between JVM restarts<DD><CODE>diskExpiryThreadIntervalSeconds</CODE> - how often to run the disk store expiry thread. A large number of 120 seconds plus is recommended<DD><CODE>registeredEventListeners</CODE> - a notification service. Optionally null, in which case a new
|
|
one with no registered listeners will be created.<DT><B>Since:</B></DT>
|
|
<DD>1.2</DD>
|
|
</DL>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="Cache(java.lang.String, int, net.sf.ehcache.store.MemoryStoreEvictionPolicy, boolean, java.lang.String, boolean, long, long, boolean, long, net.sf.ehcache.event.RegisteredEventListeners, net.sf.ehcache.bootstrap.BootstrapCacheLoader)"><!-- --></A><H3>
|
|
Cache</H3>
|
|
<PRE>
|
|
public <B>Cache</B>(java.lang.String name,
|
|
int maxElementsInMemory,
|
|
<A HREF="../../../net/sf/ehcache/store/MemoryStoreEvictionPolicy.html" title="class in net.sf.ehcache.store">MemoryStoreEvictionPolicy</A> memoryStoreEvictionPolicy,
|
|
boolean overflowToDisk,
|
|
java.lang.String diskStorePath,
|
|
boolean eternal,
|
|
long timeToLiveSeconds,
|
|
long timeToIdleSeconds,
|
|
boolean diskPersistent,
|
|
long diskExpiryThreadIntervalSeconds,
|
|
<A HREF="../../../net/sf/ehcache/event/RegisteredEventListeners.html" title="class in net.sf.ehcache.event">RegisteredEventListeners</A> registeredEventListeners,
|
|
<A HREF="../../../net/sf/ehcache/bootstrap/BootstrapCacheLoader.html" title="interface in net.sf.ehcache.bootstrap">BootstrapCacheLoader</A> bootstrapCacheLoader)</PRE>
|
|
<DL>
|
|
<DD>1.2.1 Constructor
|
|
<p/>
|
|
The <A HREF="../../../net/sf/ehcache/config/ConfigurationFactory.html" title="class in net.sf.ehcache.config"><CODE>ConfigurationFactory</CODE></A> and clients can create these.
|
|
<p/>
|
|
A client can specify their own settings here and pass the <A HREF="../../../net/sf/ehcache/Cache.html" title="class in net.sf.ehcache"><CODE>Cache</CODE></A> object
|
|
into <A HREF="../../../net/sf/ehcache/CacheManager.html#addCache(java.lang.String)"><CODE>CacheManager.addCache(java.lang.String)</CODE></A> to specify parameters other than the defaults.
|
|
<p/>
|
|
Only the CacheManager can initialise them.
|
|
<P>
|
|
<DL>
|
|
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the cache. Note that "default" is a reserved name for the defaultCache.<DD><CODE>maxElementsInMemory</CODE> - the maximum number of elements in memory, before they are evicted<DD><CODE>memoryStoreEvictionPolicy</CODE> - one of LRU, LFU and FIFO. Optionally null, in which case it will be set to LRU.<DD><CODE>overflowToDisk</CODE> - whether to use the disk store<DD><CODE>diskStorePath</CODE> - this parameter is ignored. CacheManager sets it using setter injection.<DD><CODE>eternal</CODE> - whether the elements in the cache are eternal, i.e. never expire<DD><CODE>timeToLiveSeconds</CODE> - the default amount of time to live for an element from its creation date<DD><CODE>timeToIdleSeconds</CODE> - the default amount of time to live for an element from its last accessed or modified date<DD><CODE>diskPersistent</CODE> - whether to persist the cache to disk between JVM restarts<DD><CODE>diskExpiryThreadIntervalSeconds</CODE> - how often to run the disk store expiry thread. A large number of 120 seconds plus is recommended<DD><CODE>registeredEventListeners</CODE> - a notification service. Optionally null, in which case a new one with no registered listeners will be created.<DD><CODE>bootstrapCacheLoader</CODE> - the BootstrapCacheLoader to use to populate the cache when it is first initialised. Null if none is required.<DT><B>Since:</B></DT>
|
|
<DD>1.2.1</DD>
|
|
</DL>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="Cache(java.lang.String, int, net.sf.ehcache.store.MemoryStoreEvictionPolicy, boolean, java.lang.String, boolean, long, long, boolean, long, net.sf.ehcache.event.RegisteredEventListeners, net.sf.ehcache.bootstrap.BootstrapCacheLoader, int)"><!-- --></A><H3>
|
|
Cache</H3>
|
|
<PRE>
|
|
public <B>Cache</B>(java.lang.String name,
|
|
int maxElementsInMemory,
|
|
<A HREF="../../../net/sf/ehcache/store/MemoryStoreEvictionPolicy.html" title="class in net.sf.ehcache.store">MemoryStoreEvictionPolicy</A> memoryStoreEvictionPolicy,
|
|
boolean overflowToDisk,
|
|
java.lang.String diskStorePath,
|
|
boolean eternal,
|
|
long timeToLiveSeconds,
|
|
long timeToIdleSeconds,
|
|
boolean diskPersistent,
|
|
long diskExpiryThreadIntervalSeconds,
|
|
<A HREF="../../../net/sf/ehcache/event/RegisteredEventListeners.html" title="class in net.sf.ehcache.event">RegisteredEventListeners</A> registeredEventListeners,
|
|
<A HREF="../../../net/sf/ehcache/bootstrap/BootstrapCacheLoader.html" title="interface in net.sf.ehcache.bootstrap">BootstrapCacheLoader</A> bootstrapCacheLoader,
|
|
int maxElementsOnDisk)</PRE>
|
|
<DL>
|
|
<DD>1.2.4 Constructor
|
|
<p/>
|
|
The <A HREF="../../../net/sf/ehcache/config/ConfigurationFactory.html" title="class in net.sf.ehcache.config"><CODE>ConfigurationFactory</CODE></A> and clients can create these.
|
|
<p/>
|
|
A client can specify their own settings here and pass the <A HREF="../../../net/sf/ehcache/Cache.html" title="class in net.sf.ehcache"><CODE>Cache</CODE></A> object
|
|
into <A HREF="../../../net/sf/ehcache/CacheManager.html#addCache(java.lang.String)"><CODE>CacheManager.addCache(java.lang.String)</CODE></A> to specify parameters other than the defaults.
|
|
<p/>
|
|
Only the CacheManager can initialise them.
|
|
<P>
|
|
<DL>
|
|
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the cache. Note that "default" is a reserved name for the defaultCache.<DD><CODE>maxElementsInMemory</CODE> - the maximum number of elements in memory, before they are evicted<DD><CODE>memoryStoreEvictionPolicy</CODE> - one of LRU, LFU and FIFO. Optionally null, in which case it will be set to LRU.<DD><CODE>overflowToDisk</CODE> - whether to use the disk store<DD><CODE>diskStorePath</CODE> - this parameter is ignored. CacheManager sets it using setter injection.<DD><CODE>eternal</CODE> - whether the elements in the cache are eternal, i.e. never expire<DD><CODE>timeToLiveSeconds</CODE> - the default amount of time to live for an element from its creation date<DD><CODE>timeToIdleSeconds</CODE> - the default amount of time to live for an element from its last accessed or modified date<DD><CODE>diskPersistent</CODE> - whether to persist the cache to disk between JVM restarts<DD><CODE>diskExpiryThreadIntervalSeconds</CODE> - how often to run the disk store expiry thread. A large number of 120 seconds plus is recommended<DD><CODE>registeredEventListeners</CODE> - a notification service. Optionally null, in which case a new one with no registered listeners will be created.<DD><CODE>bootstrapCacheLoader</CODE> - the BootstrapCacheLoader to use to populate the cache when it is first initialised. Null if none is required.<DT><B>Since:</B></DT>
|
|
<DD>1.2.4</DD>
|
|
</DL>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="Cache(java.lang.String, int, net.sf.ehcache.store.MemoryStoreEvictionPolicy, boolean, java.lang.String, boolean, long, long, boolean, long, net.sf.ehcache.event.RegisteredEventListeners, net.sf.ehcache.bootstrap.BootstrapCacheLoader, int, int)"><!-- --></A><H3>
|
|
Cache</H3>
|
|
<PRE>
|
|
public <B>Cache</B>(java.lang.String name,
|
|
int maxElementsInMemory,
|
|
<A HREF="../../../net/sf/ehcache/store/MemoryStoreEvictionPolicy.html" title="class in net.sf.ehcache.store">MemoryStoreEvictionPolicy</A> memoryStoreEvictionPolicy,
|
|
boolean overflowToDisk,
|
|
java.lang.String diskStorePath,
|
|
boolean eternal,
|
|
long timeToLiveSeconds,
|
|
long timeToIdleSeconds,
|
|
boolean diskPersistent,
|
|
long diskExpiryThreadIntervalSeconds,
|
|
<A HREF="../../../net/sf/ehcache/event/RegisteredEventListeners.html" title="class in net.sf.ehcache.event">RegisteredEventListeners</A> registeredEventListeners,
|
|
<A HREF="../../../net/sf/ehcache/bootstrap/BootstrapCacheLoader.html" title="interface in net.sf.ehcache.bootstrap">BootstrapCacheLoader</A> bootstrapCacheLoader,
|
|
int maxElementsOnDisk,
|
|
int diskSpoolBufferSizeMB)</PRE>
|
|
<DL>
|
|
<DD>1.2.4 Constructor
|
|
<p/>
|
|
The <A HREF="../../../net/sf/ehcache/config/ConfigurationFactory.html" title="class in net.sf.ehcache.config"><CODE>ConfigurationFactory</CODE></A> and clients can create these.
|
|
<p/>
|
|
A client can specify their own settings here and pass the <A HREF="../../../net/sf/ehcache/Cache.html" title="class in net.sf.ehcache"><CODE>Cache</CODE></A> object
|
|
into <A HREF="../../../net/sf/ehcache/CacheManager.html#addCache(java.lang.String)"><CODE>CacheManager.addCache(java.lang.String)</CODE></A> to specify parameters other than the defaults.
|
|
<p/>
|
|
Only the CacheManager can initialise them.
|
|
<P>
|
|
<DL>
|
|
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the cache. Note that "default" is a reserved name for the defaultCache.<DD><CODE>maxElementsInMemory</CODE> - the maximum number of elements in memory, before they are evicted<DD><CODE>memoryStoreEvictionPolicy</CODE> - one of LRU, LFU and FIFO. Optionally null, in which case it will be set to LRU.<DD><CODE>overflowToDisk</CODE> - whether to use the disk store<DD><CODE>diskStorePath</CODE> - this parameter is ignored. CacheManager sets it using setter injection.<DD><CODE>eternal</CODE> - whether the elements in the cache are eternal, i.e. never expire<DD><CODE>timeToLiveSeconds</CODE> - the default amount of time to live for an element from its creation date<DD><CODE>timeToIdleSeconds</CODE> - the default amount of time to live for an element from its last accessed or modified date<DD><CODE>diskPersistent</CODE> - whether to persist the cache to disk between JVM restarts<DD><CODE>diskExpiryThreadIntervalSeconds</CODE> - how often to run the disk store expiry thread. A large number of 120 seconds plus is recommended<DD><CODE>registeredEventListeners</CODE> - a notification service. Optionally null, in which case a new one with no registered listeners will be created.<DD><CODE>bootstrapCacheLoader</CODE> - the BootstrapCacheLoader to use to populate the cache when it is first initialised. Null if none is required.<DD><CODE>diskSpoolBufferSizeMB</CODE> - the amount of memory to allocate the write buffer for puts to the DiskStore.<DT><B>Since:</B></DT>
|
|
<DD>1.2.4</DD>
|
|
</DL>
|
|
</DL>
|
|
|
|
<!-- ============ METHOD DETAIL ========== -->
|
|
|
|
<A NAME="method_detail"><!-- --></A>
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
|
<B>Method Detail</B></FONT></TH>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<A NAME="initialise()"><!-- --></A><H3>
|
|
initialise</H3>
|
|
<PRE>
|
|
public void <B>initialise</B>()</PRE>
|
|
<DL>
|
|
<DD>Newly created caches do not have a <A HREF="../../../net/sf/ehcache/store/MemoryStore.html" title="class in net.sf.ehcache.store"><CODE>MemoryStore</CODE></A> or a <A HREF="../../../net/sf/ehcache/store/DiskStore.html" title="class in net.sf.ehcache.store"><CODE>DiskStore</CODE></A>.
|
|
<p/>
|
|
This method creates those and makes the cache ready to accept elements
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#initialise()">initialise</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="createDiskStore()"><!-- --></A><H3>
|
|
createDiskStore</H3>
|
|
<PRE>
|
|
protected <A HREF="../../../net/sf/ehcache/store/Store.html" title="interface in net.sf.ehcache.store">Store</A> <B>createDiskStore</B>()</PRE>
|
|
<DL>
|
|
<DD>Creates a disk store when either:
|
|
<ol>
|
|
<li>overflowToDisk is enabled
|
|
<li>diskPersistent is enabled
|
|
</ol>
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="isDiskStore()"><!-- --></A><H3>
|
|
isDiskStore</H3>
|
|
<PRE>
|
|
protected boolean <B>isDiskStore</B>()</PRE>
|
|
<DL>
|
|
<DD>Whether this cache uses a disk store
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>true if the cache either overflows to disk or is disk persistent</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="bootstrap()"><!-- --></A><H3>
|
|
bootstrap</H3>
|
|
<PRE>
|
|
public void <B>bootstrap</B>()</PRE>
|
|
<DL>
|
|
<DD>Bootstrap command. This must be called after the Cache is intialised, during
|
|
CacheManager initialisation. If loads are synchronous, they will complete before the CacheManager
|
|
initialise completes, otherwise they will happen in the background.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#bootstrap()">bootstrap</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="put(net.sf.ehcache.Element)"><!-- --></A><H3>
|
|
put</H3>
|
|
<PRE>
|
|
public final void <B>put</B>(<A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache">Element</A> element)
|
|
throws java.lang.IllegalArgumentException,
|
|
java.lang.IllegalStateException,
|
|
<A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Put an element in the cache.
|
|
<p/>
|
|
Resets the access statistics on the element, which would be the case if it has previously been
|
|
gotten from a cache, and is now being put back.
|
|
<p/>
|
|
Also notifies the CacheEventListener that:
|
|
<ul>
|
|
<li>the element was put, but only if the Element was actually put.
|
|
<li>if the element exists in the cache, that an update has occurred, even if the element would be expired
|
|
if it was requested
|
|
</ul>
|
|
Synchronization is handled within the method.
|
|
<p/>
|
|
Caches which use synchronous replication can throw RemoteCacheException here if the replication to the cluster fails.
|
|
This exception should be caught in those cirucmstances.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#put(net.sf.ehcache.Element)">put</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>element</CODE> - An object. If Serializable it can fully participate in replication and the DiskStore.
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A>
|
|
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the element is null
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="put(net.sf.ehcache.Element, boolean)"><!-- --></A><H3>
|
|
put</H3>
|
|
<PRE>
|
|
public final void <B>put</B>(<A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache">Element</A> element,
|
|
boolean doNotNotifyCacheReplicators)
|
|
throws java.lang.IllegalArgumentException,
|
|
java.lang.IllegalStateException,
|
|
<A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Put an element in the cache.
|
|
<p/>
|
|
Resets the access statistics on the element, which would be the case if it has previously been
|
|
gotten from a cache, and is now being put back.
|
|
<p/>
|
|
Also notifies the CacheEventListener that:
|
|
<ul>
|
|
<li>the element was put, but only if the Element was actually put.
|
|
<li>if the element exists in the cache, that an update has occurred, even if the element would be expired
|
|
if it was requested
|
|
</ul>
|
|
Synchronization is handled within the method.
|
|
<p/>
|
|
Caches which use synchronous replication can throw RemoteCacheException here if the replication to the cluster fails.
|
|
This exception should be caught in those cirucmstances.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#put(net.sf.ehcache.Element, boolean)">put</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>element</CODE> - An object. If Serializable it can fully participate in replication and the DiskStore.<DD><CODE>doNotNotifyCacheReplicators</CODE> - whether the put is coming from a doNotNotifyCacheReplicators cache peer, in which case this put should not initiate a
|
|
further notification to doNotNotifyCacheReplicators cache peers
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A>
|
|
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the element is null
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="putQuiet(net.sf.ehcache.Element)"><!-- --></A><H3>
|
|
putQuiet</H3>
|
|
<PRE>
|
|
public final void <B>putQuiet</B>(<A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache">Element</A> element)
|
|
throws java.lang.IllegalArgumentException,
|
|
java.lang.IllegalStateException,
|
|
<A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Put an element in the cache, without updating statistics, or updating listeners. This is meant to be used
|
|
in conjunction with <A HREF="../../../net/sf/ehcache/Cache.html#getQuiet(java.io.Serializable)"><CODE>getQuiet(java.io.Serializable)</CODE></A>.
|
|
Synchronization is handled within the method.
|
|
<p/>
|
|
Caches which use synchronous replication can throw RemoteCacheException here if the replication to the cluster fails.
|
|
This exception should be caught in those cirucmstances.
|
|
<p/>
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#putQuiet(net.sf.ehcache.Element)">putQuiet</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>element</CODE> - An object. If Serializable it can fully participate in replication and the DiskStore.
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A>
|
|
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the element is null
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="get(java.io.Serializable)"><!-- --></A><H3>
|
|
get</H3>
|
|
<PRE>
|
|
public final <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache">Element</A> <B>get</B>(java.io.Serializable key)
|
|
throws java.lang.IllegalStateException,
|
|
<A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Gets an element from the cache. Updates Element Statistics
|
|
<p/>
|
|
Note that the Element's lastAccessTime is always the time of this get.
|
|
Use <A HREF="../../../net/sf/ehcache/Cache.html#getQuiet(java.lang.Object)"><CODE>getQuiet(Object)</CODE></A> to peak into the Element to see its last access time with get
|
|
<p/>
|
|
Synchronization is handled within the method.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#get(java.io.Serializable)">get</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - a serializable value
|
|
<DT><B>Returns:</B><DD>the element, or null, if it does not exist.
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A>
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../net/sf/ehcache/Cache.html#isExpired(net.sf.ehcache.Element)"><CODE>isExpired(net.sf.ehcache.Element)</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="get(java.lang.Object)"><!-- --></A><H3>
|
|
get</H3>
|
|
<PRE>
|
|
public final <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache">Element</A> <B>get</B>(java.lang.Object key)
|
|
throws java.lang.IllegalStateException,
|
|
<A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Gets an element from the cache. Updates Element Statistics
|
|
<p/>
|
|
Note that the Element's lastAccessTime is always the time of this get.
|
|
Use <A HREF="../../../net/sf/ehcache/Cache.html#getQuiet(java.lang.Object)"><CODE>getQuiet(Object)</CODE></A> to peak into the Element to see its last access time with get
|
|
<p/>
|
|
Synchronization is handled within the method.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#get(java.lang.Object)">get</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - an Object value
|
|
<DT><B>Returns:</B><DD>the element, or null, if it does not exist.
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A>
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE><DT><B>Since:</B></DT>
|
|
<DD>1.2</DD>
|
|
<DT><B>See Also:</B><DD><A HREF="../../../net/sf/ehcache/Cache.html#isExpired(net.sf.ehcache.Element)"><CODE>isExpired(net.sf.ehcache.Element)</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getWithLoader(java.lang.Object, net.sf.ehcache.loader.CacheLoader, java.lang.Object)"><!-- --></A><H3>
|
|
getWithLoader</H3>
|
|
<PRE>
|
|
public <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache">Element</A> <B>getWithLoader</B>(java.lang.Object key,
|
|
<A HREF="../../../net/sf/ehcache/loader/CacheLoader.html" title="interface in net.sf.ehcache.loader">CacheLoader</A> loader,
|
|
java.lang.Object loaderArgument)
|
|
throws <A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Warning: This method is related to the JSR107 specification, which is in draft. It is subject to change without notice.
|
|
<p/>
|
|
This method will return, from the cache, the Element associated with the argument "key".
|
|
<p/>
|
|
If the Element is not in the cache, the associated cache loader will be called. That is either the CacheLoader passed in, or if null,
|
|
the one associated with the cache. If both are null, no load is performed and null is returned.
|
|
<p/>
|
|
If the loader decides to assign a null value to the Element, an Element with a null value is created and stored in the cache.
|
|
<p/>
|
|
Because this method may take a long time to complete, it is not synchronized. The underlying cache operations
|
|
are synchronized.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getWithLoader(java.lang.Object, net.sf.ehcache.loader.CacheLoader, java.lang.Object)">getWithLoader</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - key whose associated value is to be returned.<DD><CODE>loader</CODE> - the override loader to use. If null, the cache's default loader will be used<DD><CODE>loaderArgument</CODE> - an argument to pass to the CacheLoader.
|
|
<DT><B>Returns:</B><DD>an element if it existed or could be loaded, otherwise null
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="load(java.lang.Object)"><!-- --></A><H3>
|
|
load</H3>
|
|
<PRE>
|
|
public void <B>load</B>(java.lang.Object key)
|
|
throws <A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Warning: This method is related to the JSR107 specification, which is in draft. It is subject to change without notice.
|
|
<p/>
|
|
The load method provides a means to "pre load" the cache. This method will, asynchronously, load the specified
|
|
object into the cache using the associated cacheloader. If the object already exists in the cache, no action is
|
|
taken. If no loader is associated with the object, no object will be loaded into the cache. If a problem is
|
|
encountered during the retrieving or loading of the object, an exception should be logged. If the "arg" argument
|
|
is set, the arg object will be passed to the CacheLoader.load method. The cache will not dereference the object.
|
|
If no "arg" value is provided a null will be passed to the load method. The storing of null values in the cache
|
|
is permitted, however, the get method will not distinguish returning a null stored in the cache and not finding
|
|
the object in the cache. In both cases a null is returned.
|
|
<p/>
|
|
The Ehcache native API provides similar functionality to loaders using the
|
|
decorator <A HREF="../../../net/sf/ehcache/constructs/blocking/SelfPopulatingCache.html" title="class in net.sf.ehcache.constructs.blocking"><CODE>SelfPopulatingCache</CODE></A>
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#load(java.lang.Object)">load</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - key whose associated value to be loaded using the associated cacheloader if this cache doesn't contain it.
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getAllWithLoader(java.util.Collection, java.lang.Object)"><!-- --></A><H3>
|
|
getAllWithLoader</H3>
|
|
<PRE>
|
|
public java.util.Map <B>getAllWithLoader</B>(java.util.Collection keys,
|
|
java.lang.Object loaderArgument)
|
|
throws <A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Warning: This method is related to the JSR107 specification, which is in draft. It is subject to change without notice.
|
|
<p/>
|
|
The getAll method will return, from the cache, a Map of the objects associated with the Collection of keys in argument "keys".
|
|
If the objects are not in the cache, the associated cache loader will be called. If no loader is associated with an object,
|
|
a null is returned. If a problem is encountered during the retrieving or loading of the objects, an exception will be thrown.
|
|
If the "arg" argument is set, the arg object will be passed to the CacheLoader.loadAll method. The cache will not dereference
|
|
the object. If no "arg" value is provided a null will be passed to the loadAll method. The storing of null values in the cache
|
|
is permitted, however, the get method will not distinguish returning a null stored in the cache and not finding the object in
|
|
the cache. In both cases a null is returned.
|
|
<p/>
|
|
<p/>
|
|
Note. If the getAll exceeds the maximum cache size, the returned map will necessarily be less than the number specified.
|
|
<p/>
|
|
Because this method may take a long time to complete, it is not synchronized. The underlying cache operations
|
|
are synchronized.
|
|
<p/>
|
|
The constructs package provides similar functionality using the
|
|
decorator <A HREF="../../../net/sf/ehcache/constructs/blocking/SelfPopulatingCache.html" title="class in net.sf.ehcache.constructs.blocking"><CODE>SelfPopulatingCache</CODE></A>
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getAllWithLoader(java.util.Collection, java.lang.Object)">getAllWithLoader</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>keys</CODE> - a collection of keys to be returned/loaded<DD><CODE>loaderArgument</CODE> - an argument to pass to the CacheLoader.
|
|
<DT><B>Returns:</B><DD>a Map populated from the Cache. If there are no elements, an empty Map is returned.
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="loadAll(java.util.Collection, java.lang.Object)"><!-- --></A><H3>
|
|
loadAll</H3>
|
|
<PRE>
|
|
public void <B>loadAll</B>(java.util.Collection keys,
|
|
java.lang.Object argument)
|
|
throws <A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Warning: This method is related to the JSR107 specification, which is in draft. It is subject to change without notice.
|
|
<p/>
|
|
The loadAll method provides a means to "pre load" objects into the cache. This method will, asynchronously, load
|
|
the specified objects into the cache using the associated cache loader. If the an object already exists in the
|
|
cache, no action is taken. If no loader is associated with the object, no object will be loaded into the cache.
|
|
If a problem is encountered during the retrieving or loading of the objects, an exception (to be defined)
|
|
should be logged. The getAll method will return, from the cache, a Map of the objects associated with the
|
|
Collection of keys in argument "keys". If the objects are not in the cache, the associated cache loader will be
|
|
called. If no loader is associated with an object, a null is returned. If a problem is encountered during the
|
|
retrieving or loading of the objects, an exception (to be defined) will be thrown. If the "arg" argument is set,
|
|
the arg object will be passed to the CacheLoader.loadAll method. The cache will not dereference the object.
|
|
If no "arg" value is provided a null will be passed to the loadAll method.
|
|
<p/>
|
|
keys - collection of the keys whose associated values to be loaded into this cache by using the associated
|
|
cacheloader if this cache doesn't contain them.
|
|
<p/>
|
|
The Ehcache native API provides similar functionality to loaders using the
|
|
decorator <A HREF="../../../net/sf/ehcache/constructs/blocking/SelfPopulatingCache.html" title="class in net.sf.ehcache.constructs.blocking"><CODE>SelfPopulatingCache</CODE></A>
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#loadAll(java.util.Collection, java.lang.Object)">loadAll</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getQuiet(java.io.Serializable)"><!-- --></A><H3>
|
|
getQuiet</H3>
|
|
<PRE>
|
|
public final <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache">Element</A> <B>getQuiet</B>(java.io.Serializable key)
|
|
throws java.lang.IllegalStateException,
|
|
<A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Gets an element from the cache, without updating Element statistics. Cache statistics are
|
|
still updated.
|
|
<p/>
|
|
Synchronization is handled within the method.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getQuiet(java.io.Serializable)">getQuiet</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - a serializable value
|
|
<DT><B>Returns:</B><DD>the element, or null, if it does not exist.
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A>
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../net/sf/ehcache/Cache.html#isExpired(net.sf.ehcache.Element)"><CODE>isExpired(net.sf.ehcache.Element)</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getQuiet(java.lang.Object)"><!-- --></A><H3>
|
|
getQuiet</H3>
|
|
<PRE>
|
|
public final <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache">Element</A> <B>getQuiet</B>(java.lang.Object key)
|
|
throws java.lang.IllegalStateException,
|
|
<A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Gets an element from the cache, without updating Element statistics. Cache statistics are
|
|
not updated.
|
|
<p/>
|
|
Synchronization is handled within the method.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getQuiet(java.lang.Object)">getQuiet</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - a serializable value
|
|
<DT><B>Returns:</B><DD>the element, or null, if it does not exist.
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A>
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE><DT><B>Since:</B></DT>
|
|
<DD>1.2</DD>
|
|
<DT><B>See Also:</B><DD><A HREF="../../../net/sf/ehcache/Cache.html#isExpired(net.sf.ehcache.Element)"><CODE>isExpired(net.sf.ehcache.Element)</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getKeys()"><!-- --></A><H3>
|
|
getKeys</H3>
|
|
<PRE>
|
|
public final java.util.List <B>getKeys</B>()
|
|
throws java.lang.IllegalStateException,
|
|
<A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Returns a list of all element keys in the cache, whether or not they are expired.
|
|
<p/>
|
|
The returned keys are unique and can be considered a set.
|
|
<p/>
|
|
The List returned is not live. It is a copy.
|
|
<p/>
|
|
The time taken is O(n). On a single cpu 1.8Ghz P4, approximately 8ms is required
|
|
for each 1000 entries.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getKeys()">getKeys</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>a list of <CODE>Object</CODE> keys
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A>
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getKeysWithExpiryCheck()"><!-- --></A><H3>
|
|
getKeysWithExpiryCheck</H3>
|
|
<PRE>
|
|
public final java.util.List <B>getKeysWithExpiryCheck</B>()
|
|
throws java.lang.IllegalStateException,
|
|
<A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Returns a list of all element keys in the cache. Only keys of non-expired
|
|
elements are returned.
|
|
<p/>
|
|
The returned keys are unique and can be considered a set.
|
|
<p/>
|
|
The List returned is not live. It is a copy.
|
|
<p/>
|
|
The time taken is O(n), where n is the number of elements in the cache. On
|
|
a 1.8Ghz P4, the time taken is approximately 200ms per 1000 entries. This method
|
|
is not syncrhonized, because it relies on a non-live list returned from <A HREF="../../../net/sf/ehcache/Cache.html#getKeys()"><CODE>getKeys()</CODE></A>
|
|
, which is synchronised, and which takes 8ms per 1000 entries. This way
|
|
cache liveness is preserved, even if this method is very slow to return.
|
|
<p/>
|
|
Consider whether your usage requires checking for expired keys. Because
|
|
this method takes so long, depending on cache settings, the list could be
|
|
quite out of date by the time you get it.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getKeysWithExpiryCheck()">getKeysWithExpiryCheck</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>a list of <CODE>Object</CODE> keys
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A>
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getKeysNoDuplicateCheck()"><!-- --></A><H3>
|
|
getKeysNoDuplicateCheck</H3>
|
|
<PRE>
|
|
public final java.util.List <B>getKeysNoDuplicateCheck</B>()
|
|
throws java.lang.IllegalStateException</PRE>
|
|
<DL>
|
|
<DD>Returns a list of all elements in the cache, whether or not they are expired.
|
|
<p/>
|
|
The returned keys are not unique and may contain duplicates. If the cache is only
|
|
using the memory store, the list will be unique. If the disk store is being used
|
|
as well, it will likely contain duplicates, because of the internal store design.
|
|
<p/>
|
|
The List returned is not live. It is a copy.
|
|
<p/>
|
|
The time taken is O(log n). On a single cpu 1.8Ghz P4, approximately 6ms is required
|
|
for 1000 entries and 36 for 50000.
|
|
<p/>
|
|
This is the fastest getKeys method
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getKeysNoDuplicateCheck()">getKeysNoDuplicateCheck</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>a list of <CODE>Object</CODE> keys
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="remove(java.io.Serializable)"><!-- --></A><H3>
|
|
remove</H3>
|
|
<PRE>
|
|
public final boolean <B>remove</B>(java.io.Serializable key)
|
|
throws java.lang.IllegalStateException</PRE>
|
|
<DL>
|
|
<DD>Removes an <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache"><CODE>Element</CODE></A> from the Cache. This also removes it from any
|
|
stores it may be in.
|
|
<p/>
|
|
Also notifies the CacheEventListener after the element was removed.
|
|
<p/>
|
|
Synchronization is handled within the method.
|
|
<p/>
|
|
Caches which use synchronous replication can throw RemoteCacheException here if the replication to the cluster fails.
|
|
This exception should be caught in those cirucmstances.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#remove(java.io.Serializable)">remove</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - the element key to operate on
|
|
<DT><B>Returns:</B><DD>true if the element was removed, false if it was not found in the cache
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="remove(java.lang.Object)"><!-- --></A><H3>
|
|
remove</H3>
|
|
<PRE>
|
|
public final boolean <B>remove</B>(java.lang.Object key)
|
|
throws java.lang.IllegalStateException</PRE>
|
|
<DL>
|
|
<DD>Removes an <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache"><CODE>Element</CODE></A> from the Cache. This also removes it from any
|
|
stores it may be in.
|
|
<p/>
|
|
Also notifies the CacheEventListener after the element was removed, but only if an Element
|
|
with the key actually existed.
|
|
<p/>
|
|
Synchronization is handled within the method.
|
|
<p/>
|
|
Caches which use synchronous replication can throw RemoteCacheException here if the replication to the cluster fails.
|
|
This exception should be caught in those cirucmstances.
|
|
<p/>
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#remove(java.lang.Object)">remove</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - the element key to operate on
|
|
<DT><B>Returns:</B><DD>true if the element was removed, false if it was not found in the cache
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A><DT><B>Since:</B></DT>
|
|
<DD>1.2</DD>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="remove(java.io.Serializable, boolean)"><!-- --></A><H3>
|
|
remove</H3>
|
|
<PRE>
|
|
public final boolean <B>remove</B>(java.io.Serializable key,
|
|
boolean doNotNotifyCacheReplicators)
|
|
throws java.lang.IllegalStateException</PRE>
|
|
<DL>
|
|
<DD>Removes an <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache"><CODE>Element</CODE></A> from the Cache. This also removes it from any
|
|
stores it may be in.
|
|
<p/>
|
|
Also notifies the CacheEventListener after the element was removed, but only if an Element
|
|
with the key actually existed.
|
|
<p/>
|
|
Synchronization is handled within the method.
|
|
<p/>
|
|
Caches which use synchronous replication can throw RemoteCacheException here if the replication to the cluster fails.
|
|
This exception should be caught in those cirucmstances.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#remove(java.io.Serializable, boolean)">remove</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - the element key to operate on<DD><CODE>doNotNotifyCacheReplicators</CODE> - whether the put is coming from a doNotNotifyCacheReplicators cache peer, in which case this put should not initiate a
|
|
further notification to doNotNotifyCacheReplicators cache peers
|
|
<DT><B>Returns:</B><DD>true if the element was removed, false if it was not found in the cache
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="remove(java.lang.Object, boolean)"><!-- --></A><H3>
|
|
remove</H3>
|
|
<PRE>
|
|
public final boolean <B>remove</B>(java.lang.Object key,
|
|
boolean doNotNotifyCacheReplicators)
|
|
throws java.lang.IllegalStateException</PRE>
|
|
<DL>
|
|
<DD>Removes an <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache"><CODE>Element</CODE></A> from the Cache. This also removes it from any
|
|
stores it may be in.
|
|
<p/>
|
|
Also notifies the CacheEventListener after the element was removed, but only if an Element
|
|
with the key actually existed.
|
|
<p/>
|
|
Synchronization is handled within the method.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#remove(java.lang.Object, boolean)">remove</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - the element key to operate on<DD><CODE>doNotNotifyCacheReplicators</CODE> - whether the put is coming from a doNotNotifyCacheReplicators cache peer, in which case this put should not initiate a
|
|
further notification to doNotNotifyCacheReplicators cache peers
|
|
<DT><B>Returns:</B><DD>true if the element was removed, false if it was not found in the cache
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="removeQuiet(java.io.Serializable)"><!-- --></A><H3>
|
|
removeQuiet</H3>
|
|
<PRE>
|
|
public final boolean <B>removeQuiet</B>(java.io.Serializable key)
|
|
throws java.lang.IllegalStateException</PRE>
|
|
<DL>
|
|
<DD>Removes an <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache"><CODE>Element</CODE></A> from the Cache, without notifying listeners. This also removes it from any
|
|
stores it may be in.
|
|
<p/>
|
|
Synchronization is handled within the method.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#removeQuiet(java.io.Serializable)">removeQuiet</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - the element key to operate on
|
|
<DT><B>Returns:</B><DD>true if the element was removed, false if it was not found in the cache
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="removeQuiet(java.lang.Object)"><!-- --></A><H3>
|
|
removeQuiet</H3>
|
|
<PRE>
|
|
public final boolean <B>removeQuiet</B>(java.lang.Object key)
|
|
throws java.lang.IllegalStateException</PRE>
|
|
<DL>
|
|
<DD>Removes an <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache"><CODE>Element</CODE></A> from the Cache, without notifying listeners. This also removes it from any
|
|
stores it may be in.
|
|
<p/>
|
|
Synchronization is handled within the method.
|
|
<p/>
|
|
Caches which use synchronous replication can throw RemoteCacheException here if the replication to the cluster fails.
|
|
This exception should be caught in those cirucmstances.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#removeQuiet(java.lang.Object)">removeQuiet</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - the element key to operate on
|
|
<DT><B>Returns:</B><DD>true if the element was removed, false if it was not found in the cache
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A><DT><B>Since:</B></DT>
|
|
<DD>1.2</DD>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="removeAll()"><!-- --></A><H3>
|
|
removeAll</H3>
|
|
<PRE>
|
|
public void <B>removeAll</B>()
|
|
throws java.lang.IllegalStateException,
|
|
<A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Removes all cached items.
|
|
Synchronization is handled within the method.
|
|
<p/>
|
|
Caches which use synchronous replication can throw RemoteCacheException here if the replication to the cluster fails.
|
|
This exception should be caught in those cirucmstances.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#removeAll()">removeAll</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A>
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="removeAll(boolean)"><!-- --></A><H3>
|
|
removeAll</H3>
|
|
<PRE>
|
|
public void <B>removeAll</B>(boolean doNotNotifyCacheReplicators)
|
|
throws java.lang.IllegalStateException,
|
|
<A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Removes all cached items.
|
|
Synchronization is handled within the method.
|
|
<p/>
|
|
Caches which use synchronous replication can throw RemoteCacheException here if the replication to the cluster fails.
|
|
This exception should be caught in those cirucmstances.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#removeAll(boolean)">removeAll</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>doNotNotifyCacheReplicators</CODE> - whether the put is coming from a doNotNotifyCacheReplicators cache peer,
|
|
in which case this put should not initiate a further notification to doNotNotifyCacheReplicators cache peers
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A>
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="dispose()"><!-- --></A><H3>
|
|
dispose</H3>
|
|
<PRE>
|
|
public void <B>dispose</B>()
|
|
throws java.lang.IllegalStateException</PRE>
|
|
<DL>
|
|
<DD>Starts an orderly shutdown of the Cache. Steps are:
|
|
<ol>
|
|
<li>Completes any outstanding CacheLoader loads.
|
|
<li>Disposes any cache extensions.
|
|
<li>Disposes any cache event listeners. The listeners normally complete, so for example distributed caching operations will complete.
|
|
<li>Flushes all cache items from memory to the disk store, if any
|
|
<li>changes status to shutdown, so that any cache operations after this point throw IllegalStateException
|
|
</ol>
|
|
This method should be invoked only by CacheManager, as a cache's lifecycle is bound into that of it's cache manager.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#dispose()">dispose</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is already <A HREF="../../../net/sf/ehcache/Status.html#STATUS_SHUTDOWN"><CODE>Status.STATUS_SHUTDOWN</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getCacheConfiguration()"><!-- --></A><H3>
|
|
getCacheConfiguration</H3>
|
|
<PRE>
|
|
public <A HREF="../../../net/sf/ehcache/config/CacheConfiguration.html" title="class in net.sf.ehcache.config">CacheConfiguration</A> <B>getCacheConfiguration</B>()</PRE>
|
|
<DL>
|
|
<DD>Gets the cache configuration this cache was created with.
|
|
<p/>
|
|
Things like listeners that are added dynamically are excluded.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getCacheConfiguration()">getCacheConfiguration</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="flush()"><!-- --></A><H3>
|
|
flush</H3>
|
|
<PRE>
|
|
public final void <B>flush</B>()
|
|
throws java.lang.IllegalStateException,
|
|
<A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Flushes all cache items from memory to the disk store, and from the DiskStore to disk.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#flush()">flush</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A>
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getSize()"><!-- --></A><H3>
|
|
getSize</H3>
|
|
<PRE>
|
|
public final int <B>getSize</B>()
|
|
throws java.lang.IllegalStateException,
|
|
<A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Gets the size of the cache. This is a subtle concept. See below.
|
|
<p/>
|
|
The size is the number of <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache"><CODE>Element</CODE></A>s in the <A HREF="../../../net/sf/ehcache/store/MemoryStore.html" title="class in net.sf.ehcache.store"><CODE>MemoryStore</CODE></A> plus
|
|
the number of <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache"><CODE>Element</CODE></A>s in the <A HREF="../../../net/sf/ehcache/store/DiskStore.html" title="class in net.sf.ehcache.store"><CODE>DiskStore</CODE></A>.
|
|
<p/>
|
|
This number is the actual number of elements, including expired elements that have
|
|
not been removed.
|
|
<p/>
|
|
Expired elements are removed from the the memory store when
|
|
getting an expired element, or when attempting to spool an expired element to
|
|
disk.
|
|
<p/>
|
|
Expired elements are removed from the disk store when getting an expired element,
|
|
or when the expiry thread runs, which is once every five minutes.
|
|
<p/>
|
|
To get an exact size, which would exclude expired elements, use <A HREF="../../../net/sf/ehcache/Cache.html#getKeysWithExpiryCheck()"><CODE>getKeysWithExpiryCheck()</CODE></A>.size(),
|
|
although see that method for the approximate time that would take.
|
|
<p/>
|
|
To get a very fast result, use <A HREF="../../../net/sf/ehcache/Cache.html#getKeysNoDuplicateCheck()"><CODE>getKeysNoDuplicateCheck()</CODE></A>.size(). If the disk store
|
|
is being used, there will be some duplicates.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getSize()">getSize</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>The size value
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A>
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="calculateInMemorySize()"><!-- --></A><H3>
|
|
calculateInMemorySize</H3>
|
|
<PRE>
|
|
public final long <B>calculateInMemorySize</B>()
|
|
throws java.lang.IllegalStateException,
|
|
<A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Gets the size of the memory store for this cache. This method relies on calculating
|
|
Serialized sizes. If the Element values are not Serializable they will show as zero.
|
|
<p/>
|
|
Warning: This method can be very expensive to run. Allow approximately 1 second
|
|
per 1MB of entries. Running this method could create liveness problems
|
|
because the object lock is held for a long period
|
|
<p/>
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#calculateInMemorySize()">calculateInMemorySize</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>the approximate size of the memory store in bytes
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE>
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getMemoryStoreSize()"><!-- --></A><H3>
|
|
getMemoryStoreSize</H3>
|
|
<PRE>
|
|
public final long <B>getMemoryStoreSize</B>()
|
|
throws java.lang.IllegalStateException</PRE>
|
|
<DL>
|
|
<DD>Returns the number of elements in the memory store.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getMemoryStoreSize()">getMemoryStoreSize</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>the number of elements in the memory store
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getDiskStoreSize()"><!-- --></A><H3>
|
|
getDiskStoreSize</H3>
|
|
<PRE>
|
|
public final int <B>getDiskStoreSize</B>()
|
|
throws java.lang.IllegalStateException</PRE>
|
|
<DL>
|
|
<DD>Returns the number of elements in the disk store.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getDiskStoreSize()">getDiskStoreSize</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>the number of elements in the disk store.
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getStatus()"><!-- --></A><H3>
|
|
getStatus</H3>
|
|
<PRE>
|
|
public final <A HREF="../../../net/sf/ehcache/Status.html" title="class in net.sf.ehcache">Status</A> <B>getStatus</B>()</PRE>
|
|
<DL>
|
|
<DD>Gets the status attribute of the Cache.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getStatus()">getStatus</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>The status value from the Status enum class</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getHitCount()"><!-- --></A><H3>
|
|
getHitCount</H3>
|
|
<PRE>
|
|
public final int <B>getHitCount</B>()</PRE>
|
|
<DL>
|
|
<DD><B>Deprecated.</B> <I>Use <A HREF="../../../net/sf/ehcache/Statistics.html" title="class in net.sf.ehcache"><CODE>Statistics</CODE></A></I>
|
|
<P>
|
|
<DD>The number of times a requested item was found in the cache.
|
|
<p/>
|
|
The internal representation of this statistic has been changed to a long
|
|
to cater for real world situations when an int is not sufficient to hold it.
|
|
If the statistic is larger than <code>Integer.MAX_VALUE</code> a nonsensical value
|
|
will be returned. Use <A HREF="../../../net/sf/ehcache/Statistics.html" title="class in net.sf.ehcache"><CODE>Statistics</CODE></A> which contains this statistic.
|
|
<p/>
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>the number of times a requested item was found in the cache</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getMemoryStoreHitCount()"><!-- --></A><H3>
|
|
getMemoryStoreHitCount</H3>
|
|
<PRE>
|
|
public final int <B>getMemoryStoreHitCount</B>()</PRE>
|
|
<DL>
|
|
<DD><B>Deprecated.</B> <I>Use <A HREF="../../../net/sf/ehcache/Statistics.html" title="class in net.sf.ehcache"><CODE>Statistics</CODE></A></I>
|
|
<P>
|
|
<DD>Number of times a requested item was found in the Memory Store.
|
|
<p/>
|
|
The internal representation of this statistic has been changed to a long
|
|
to cater for real world situations when an int is not sufficient to hold it.
|
|
If the statistic is larger than <code>Integer.MAX_VALUE</code> a nonsensical value
|
|
will be returned. Use <A HREF="../../../net/sf/ehcache/Statistics.html" title="class in net.sf.ehcache"><CODE>Statistics</CODE></A> which contains this statistic.
|
|
<p/>
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>Number of times a requested item was found in the Memory Store.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getDiskStoreHitCount()"><!-- --></A><H3>
|
|
getDiskStoreHitCount</H3>
|
|
<PRE>
|
|
public final int <B>getDiskStoreHitCount</B>()</PRE>
|
|
<DL>
|
|
<DD><B>Deprecated.</B> <I>Use <A HREF="../../../net/sf/ehcache/Statistics.html" title="class in net.sf.ehcache"><CODE>Statistics</CODE></A></I>
|
|
<P>
|
|
<DD>Number of times a requested item was found in the Disk Store.
|
|
<p/>
|
|
The internal representation of this statistic has been changed to a long
|
|
to cater for real world situations when an int is not sufficient to hold it.
|
|
If the statistic is larger than <code>Integer.MAX_VALUE</code> a nonsensical value
|
|
will be returned. Use <A HREF="../../../net/sf/ehcache/Statistics.html" title="class in net.sf.ehcache"><CODE>Statistics</CODE></A> which contains this statistic.
|
|
<p/>
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getMissCountNotFound()"><!-- --></A><H3>
|
|
getMissCountNotFound</H3>
|
|
<PRE>
|
|
public final int <B>getMissCountNotFound</B>()</PRE>
|
|
<DL>
|
|
<DD><B>Deprecated.</B> <I>Use <A HREF="../../../net/sf/ehcache/Statistics.html" title="class in net.sf.ehcache"><CODE>Statistics</CODE></A></I>
|
|
<P>
|
|
<DD>Number of times a requested element was not found in the cache. This
|
|
may be because it expired, in which case this will also be recorded in <A HREF="../../../net/sf/ehcache/Cache.html#getMissCountExpired()"><CODE>getMissCountExpired()</CODE></A>,
|
|
or because it was simply not there.
|
|
<p/>
|
|
The internal representation of this statistic has been changed to a long
|
|
to cater for real world situations when an int is not sufficient to hold it.
|
|
If the statistic is larger than <code>Integer.MAX_VALUE</code> a nonsensical value
|
|
will be returned. Use <A HREF="../../../net/sf/ehcache/Statistics.html" title="class in net.sf.ehcache"><CODE>Statistics</CODE></A> which contains this statistic.
|
|
<p/>
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getMissCountExpired()"><!-- --></A><H3>
|
|
getMissCountExpired</H3>
|
|
<PRE>
|
|
public final int <B>getMissCountExpired</B>()</PRE>
|
|
<DL>
|
|
<DD><B>Deprecated.</B> <I>Use <A HREF="../../../net/sf/ehcache/Statistics.html" title="class in net.sf.ehcache"><CODE>Statistics</CODE></A></I>
|
|
<P>
|
|
<DD>Number of times a requested element was found but was expired.
|
|
<p/>
|
|
The internal representation of this statistic has been changed to a long
|
|
to cater for real world situations when an int is not sufficient to hold it.
|
|
If the statistic is larger than <code>Integer.MAX_VALUE</code> a nonsensical value
|
|
will be returned. Use <A HREF="../../../net/sf/ehcache/Statistics.html" title="class in net.sf.ehcache"><CODE>Statistics</CODE></A> which contains this statistic.
|
|
<p/>
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getName()"><!-- --></A><H3>
|
|
getName</H3>
|
|
<PRE>
|
|
public final java.lang.String <B>getName</B>()</PRE>
|
|
<DL>
|
|
<DD>Gets the cache name.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getName()">getName</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="setName(java.lang.String)"><!-- --></A><H3>
|
|
setName</H3>
|
|
<PRE>
|
|
public final void <B>setName</B>(java.lang.String name)
|
|
throws java.lang.IllegalArgumentException</PRE>
|
|
<DL>
|
|
<DD>Sets the cache name which will name.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#setName(java.lang.String)">setName</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the cache. Should not be null. Should also not contain any '/' characters, as these interfere
|
|
with distribution
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if an illegal name is used.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getTimeToIdleSeconds()"><!-- --></A><H3>
|
|
getTimeToIdleSeconds</H3>
|
|
<PRE>
|
|
public final long <B>getTimeToIdleSeconds</B>()</PRE>
|
|
<DL>
|
|
<DD><B>Deprecated.</B> <I>Get this from the configuration</I>
|
|
<P>
|
|
<DD>Gets timeToIdleSeconds.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getTimeToIdleSeconds()">getTimeToIdleSeconds</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getTimeToLiveSeconds()"><!-- --></A><H3>
|
|
getTimeToLiveSeconds</H3>
|
|
<PRE>
|
|
public final long <B>getTimeToLiveSeconds</B>()</PRE>
|
|
<DL>
|
|
<DD><B>Deprecated.</B> <I>Get this from the configuration</I>
|
|
<P>
|
|
<DD>Gets timeToLiveSeconds.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getTimeToLiveSeconds()">getTimeToLiveSeconds</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="isEternal()"><!-- --></A><H3>
|
|
isEternal</H3>
|
|
<PRE>
|
|
public final boolean <B>isEternal</B>()</PRE>
|
|
<DL>
|
|
<DD><B>Deprecated.</B> <I>Get this from the configuration</I>
|
|
<P>
|
|
<DD>Are elements eternal.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#isEternal()">isEternal</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="isOverflowToDisk()"><!-- --></A><H3>
|
|
isOverflowToDisk</H3>
|
|
<PRE>
|
|
public final boolean <B>isOverflowToDisk</B>()</PRE>
|
|
<DL>
|
|
<DD><B>Deprecated.</B> <I>Get this from the configuration</I>
|
|
<P>
|
|
<DD>Does the overflow go to disk.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#isOverflowToDisk()">isOverflowToDisk</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getMaxElementsInMemory()"><!-- --></A><H3>
|
|
getMaxElementsInMemory</H3>
|
|
<PRE>
|
|
public final int <B>getMaxElementsInMemory</B>()</PRE>
|
|
<DL>
|
|
<DD><B>Deprecated.</B> <I>Get this from the configuration</I>
|
|
<P>
|
|
<DD>Gets the maximum number of elements to hold in memory.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getMaxElementsInMemory()">getMaxElementsInMemory</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getMaxElementsOnDisk()"><!-- --></A><H3>
|
|
getMaxElementsOnDisk</H3>
|
|
<PRE>
|
|
public int <B>getMaxElementsOnDisk</B>()</PRE>
|
|
<DL>
|
|
<DD><B>Deprecated.</B> <I>Get this from the configuration</I>
|
|
<P>
|
|
<DD>Gets the maximum number of elements to hold on Disk
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getMaxElementsOnDisk()">getMaxElementsOnDisk</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getMemoryStoreEvictionPolicy()"><!-- --></A><H3>
|
|
getMemoryStoreEvictionPolicy</H3>
|
|
<PRE>
|
|
public final <A HREF="../../../net/sf/ehcache/store/MemoryStoreEvictionPolicy.html" title="class in net.sf.ehcache.store">MemoryStoreEvictionPolicy</A> <B>getMemoryStoreEvictionPolicy</B>()</PRE>
|
|
<DL>
|
|
<DD><B>Deprecated.</B> <I>Get this from the configuration</I>
|
|
<P>
|
|
<DD>The policy used to evict elements from the <A HREF="../../../net/sf/ehcache/store/MemoryStore.html" title="class in net.sf.ehcache.store"><CODE>MemoryStore</CODE></A>.
|
|
This can be one of:
|
|
<ol>
|
|
<li>LRU - least recently used
|
|
<li>LFU - least frequently used
|
|
<li>FIFO - first in first out, the oldest element by creation time
|
|
</ol>
|
|
The default value is LRU
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getMemoryStoreEvictionPolicy()">getMemoryStoreEvictionPolicy</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Since:</B></DT>
|
|
<DD>1.2</DD>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="isDiskPersistent()"><!-- --></A><H3>
|
|
isDiskPersistent</H3>
|
|
<PRE>
|
|
public final boolean <B>isDiskPersistent</B>()</PRE>
|
|
<DL>
|
|
<DD><B>Deprecated.</B> <I>Get this from the configuration *</I>
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#isDiskPersistent()">isDiskPersistent</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>true if the cache overflows to disk and the disk is persistent between restarts</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getDiskExpiryThreadIntervalSeconds()"><!-- --></A><H3>
|
|
getDiskExpiryThreadIntervalSeconds</H3>
|
|
<PRE>
|
|
public final long <B>getDiskExpiryThreadIntervalSeconds</B>()</PRE>
|
|
<DL>
|
|
<DD><B>Deprecated.</B> <I>Get this from the configuration</I>
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getDiskExpiryThreadIntervalSeconds()">getDiskExpiryThreadIntervalSeconds</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>the interval between runs
|
|
of the expiry thread, where it checks the disk store for expired elements. It is not the
|
|
the timeToLiveSeconds.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="toString()"><!-- --></A><H3>
|
|
toString</H3>
|
|
<PRE>
|
|
public final java.lang.String <B>toString</B>()</PRE>
|
|
<DL>
|
|
<DD>Returns a <CODE>String</CODE> representation of <A HREF="../../../net/sf/ehcache/Cache.html" title="class in net.sf.ehcache"><CODE>Cache</CODE></A>.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#toString()">toString</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE><DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="isExpired(net.sf.ehcache.Element)"><!-- --></A><H3>
|
|
isExpired</H3>
|
|
<PRE>
|
|
public final boolean <B>isExpired</B>(<A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache">Element</A> element)
|
|
throws java.lang.IllegalStateException,
|
|
java.lang.NullPointerException</PRE>
|
|
<DL>
|
|
<DD>Checks whether this cache element has expired.
|
|
<p/>
|
|
The element is expired if:
|
|
<ol>
|
|
<li> the idle time is non-zero and has elapsed, unless the cache is eternal; or
|
|
<li> the time to live is non-zero and has elapsed, unless the cache is eternal; or
|
|
<li> the value of the element is null.
|
|
</ol>
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#isExpired(net.sf.ehcache.Element)">isExpired</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to check
|
|
<DT><B>Returns:</B><DD>true if it has expired
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A>
|
|
<DD><CODE>java.lang.NullPointerException</CODE> - if the element is null</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="clone()"><!-- --></A><H3>
|
|
clone</H3>
|
|
<PRE>
|
|
public final java.lang.Object <B>clone</B>()
|
|
throws java.lang.CloneNotSupportedException</PRE>
|
|
<DL>
|
|
<DD>Clones a cache. This is only legal if the cache has not been
|
|
initialized. At that point only primitives have been set and no
|
|
<A HREF="../../../net/sf/ehcache/store/LruMemoryStore.html" title="class in net.sf.ehcache.store"><CODE>LruMemoryStore</CODE></A> or <A HREF="../../../net/sf/ehcache/store/DiskStore.html" title="class in net.sf.ehcache.store"><CODE>DiskStore</CODE></A> has been created.
|
|
<p/>
|
|
A new, empty, RegisteredEventListeners is created on clone.
|
|
<p/>
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#clone()">clone</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE><DT><B>Overrides:</B><DD><CODE>clone</CODE> in class <CODE>java.lang.Object</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>an object of type <A HREF="../../../net/sf/ehcache/Cache.html" title="class in net.sf.ehcache"><CODE>Cache</CODE></A>
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.CloneNotSupportedException</CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getDiskStore()"><!-- --></A><H3>
|
|
getDiskStore</H3>
|
|
<PRE>
|
|
final <A HREF="../../../net/sf/ehcache/store/Store.html" title="interface in net.sf.ehcache.store">Store</A> <B>getDiskStore</B>()
|
|
throws java.lang.IllegalStateException</PRE>
|
|
<DL>
|
|
<DD>Gets the internal DiskStore.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>the DiskStore referenced by this cache
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getMemoryStore()"><!-- --></A><H3>
|
|
getMemoryStore</H3>
|
|
<PRE>
|
|
final <A HREF="../../../net/sf/ehcache/store/MemoryStore.html" title="class in net.sf.ehcache.store">MemoryStore</A> <B>getMemoryStore</B>()
|
|
throws java.lang.IllegalStateException</PRE>
|
|
<DL>
|
|
<DD>Gets the internal MemoryStore.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>the MemoryStore referenced by this cache
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getCacheEventNotificationService()"><!-- --></A><H3>
|
|
getCacheEventNotificationService</H3>
|
|
<PRE>
|
|
public final <A HREF="../../../net/sf/ehcache/event/RegisteredEventListeners.html" title="class in net.sf.ehcache.event">RegisteredEventListeners</A> <B>getCacheEventNotificationService</B>()</PRE>
|
|
<DL>
|
|
<DD>Use this to access the service in order to register and unregister listeners
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getCacheEventNotificationService()">getCacheEventNotificationService</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>the RegisteredEventListeners instance for this cache.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="isElementInMemory(java.io.Serializable)"><!-- --></A><H3>
|
|
isElementInMemory</H3>
|
|
<PRE>
|
|
public final boolean <B>isElementInMemory</B>(java.io.Serializable key)</PRE>
|
|
<DL>
|
|
<DD>Whether an Element is stored in the cache in Memory, indicating a very low cost of retrieval.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#isElementInMemory(java.io.Serializable)">isElementInMemory</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>true if an element matching the key is found in memory</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="isElementInMemory(java.lang.Object)"><!-- --></A><H3>
|
|
isElementInMemory</H3>
|
|
<PRE>
|
|
public final boolean <B>isElementInMemory</B>(java.lang.Object key)</PRE>
|
|
<DL>
|
|
<DD>Whether an Element is stored in the cache in Memory, indicating a very low cost of retrieval.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#isElementInMemory(java.lang.Object)">isElementInMemory</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>true if an element matching the key is found in memory<DT><B>Since:</B></DT>
|
|
<DD>1.2</DD>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="isElementOnDisk(java.io.Serializable)"><!-- --></A><H3>
|
|
isElementOnDisk</H3>
|
|
<PRE>
|
|
public final boolean <B>isElementOnDisk</B>(java.io.Serializable key)</PRE>
|
|
<DL>
|
|
<DD>Whether an Element is stored in the cache on Disk, indicating a higher cost of retrieval.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#isElementOnDisk(java.io.Serializable)">isElementOnDisk</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>true if an element matching the key is found in the diskStore</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="isElementOnDisk(java.lang.Object)"><!-- --></A><H3>
|
|
isElementOnDisk</H3>
|
|
<PRE>
|
|
public final boolean <B>isElementOnDisk</B>(java.lang.Object key)</PRE>
|
|
<DL>
|
|
<DD>Whether an Element is stored in the cache on Disk, indicating a higher cost of retrieval.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#isElementOnDisk(java.lang.Object)">isElementOnDisk</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>true if an element matching the key is found in the diskStore<DT><B>Since:</B></DT>
|
|
<DD>1.2</DD>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getGuid()"><!-- --></A><H3>
|
|
getGuid</H3>
|
|
<PRE>
|
|
public final java.lang.String <B>getGuid</B>()</PRE>
|
|
<DL>
|
|
<DD>The GUID for this cache instance can be used to determine whether two cache instance references
|
|
are pointing to the same cache.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getGuid()">getGuid</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>the globally unique identifier for this cache instance. This is guaranteed to be unique.<DT><B>Since:</B></DT>
|
|
<DD>1.2</DD>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getCacheManager()"><!-- --></A><H3>
|
|
getCacheManager</H3>
|
|
<PRE>
|
|
public final <A HREF="../../../net/sf/ehcache/CacheManager.html" title="class in net.sf.ehcache">CacheManager</A> <B>getCacheManager</B>()</PRE>
|
|
<DL>
|
|
<DD>Gets the CacheManager managing this cache. For a newly created cache this will be null until
|
|
it has been added to a CacheManager.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getCacheManager()">getCacheManager</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>the manager or null if there is none</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="clearStatistics()"><!-- --></A><H3>
|
|
clearStatistics</H3>
|
|
<PRE>
|
|
public void <B>clearStatistics</B>()
|
|
throws java.lang.IllegalStateException</PRE>
|
|
<DL>
|
|
<DD>Resets statistics counters back to 0.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#clearStatistics()">clearStatistics</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getStatisticsAccuracy()"><!-- --></A><H3>
|
|
getStatisticsAccuracy</H3>
|
|
<PRE>
|
|
public int <B>getStatisticsAccuracy</B>()</PRE>
|
|
<DL>
|
|
<DD>Accurately measuring statistics can be expensive. Returns the current accuracy setting.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getStatisticsAccuracy()">getStatisticsAccuracy</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>one of <A HREF="../../../net/sf/ehcache/Statistics.html#STATISTICS_ACCURACY_BEST_EFFORT"><CODE>Statistics.STATISTICS_ACCURACY_BEST_EFFORT</CODE></A>, <A HREF="../../../net/sf/ehcache/Statistics.html#STATISTICS_ACCURACY_GUARANTEED"><CODE>Statistics.STATISTICS_ACCURACY_GUARANTEED</CODE></A>, <A HREF="../../../net/sf/ehcache/Statistics.html#STATISTICS_ACCURACY_NONE"><CODE>Statistics.STATISTICS_ACCURACY_NONE</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="setStatisticsAccuracy(int)"><!-- --></A><H3>
|
|
setStatisticsAccuracy</H3>
|
|
<PRE>
|
|
public void <B>setStatisticsAccuracy</B>(int statisticsAccuracy)</PRE>
|
|
<DL>
|
|
<DD>Sets the statistics accuracy.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#setStatisticsAccuracy(int)">setStatisticsAccuracy</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>statisticsAccuracy</CODE> - one of <A HREF="../../../net/sf/ehcache/Statistics.html#STATISTICS_ACCURACY_BEST_EFFORT"><CODE>Statistics.STATISTICS_ACCURACY_BEST_EFFORT</CODE></A>, <A HREF="../../../net/sf/ehcache/Statistics.html#STATISTICS_ACCURACY_GUARANTEED"><CODE>Statistics.STATISTICS_ACCURACY_GUARANTEED</CODE></A>, <A HREF="../../../net/sf/ehcache/Statistics.html#STATISTICS_ACCURACY_NONE"><CODE>Statistics.STATISTICS_ACCURACY_NONE</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="evictExpiredElements()"><!-- --></A><H3>
|
|
evictExpiredElements</H3>
|
|
<PRE>
|
|
public void <B>evictExpiredElements</B>()</PRE>
|
|
<DL>
|
|
<DD>Causes all elements stored in the Cache to be synchronously checked for expiry, and if expired, evicted.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#evictExpiredElements()">evictExpiredElements</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="isKeyInCache(java.lang.Object)"><!-- --></A><H3>
|
|
isKeyInCache</H3>
|
|
<PRE>
|
|
public boolean <B>isKeyInCache</B>(java.lang.Object key)</PRE>
|
|
<DL>
|
|
<DD>An inexpensive check to see if the key exists in the cache.
|
|
<p/>
|
|
This method is not synchronized. It is possible that an element may exist in the cache aned be removed
|
|
before the check gets to it, or vice versa.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#isKeyInCache(java.lang.Object)">isKeyInCache</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - the key to check.
|
|
<DT><B>Returns:</B><DD>true if an Element matching the key is found in the cache. No assertions are made about the state of the Element.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="isValueInCache(java.lang.Object)"><!-- --></A><H3>
|
|
isValueInCache</H3>
|
|
<PRE>
|
|
public boolean <B>isValueInCache</B>(java.lang.Object value)</PRE>
|
|
<DL>
|
|
<DD>An extremely expensive check to see if the value exists in the cache. This implementation is O(n). Ehcache
|
|
is not designed for efficient access in this manner.
|
|
<p/>
|
|
This method is not synchronized. It is possible that an element may exist in the cache aned be removed
|
|
before the check gets to it, or vice versa. Because it is slow to execute the probability of that this will
|
|
have happened.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#isValueInCache(java.lang.Object)">isValueInCache</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>value</CODE> - to check for
|
|
<DT><B>Returns:</B><DD>true if an Element matching the key is found in the cache. No assertions are made about the state of the Element.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getStatistics()"><!-- --></A><H3>
|
|
getStatistics</H3>
|
|
<PRE>
|
|
public <A HREF="../../../net/sf/ehcache/Statistics.html" title="class in net.sf.ehcache">Statistics</A> <B>getStatistics</B>()
|
|
throws java.lang.IllegalStateException</PRE>
|
|
<DL>
|
|
<DD>Gets an immutable Statistics object representing the Cache statistics at the time. How the statistics are calculated
|
|
depends on the statistics accuracy setting. The only aspect of statistics sensitive to the accuracy setting is
|
|
object size. How that is calculated is discussed below.
|
|
<h3>Best Effort Size</h3>
|
|
This result is returned when the statistics accuracy setting is <A HREF="../../../net/sf/ehcache/Statistics.html#STATISTICS_ACCURACY_BEST_EFFORT"><CODE>Statistics.STATISTICS_ACCURACY_BEST_EFFORT</CODE></A>.
|
|
<p/>
|
|
The size is the number of <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache"><CODE>Element</CODE></A>s in the <A HREF="../../../net/sf/ehcache/store/MemoryStore.html" title="class in net.sf.ehcache.store"><CODE>MemoryStore</CODE></A> plus
|
|
the number of <A HREF="../../../net/sf/ehcache/Element.html" title="class in net.sf.ehcache"><CODE>Element</CODE></A>s in the <A HREF="../../../net/sf/ehcache/store/DiskStore.html" title="class in net.sf.ehcache.store"><CODE>DiskStore</CODE></A>.
|
|
<p/>
|
|
This number is the actual number of elements, including expired elements that have
|
|
not been removed. Any duplicates between stores are accounted for.
|
|
<p/>
|
|
Expired elements are removed from the the memory store when
|
|
getting an expired element, or when attempting to spool an expired element to
|
|
disk.
|
|
<p/>
|
|
Expired elements are removed from the disk store when getting an expired element,
|
|
or when the expiry thread runs, which is once every five minutes.
|
|
<p/>
|
|
<h3>Guaranteed Accuracy Size</h3>
|
|
This result is returned when the statistics accuracy setting is <A HREF="../../../net/sf/ehcache/Statistics.html#STATISTICS_ACCURACY_GUARANTEED"><CODE>Statistics.STATISTICS_ACCURACY_GUARANTEED</CODE></A>.
|
|
<p/>
|
|
This method accounts for elements which might be expired or duplicated between stores. It take approximately
|
|
200ms per 1000 elements to execute.
|
|
<h3>Fast but non-accurate Size</h3>
|
|
This result is returned when the statistics accuracy setting is <A HREF="../../../net/sf/ehcache/Statistics.html#STATISTICS_ACCURACY_NONE"><CODE>Statistics.STATISTICS_ACCURACY_NONE</CODE></A>.
|
|
<p/>
|
|
The number given may contain expired elements. In addition if the DiskStore is used it may contain some double
|
|
counting of elements. It takes 6ms for 1000 elements to execute. Time to execute is O(log n). 50,000 elements take
|
|
36ms.
|
|
<p/>
|
|
Note, the <A HREF="../../../net/sf/ehcache/Cache.html#getSize()"><CODE>getSize()</CODE></A> method will have the same value as the size reported by Statistics
|
|
for the statistics accuracy of <A HREF="../../../net/sf/ehcache/Statistics.html#STATISTICS_ACCURACY_BEST_EFFORT"><CODE>Statistics.STATISTICS_ACCURACY_BEST_EFFORT</CODE></A>.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getStatistics()">getStatistics</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>the number of elements in the ehcache, with a varying degree of accuracy, depending on accuracy setting.
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>java.lang.IllegalStateException</CODE> - if the cache is not <A HREF="../../../net/sf/ehcache/Status.html#STATUS_ALIVE"><CODE>Status.STATUS_ALIVE</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="setCacheManager(net.sf.ehcache.CacheManager)"><!-- --></A><H3>
|
|
setCacheManager</H3>
|
|
<PRE>
|
|
public void <B>setCacheManager</B>(<A HREF="../../../net/sf/ehcache/CacheManager.html" title="class in net.sf.ehcache">CacheManager</A> cacheManager)</PRE>
|
|
<DL>
|
|
<DD>For use by CacheManager.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#setCacheManager(net.sf.ehcache.CacheManager)">setCacheManager</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>cacheManager</CODE> - the CacheManager for this cache to use.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getBootstrapCacheLoader()"><!-- --></A><H3>
|
|
getBootstrapCacheLoader</H3>
|
|
<PRE>
|
|
public <A HREF="../../../net/sf/ehcache/bootstrap/BootstrapCacheLoader.html" title="interface in net.sf.ehcache.bootstrap">BootstrapCacheLoader</A> <B>getBootstrapCacheLoader</B>()</PRE>
|
|
<DL>
|
|
<DD>Accessor for the BootstrapCacheLoader associated with this cache. For testing purposes.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getBootstrapCacheLoader()">getBootstrapCacheLoader</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>the BootstrapCacheLoader to use</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="setBootstrapCacheLoader(net.sf.ehcache.bootstrap.BootstrapCacheLoader)"><!-- --></A><H3>
|
|
setBootstrapCacheLoader</H3>
|
|
<PRE>
|
|
public void <B>setBootstrapCacheLoader</B>(<A HREF="../../../net/sf/ehcache/bootstrap/BootstrapCacheLoader.html" title="interface in net.sf.ehcache.bootstrap">BootstrapCacheLoader</A> bootstrapCacheLoader)
|
|
throws <A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>Sets the bootstrap cache loader.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#setBootstrapCacheLoader(net.sf.ehcache.bootstrap.BootstrapCacheLoader)">setBootstrapCacheLoader</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>bootstrapCacheLoader</CODE> - the loader to be used
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE> - if this method is called after the cache is initialized</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="setDiskStorePath(java.lang.String)"><!-- --></A><H3>
|
|
setDiskStorePath</H3>
|
|
<PRE>
|
|
public void <B>setDiskStorePath</B>(java.lang.String diskStorePath)
|
|
throws <A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></PRE>
|
|
<DL>
|
|
<DD>DiskStore paths can conflict between CacheManager instances. This method allows the path to be changed.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#setDiskStorePath(java.lang.String)">setDiskStorePath</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>diskStorePath</CODE> - the new path to be used.
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE><A HREF="../../../net/sf/ehcache/CacheException.html" title="class in net.sf.ehcache">CacheException</A></CODE> - if this method is called after the cache is initialized</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="equals(java.lang.Object)"><!-- --></A><H3>
|
|
equals</H3>
|
|
<PRE>
|
|
public boolean <B>equals</B>(java.lang.Object object)</PRE>
|
|
<DL>
|
|
<DD>An equals method which follows the contract of <CODE>Object.equals(Object)</CODE>
|
|
<p/>
|
|
An Cache is equal to another one if it implements Ehcache and has the same GUID.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Overrides:</B><DD><CODE>equals</CODE> in class <CODE>java.lang.Object</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>object</CODE> - the reference object with which to compare.
|
|
<DT><B>Returns:</B><DD><code>true</code> if this object is the same as the obj
|
|
argument; <code>false</code> otherwise.<DT><B>See Also:</B><DD><A HREF="../../../net/sf/ehcache/Cache.html#hashCode()"><CODE>hashCode()</CODE></A>,
|
|
<CODE>Hashtable</CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="hashCode()"><!-- --></A><H3>
|
|
hashCode</H3>
|
|
<PRE>
|
|
public int <B>hashCode</B>()</PRE>
|
|
<DL>
|
|
<DD>Returns a hash code value for the object. This method is
|
|
supported for the benefit of hashtables such as those provided by
|
|
<code>java.util.Hashtable</code>.
|
|
<p/>
|
|
The general contract of <code>hashCode</code> is:
|
|
<ul>
|
|
<li>Whenever it is invoked on the same object more than once during
|
|
an execution of a Java application, the <tt>hashCode</tt> method
|
|
must consistently return the same integer, provided no information
|
|
used in <tt>equals</tt> comparisons on the object is modified.
|
|
This integer need not remain consistent from one execution of an
|
|
application to another execution of the same application.
|
|
<li>If two objects are equal according to the <tt>equals(Object)</tt>
|
|
method, then calling the <code>hashCode</code> method on each of
|
|
the two objects must produce the same integer result.
|
|
<li>It is <em>not</em> required that if two objects are unequal
|
|
according to the <CODE>Object.equals(Object)</CODE>
|
|
method, then calling the <tt>hashCode</tt> method on each of the
|
|
two objects must produce distinct integer results. However, the
|
|
programmer should be aware that producing distinct integer results
|
|
for unequal objects may improve the performance of hashtables.
|
|
</ul>
|
|
<p/>
|
|
As much as is reasonably practical, the hashCode method defined by
|
|
class <tt>Object</tt> does return distinct integers for distinct
|
|
objects. (This is typically implemented by converting the internal
|
|
address of the object into an integer, but this implementation
|
|
technique is not required by the
|
|
Java<font size="-2"><sup>TM</sup></font> programming language.)
|
|
<p/>
|
|
This implementation use the GUID of the cache.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Overrides:</B><DD><CODE>hashCode</CODE> in class <CODE>java.lang.Object</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>a hash code value for this object.<DT><B>See Also:</B><DD><CODE>Object.equals(Object)</CODE>,
|
|
<CODE>Hashtable</CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="registerCacheExtension(net.sf.ehcache.extension.CacheExtension)"><!-- --></A><H3>
|
|
registerCacheExtension</H3>
|
|
<PRE>
|
|
public void <B>registerCacheExtension</B>(<A HREF="../../../net/sf/ehcache/extension/CacheExtension.html" title="interface in net.sf.ehcache.extension">CacheExtension</A> cacheExtension)</PRE>
|
|
<DL>
|
|
<DD>Register a <A HREF="../../../net/sf/ehcache/extension/CacheExtension.html" title="interface in net.sf.ehcache.extension"><CODE>CacheExtension</CODE></A> with the cache. It will then be tied into the cache lifecycle.
|
|
<p/>
|
|
If the CacheExtension is not initialised, initialise it.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#registerCacheExtension(net.sf.ehcache.extension.CacheExtension)">registerCacheExtension</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="unregisterCacheExtension(net.sf.ehcache.extension.CacheExtension)"><!-- --></A><H3>
|
|
unregisterCacheExtension</H3>
|
|
<PRE>
|
|
public void <B>unregisterCacheExtension</B>(<A HREF="../../../net/sf/ehcache/extension/CacheExtension.html" title="interface in net.sf.ehcache.extension">CacheExtension</A> cacheExtension)</PRE>
|
|
<DL>
|
|
<DD>Unregister a <A HREF="../../../net/sf/ehcache/extension/CacheExtension.html" title="interface in net.sf.ehcache.extension"><CODE>CacheExtension</CODE></A> with the cache. It will then be detached from the cache lifecycle.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#unregisterCacheExtension(net.sf.ehcache.extension.CacheExtension)">unregisterCacheExtension</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getAverageGetTime()"><!-- --></A><H3>
|
|
getAverageGetTime</H3>
|
|
<PRE>
|
|
public float <B>getAverageGetTime</B>()</PRE>
|
|
<DL>
|
|
<DD>The average get time in ms.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getAverageGetTime()">getAverageGetTime</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="setCacheExceptionHandler(net.sf.ehcache.exceptionhandler.CacheExceptionHandler)"><!-- --></A><H3>
|
|
setCacheExceptionHandler</H3>
|
|
<PRE>
|
|
public void <B>setCacheExceptionHandler</B>(<A HREF="../../../net/sf/ehcache/exceptionhandler/CacheExceptionHandler.html" title="interface in net.sf.ehcache.exceptionhandler">CacheExceptionHandler</A> cacheExceptionHandler)</PRE>
|
|
<DL>
|
|
<DD>Sets an ExceptionHandler on the Cache. If one is already set, it is overwritten.
|
|
<p/>
|
|
The ExceptionHandler is only used if this Cache's methods are accessed using
|
|
<A HREF="../../../net/sf/ehcache/exceptionhandler/ExceptionHandlingDynamicCacheProxy.html" title="class in net.sf.ehcache.exceptionhandler"><CODE>ExceptionHandlingDynamicCacheProxy</CODE></A>.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#setCacheExceptionHandler(net.sf.ehcache.exceptionhandler.CacheExceptionHandler)">setCacheExceptionHandler</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>See Also:</B><DD><A HREF="../../../net/sf/ehcache/exceptionhandler/ExceptionHandlingDynamicCacheProxy.html" title="class in net.sf.ehcache.exceptionhandler"><CODE>ExceptionHandlingDynamicCacheProxy</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getCacheExceptionHandler()"><!-- --></A><H3>
|
|
getCacheExceptionHandler</H3>
|
|
<PRE>
|
|
public <A HREF="../../../net/sf/ehcache/exceptionhandler/CacheExceptionHandler.html" title="interface in net.sf.ehcache.exceptionhandler">CacheExceptionHandler</A> <B>getCacheExceptionHandler</B>()</PRE>
|
|
<DL>
|
|
<DD>Gets the ExceptionHandler on this Cache, or null if there isn't one.
|
|
<p/>
|
|
The ExceptionHandler is only used if this Cache's methods are accessed using
|
|
<A HREF="../../../net/sf/ehcache/exceptionhandler/ExceptionHandlingDynamicCacheProxy.html" title="class in net.sf.ehcache.exceptionhandler"><CODE>ExceptionHandlingDynamicCacheProxy</CODE></A>.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getCacheExceptionHandler()">getCacheExceptionHandler</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>See Also:</B><DD><A HREF="../../../net/sf/ehcache/exceptionhandler/ExceptionHandlingDynamicCacheProxy.html" title="class in net.sf.ehcache.exceptionhandler"><CODE>ExceptionHandlingDynamicCacheProxy</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="setCacheLoader(net.sf.ehcache.loader.CacheLoader)"><!-- --></A><H3>
|
|
setCacheLoader</H3>
|
|
<PRE>
|
|
public void <B>setCacheLoader</B>(<A HREF="../../../net/sf/ehcache/loader/CacheLoader.html" title="interface in net.sf.ehcache.loader">CacheLoader</A> cacheLoader)</PRE>
|
|
<DL>
|
|
<DD>Setter for the CacheLoader. Changing the CacheLoader takes immediate effect.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#setCacheLoader(net.sf.ehcache.loader.CacheLoader)">setCacheLoader</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>cacheLoader</CODE> - the loader to dynamically load new cache entries</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getCacheLoader()"><!-- --></A><H3>
|
|
getCacheLoader</H3>
|
|
<PRE>
|
|
public <A HREF="../../../net/sf/ehcache/loader/CacheLoader.html" title="interface in net.sf.ehcache.loader">CacheLoader</A> <B>getCacheLoader</B>()</PRE>
|
|
<DL>
|
|
<DD>Gets the CacheLoader registered in this cache
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#getCacheLoader()">getCacheLoader</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>the loader, or null if there is none</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="asynchronousLoad(java.lang.Object, net.sf.ehcache.loader.CacheLoader, java.lang.Object)"><!-- --></A><H3>
|
|
asynchronousLoad</H3>
|
|
<PRE>
|
|
edu.emory.mathcs.backport.java.util.concurrent.Future <B>asynchronousLoad</B>(java.lang.Object key,
|
|
<A HREF="../../../net/sf/ehcache/loader/CacheLoader.html" title="interface in net.sf.ehcache.loader">CacheLoader</A> specificLoader,
|
|
java.lang.Object argument)</PRE>
|
|
<DL>
|
|
<DD>Does the asynchronous loading.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>specificLoader</CODE> - a specific loader to use. If null the default loader is used.
|
|
<DT><B>Returns:</B><DD>a Future which can be used to monitor execution</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="asynchronousLoadAll(java.util.Collection, java.lang.Object)"><!-- --></A><H3>
|
|
asynchronousLoadAll</H3>
|
|
<PRE>
|
|
edu.emory.mathcs.backport.java.util.concurrent.Future <B>asynchronousLoadAll</B>(java.util.Collection keys,
|
|
java.lang.Object argument)</PRE>
|
|
<DL>
|
|
<DD>Does the asynchronous loading.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>argument</CODE> - the loader argument
|
|
<DT><B>Returns:</B><DD>a Future which can be used to monitor execution</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getExecutorService()"><!-- --></A><H3>
|
|
getExecutorService</H3>
|
|
<PRE>
|
|
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor <B>getExecutorService</B>()</PRE>
|
|
<DL>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>Gets the executor service. This is not publically accessible.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="isDisabled()"><!-- --></A><H3>
|
|
isDisabled</H3>
|
|
<PRE>
|
|
public boolean <B>isDisabled</B>()</PRE>
|
|
<DL>
|
|
<DD>Whether this cache is disabled. "Disabled" means:
|
|
<ol>
|
|
<li>bootstrap is disabled
|
|
<li>puts are discarded
|
|
<li>putQuites are discarded
|
|
</ol>
|
|
In all other respects the cache continues as it is.
|
|
<p/>
|
|
You can disable and enable a cache programmatically through the <A HREF="../../../net/sf/ehcache/Cache.html#setDisabled(boolean)"><CODE>setDisabled(boolean)</CODE></A> method.
|
|
<p/>
|
|
By default caches are enabled on creation, unless the <code>net.sf.ehcache.disabled</code> system
|
|
property is set.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#isDisabled()">isDisabled</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>true if the cache is disabled.<DT><B>See Also:</B><DD><A HREF="../../../net/sf/ehcache/Cache.html#NET_SF_EHCACHE_DISABLED"><CODE>?</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="setDisabled(boolean)"><!-- --></A><H3>
|
|
setDisabled</H3>
|
|
<PRE>
|
|
public void <B>setDisabled</B>(boolean disabled)</PRE>
|
|
<DL>
|
|
<DD>Disables or enables this cache. This call overrides the previous value of disabled, even if the
|
|
<code>net.sf.ehcache.disabled</code> system property is set
|
|
<p/>
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/sf/ehcache/Ehcache.html#setDisabled(boolean)">setDisabled</A></CODE> in interface <CODE><A HREF="../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>disabled</CODE> - true if you wish to disable, false to enable<DT><B>See Also:</B><DD><A HREF="../../../net/sf/ehcache/Cache.html#isDisabled()"><CODE>isDisabled()</CODE></A></DL>
|
|
</DD>
|
|
</DL>
|
|
<!-- ========= END OF CLASS DATA ========= -->
|
|
<HR>
|
|
|
|
|
|
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
|
<A NAME="navbar_bottom"><!-- --></A>
|
|
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
|
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
|
<TR>
|
|
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
|
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
|
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
|
<TR ALIGN="center" VALIGN="top">
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Cache.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
|
</TR>
|
|
</TABLE>
|
|
</TD>
|
|
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
|
<a href="/" target="_top">ehcache</a></EM>
|
|
</TD>
|
|
</TR>
|
|
|
|
<TR>
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
PREV CLASS
|
|
<A HREF="../../../net/sf/ehcache/Cache.KeyedFuture.html" title="class in net.sf.ehcache"><B>NEXT CLASS</B></A></FONT></TD>
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
<A HREF="../../../index.html?net/sf/ehcache/Cache.html" target="_top"><B>FRAMES</B></A>
|
|
<A HREF="Cache.html" target="_top"><B>NO FRAMES</B></A>
|
|
<SCRIPT type="text/javascript">
|
|
<!--
|
|
if(window==top) {
|
|
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
|
}
|
|
//-->
|
|
</SCRIPT>
|
|
<NOSCRIPT>
|
|
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
|
</NOSCRIPT>
|
|
|
|
|
|
</FONT></TD>
|
|
</TR>
|
|
<TR>
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
|
</TR>
|
|
</TABLE>
|
|
<A NAME="skip-navbar_bottom"></A>
|
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
|
|
<HR>
|
|
|
|
</BODY>
|
|
</HTML>
|