mirror of https://github.com/apache/cloudstack.git
732 lines
26 KiB
HTML
Executable File
732 lines
26 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:42 EST 2008 -->
|
|
<TITLE>
|
|
EhCache (ehcache)
|
|
</TITLE>
|
|
|
|
<META NAME="keywords" CONTENT="net.sf.ehcache.hibernate.EhCache class">
|
|
|
|
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
|
|
|
|
<SCRIPT type="text/javascript">
|
|
function windowTitle()
|
|
{
|
|
parent.document.title="EhCache (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/EhCache.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/hibernate/EhCacheProvider.html" title="class in net.sf.ehcache.hibernate"><B>NEXT CLASS</B></A></FONT></TD>
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
<A HREF="../../../../index.html?net/sf/ehcache/hibernate/EhCache.html" target="_top"><B>FRAMES</B></A>
|
|
<A HREF="EhCache.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: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
DETAIL: FIELD | <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.hibernate</FONT>
|
|
<BR>
|
|
Class EhCache</H2>
|
|
<PRE>
|
|
java.lang.Object
|
|
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>net.sf.ehcache.hibernate.EhCache</B>
|
|
</PRE>
|
|
<DL>
|
|
<DT><B>All Implemented Interfaces:</B> <DD>org.hibernate.cache.Cache</DD>
|
|
</DL>
|
|
<HR>
|
|
<DL>
|
|
<DT><PRE>public final class <B>EhCache</B><DT>extends java.lang.Object<DT>implements org.hibernate.cache.Cache</DL>
|
|
</PRE>
|
|
|
|
<P>
|
|
EHCache plugin for Hibernate.
|
|
<p/>
|
|
EHCache uses a <A HREF="../../../../net/sf/ehcache/store/MemoryStore.html" title="class in net.sf.ehcache.store"><CODE>MemoryStore</CODE></A> and a
|
|
<A HREF="../../../../net/sf/ehcache/store/DiskStore.html" title="class in net.sf.ehcache.store"><CODE>DiskStore</CODE></A>.
|
|
<p/>
|
|
The <A HREF="../../../../net/sf/ehcache/store/DiskStore.html" title="class in net.sf.ehcache.store"><CODE>DiskStore</CODE></A> requires that both keys and values be <CODE>Serializable</CODE>.
|
|
However the MemoryStore does not and in ehcache-1.2 nonSerializable Objects are permitted. They are discarded
|
|
if an attempt it made to overflow them to Disk or to replicate them to remote cache peers.
|
|
<p/>
|
|
<P>
|
|
|
|
<P>
|
|
<DL>
|
|
<DT><B>Version:</B></DT>
|
|
<DD>$Id: EhCache.java 612 2008-05-07 22:48:26Z gregluck $</DD>
|
|
<DT><B>Author:</B></DT>
|
|
<DD>Greg Luck, Emmanuel Bernard</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<P>
|
|
|
|
<!-- ======== 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/hibernate/EhCache.html#EhCache(net.sf.ehcache.Ehcache)">EhCache</A></B>(<A HREF="../../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A> cache)</CODE>
|
|
|
|
<BR>
|
|
Creates a new Hibernate pluggable cache by name.</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> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../../net/sf/ehcache/hibernate/EhCache.html#clear()">clear</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Remove all elements in the cache, but leave the cache in a useable state.</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/hibernate/EhCache.html#destroy()">destroy</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Remove the cache and make it unuseable.</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/hibernate/EhCache.html#get(java.lang.Object)">get</A></B>(java.lang.Object key)</CODE>
|
|
|
|
<BR>
|
|
Gets a value of an element which matches the given key.</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/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A></CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../../net/sf/ehcache/hibernate/EhCache.html#getBackingCache()">getBackingCache</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Package protected method used for testing</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/hibernate/EhCache.html#getElementCountInMemory()">getElementCountInMemory</A></B>()</CODE>
|
|
|
|
<BR>
|
|
</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/hibernate/EhCache.html#getElementCountOnDisk()">getElementCountOnDisk</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/hibernate/EhCache.html#getRegionName()">getRegionName</A></B>()</CODE>
|
|
|
|
<BR>
|
|
</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/hibernate/EhCache.html#getSizeInMemory()">getSizeInMemory</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Warning: This method can be very expensive to run.</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/hibernate/EhCache.html#getTimeout()">getTimeout</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Returns the lock timeout for this cache, which is 60s</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/hibernate/EhCache.html#lock(java.lang.Object)">lock</A></B>(java.lang.Object key)</CODE>
|
|
|
|
<BR>
|
|
Calls to this method should perform their own synchronization.</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/hibernate/EhCache.html#nextTimestamp()">nextTimestamp</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Gets the next timestamp;</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/hibernate/EhCache.html#put(java.lang.Object, java.lang.Object)">put</A></B>(java.lang.Object key,
|
|
java.lang.Object value)</CODE>
|
|
|
|
<BR>
|
|
Puts an object into the cache.</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/hibernate/EhCache.html#read(java.lang.Object)">read</A></B>(java.lang.Object key)</CODE>
|
|
|
|
<BR>
|
|
Gets an object 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/hibernate/EhCache.html#remove(java.lang.Object)">remove</A></B>(java.lang.Object key)</CODE>
|
|
|
|
<BR>
|
|
Removes the element which matches the key.</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/hibernate/EhCache.html#toMap()">toMap</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/hibernate/EhCache.html#toString()">toString</A></B>()</CODE>
|
|
|
|
<BR>
|
|
</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/hibernate/EhCache.html#unlock(java.lang.Object)">unlock</A></B>(java.lang.Object key)</CODE>
|
|
|
|
<BR>
|
|
Calls to this method should perform their own synchronization.</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/hibernate/EhCache.html#update(java.lang.Object, java.lang.Object)">update</A></B>(java.lang.Object key,
|
|
java.lang.Object value)</CODE>
|
|
|
|
<BR>
|
|
Updates an object in the cache, or if it does not exist, inserts it.</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>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<P>
|
|
|
|
<!-- ========= 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="EhCache(net.sf.ehcache.Ehcache)"><!-- --></A><H3>
|
|
EhCache</H3>
|
|
<PRE>
|
|
public <B>EhCache</B>(<A HREF="../../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A> cache)</PRE>
|
|
<DL>
|
|
<DD>Creates a new Hibernate pluggable cache by name.
|
|
<p/>
|
|
ehcache will look in ehcache.xml to load the configuration for the cache.
|
|
If the cache is not there, it will use the defaultCache settings. It is
|
|
always a good idea to specifically configure each cache.
|
|
<P>
|
|
<DL>
|
|
<DT><B>Parameters:</B><DD><CODE>cache</CODE> - The backing ehcache cache.</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="get(java.lang.Object)"><!-- --></A><H3>
|
|
get</H3>
|
|
<PRE>
|
|
public final java.lang.Object <B>get</B>(java.lang.Object key)
|
|
throws org.hibernate.cache.CacheException</PRE>
|
|
<DL>
|
|
<DD>Gets a value of an element which matches the given key.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE>get</CODE> in interface <CODE>org.hibernate.cache.Cache</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - the key of the element to return.
|
|
<DT><B>Returns:</B><DD>The value placed into the cache with an earlier put, or null if not found or expired
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>org.hibernate.cache.CacheException</CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="read(java.lang.Object)"><!-- --></A><H3>
|
|
read</H3>
|
|
<PRE>
|
|
public final java.lang.Object <B>read</B>(java.lang.Object key)
|
|
throws org.hibernate.cache.CacheException</PRE>
|
|
<DL>
|
|
<DD>Gets an object from the cache.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE>read</CODE> in interface <CODE>org.hibernate.cache.Cache</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - an Object value
|
|
<DT><B>Returns:</B><DD>the Object, or null if not found
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>org.hibernate.cache.CacheException</CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="update(java.lang.Object, java.lang.Object)"><!-- --></A><H3>
|
|
update</H3>
|
|
<PRE>
|
|
public final void <B>update</B>(java.lang.Object key,
|
|
java.lang.Object value)
|
|
throws org.hibernate.cache.CacheException</PRE>
|
|
<DL>
|
|
<DD>Updates an object in the cache, or if it does not exist, inserts it.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE>update</CODE> in interface <CODE>org.hibernate.cache.Cache</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - an Object key<DD><CODE>value</CODE> - an Object value
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>org.hibernate.cache.CacheException</CODE> - if the <A HREF="../../../../net/sf/ehcache/CacheManager.html" title="class in net.sf.ehcache"><CODE>CacheManager</CODE></A> is shutdown or another <CODE>Exception</CODE> occurs.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="put(java.lang.Object, java.lang.Object)"><!-- --></A><H3>
|
|
put</H3>
|
|
<PRE>
|
|
public final void <B>put</B>(java.lang.Object key,
|
|
java.lang.Object value)
|
|
throws org.hibernate.cache.CacheException</PRE>
|
|
<DL>
|
|
<DD>Puts an object into the cache.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE>put</CODE> in interface <CODE>org.hibernate.cache.Cache</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - an Object key<DD><CODE>value</CODE> - an Object value
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>org.hibernate.cache.CacheException</CODE> - if the <A HREF="../../../../net/sf/ehcache/CacheManager.html" title="class in net.sf.ehcache"><CODE>CacheManager</CODE></A> is shutdown or another <CODE>Exception</CODE> occurs.</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="remove(java.lang.Object)"><!-- --></A><H3>
|
|
remove</H3>
|
|
<PRE>
|
|
public final void <B>remove</B>(java.lang.Object key)
|
|
throws org.hibernate.cache.CacheException</PRE>
|
|
<DL>
|
|
<DD>Removes the element which matches the key.
|
|
<p/>
|
|
If no element matches, nothing is removed and no Exception is thrown.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE>remove</CODE> in interface <CODE>org.hibernate.cache.Cache</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
<DT><B>Parameters:</B><DD><CODE>key</CODE> - the key of the element to remove
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>org.hibernate.cache.CacheException</CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="clear()"><!-- --></A><H3>
|
|
clear</H3>
|
|
<PRE>
|
|
public final void <B>clear</B>()
|
|
throws org.hibernate.cache.CacheException</PRE>
|
|
<DL>
|
|
<DD>Remove all elements in the cache, but leave the cache in a useable state.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE>clear</CODE> in interface <CODE>org.hibernate.cache.Cache</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>org.hibernate.cache.CacheException</CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="destroy()"><!-- --></A><H3>
|
|
destroy</H3>
|
|
<PRE>
|
|
public final void <B>destroy</B>()
|
|
throws org.hibernate.cache.CacheException</PRE>
|
|
<DL>
|
|
<DD>Remove the cache and make it unuseable.
|
|
<p/>
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE>destroy</CODE> in interface <CODE>org.hibernate.cache.Cache</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>org.hibernate.cache.CacheException</CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="lock(java.lang.Object)"><!-- --></A><H3>
|
|
lock</H3>
|
|
<PRE>
|
|
public final void <B>lock</B>(java.lang.Object key)
|
|
throws org.hibernate.cache.CacheException</PRE>
|
|
<DL>
|
|
<DD>Calls to this method should perform their own synchronization.
|
|
It is provided for distributed caches.
|
|
<p/>
|
|
ehcache does not support distributed locking and therefore this method does nothing.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE>lock</CODE> in interface <CODE>org.hibernate.cache.Cache</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>org.hibernate.cache.CacheException</CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="unlock(java.lang.Object)"><!-- --></A><H3>
|
|
unlock</H3>
|
|
<PRE>
|
|
public final void <B>unlock</B>(java.lang.Object key)
|
|
throws org.hibernate.cache.CacheException</PRE>
|
|
<DL>
|
|
<DD>Calls to this method should perform their own synchronization.
|
|
<p/>
|
|
ehcache does not support distributed locking and therefore this method does nothing.
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE>unlock</CODE> in interface <CODE>org.hibernate.cache.Cache</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Throws:</B>
|
|
<DD><CODE>org.hibernate.cache.CacheException</CODE></DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="nextTimestamp()"><!-- --></A><H3>
|
|
nextTimestamp</H3>
|
|
<PRE>
|
|
public final long <B>nextTimestamp</B>()</PRE>
|
|
<DL>
|
|
<DD>Gets the next timestamp;
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE>nextTimestamp</CODE> in interface <CODE>org.hibernate.cache.Cache</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getTimeout()"><!-- --></A><H3>
|
|
getTimeout</H3>
|
|
<PRE>
|
|
public final int <B>getTimeout</B>()</PRE>
|
|
<DL>
|
|
<DD>Returns the lock timeout for this cache, which is 60s
|
|
<P>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE>getTimeout</CODE> in interface <CODE>org.hibernate.cache.Cache</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getRegionName()"><!-- --></A><H3>
|
|
getRegionName</H3>
|
|
<PRE>
|
|
public final java.lang.String <B>getRegionName</B>()</PRE>
|
|
<DL>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE>getRegionName</CODE> in interface <CODE>org.hibernate.cache.Cache</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>the region name of the cache, which is the cache name in ehcache</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getSizeInMemory()"><!-- --></A><H3>
|
|
getSizeInMemory</H3>
|
|
<PRE>
|
|
public final long <B>getSizeInMemory</B>()</PRE>
|
|
<DL>
|
|
<DD>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>getSizeInMemory</CODE> in interface <CODE>org.hibernate.cache.Cache</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>the approximate size of memory ehcache is using for the MemoryStore for this cache</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getElementCountInMemory()"><!-- --></A><H3>
|
|
getElementCountInMemory</H3>
|
|
<PRE>
|
|
public final long <B>getElementCountInMemory</B>()</PRE>
|
|
<DL>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE>getElementCountInMemory</CODE> in interface <CODE>org.hibernate.cache.Cache</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>the number of elements in ehcache's MemoryStore</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getElementCountOnDisk()"><!-- --></A><H3>
|
|
getElementCountOnDisk</H3>
|
|
<PRE>
|
|
public final long <B>getElementCountOnDisk</B>()</PRE>
|
|
<DL>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE>getElementCountOnDisk</CODE> in interface <CODE>org.hibernate.cache.Cache</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>the number of elements in ehcache's DiskStore. 0 is there is no DiskStore</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="toMap()"><!-- --></A><H3>
|
|
toMap</H3>
|
|
<PRE>
|
|
public final java.util.Map <B>toMap</B>()</PRE>
|
|
<DL>
|
|
<DD><DL>
|
|
<DT><B>Specified by:</B><DD><CODE>toMap</CODE> in interface <CODE>org.hibernate.cache.Cache</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>a copy of the cache Elements as a Map</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="toString()"><!-- --></A><H3>
|
|
toString</H3>
|
|
<PRE>
|
|
public final java.lang.String <B>toString</B>()</PRE>
|
|
<DL>
|
|
<DD><DL>
|
|
<DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>the region name, which is the cache name in ehcache</DL>
|
|
</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<A NAME="getBackingCache()"><!-- --></A><H3>
|
|
getBackingCache</H3>
|
|
<PRE>
|
|
final <A HREF="../../../../net/sf/ehcache/Ehcache.html" title="interface in net.sf.ehcache">Ehcache</A> <B>getBackingCache</B>()</PRE>
|
|
<DL>
|
|
<DD>Package protected method used for testing
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
</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/EhCache.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/hibernate/EhCacheProvider.html" title="class in net.sf.ehcache.hibernate"><B>NEXT CLASS</B></A></FONT></TD>
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
<A HREF="../../../../index.html?net/sf/ehcache/hibernate/EhCache.html" target="_top"><B>FRAMES</B></A>
|
|
<A HREF="EhCache.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: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
DETAIL: FIELD | <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>
|