Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13098/NHibernate/Cache Modified Files: CachedItem.cs CacheException.cs CacheFactory.cs ICacheConcurrencyStrategy.cs ReadOnlyCache.cs ReadWriteCache.cs Timestamper.cs Log Message: minor code cleanup. Index: CacheFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/CacheFactory.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CacheFactory.cs 31 Oct 2004 04:25:56 -0000 1.2 --- CacheFactory.cs 20 Dec 2004 04:48:29 -0000 1.3 *************** *** 5,9 **** { /// <summary> ! /// Summary description for CacheFactory. /// </summary> public class CacheFactory --- 5,9 ---- { /// <summary> ! /// Factory class for creating an <see cref="ICacheConcurrencyStrategy"/>. /// </summary> public class CacheFactory *************** *** 20,23 **** --- 20,30 ---- public const string NonstrictReadWrite = "nonstrict-read-write"; + /// <summary> + /// Creates an <see cref="ICacheConcurrencyStrategy"/> from the parameters. + /// </summary> + /// <param name="node">The <see cref="XmlNode"/> that contains the attribute <c>usage</c>.</param> + /// <param name="name">The name of the class the strategy is being created for.</param> + /// <param name="mutable"><c>true</c> if the object being stored in the cache is mutable.</param> + /// <returns>An <see cref="ICacheConcurrencyStrategy"/> to use for this object in the <see cref="ICache"/>.</returns> public static ICacheConcurrencyStrategy CreateCache(XmlNode node, string name, bool mutable) { *************** *** 25,28 **** --- 32,42 ---- } + /// <summary> + /// Creates an <see cref="ICacheConcurrencyStrategy"/> from the parameters. + /// </summary> + /// <param name="usage">The name of the strategy that <see cref="ICacheProvider"/> should use for the class.</param> + /// <param name="name">The name of the class the strategy is being created for.</param> + /// <param name="mutable"><c>true</c> if the object being stored in the cache is mutable.</param> + /// <returns>An <see cref="ICacheConcurrencyStrategy"/> to use for this object in the <see cref="ICache"/>.</returns> // was private in h2.1 public static ICacheConcurrencyStrategy CreateCache(string usage, string name, bool mutable) Index: CachedItem.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/CachedItem.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CachedItem.cs 6 May 2004 20:53:59 -0000 1.3 --- CachedItem.cs 20 Dec 2004 04:48:28 -0000 1.4 *************** *** 1,5 **** using System; ! namespace NHibernate.Cache { /// <summary> --- 1,5 ---- using System; ! namespace NHibernate.Cache { /// <summary> *************** *** 8,12 **** /// </summary> [Serializable] ! public class CachedItem { private long freshTimestamp; --- 8,12 ---- /// </summary> [Serializable] ! public class CachedItem { private long freshTimestamp; *************** *** 16,20 **** private object value; ! public CachedItem(object value) { this.value = value; --- 16,20 ---- private object value; ! public CachedItem(object value) { this.value = value; *************** *** 27,36 **** /// The timestamp on the Cached Data. /// </summary> ! public long FreshTimestamp { get { return freshTimestamp; } } ! public long UnlockTimestamp { get { return unlockTimestamp; } --- 27,36 ---- /// The timestamp on the Cached Data. /// </summary> ! public long FreshTimestamp { get { return freshTimestamp; } } ! public long UnlockTimestamp { get { return unlockTimestamp; } *************** *** 40,44 **** /// The actual cached Data. /// </summary> ! public object Value { get { return value; } --- 40,44 ---- /// The actual cached Data. /// </summary> ! public object Value { get { return value; } *************** *** 49,53 **** /// </summary> /// <value>true if the CachedItem has not ever been locked.</value> ! public bool IsFresh { get { return fresh; } --- 49,53 ---- /// </summary> /// <value>true if the CachedItem has not ever been locked.</value> ! public bool IsFresh { get { return fresh; } *************** *** 57,63 **** /// Lock the Item. /// </summary> ! public void Lock() { ! if ( 0 == theLock++ ) { fresh = false; --- 57,63 ---- /// Lock the Item. /// </summary> ! public void Lock() { ! if( 0 == theLock++ ) { fresh = false; *************** *** 65,74 **** } } /// <summary> /// Unlock the Item /// </summary> ! public void Unlock() { ! if ( --theLock == 0 ) { unlockTimestamp = Timestamper.Next(); --- 65,75 ---- } } + /// <summary> /// Unlock the Item /// </summary> ! public void Unlock() { ! if( --theLock == 0 ) { unlockTimestamp = Timestamper.Next(); *************** *** 80,84 **** /// </summary> /// <value>true if there are no locks on the CachedItem.</value> ! public bool IsUnlocked { get { return theLock == 0; } --- 81,85 ---- /// </summary> /// <value>true if there are no locks on the CachedItem.</value> ! public bool IsUnlocked { get { return theLock == 0; } *************** *** 86,88 **** } ! } --- 87,89 ---- } ! } \ No newline at end of file Index: Timestamper.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/Timestamper.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Timestamper.cs 24 Oct 2004 21:42:40 -0000 1.7 --- Timestamper.cs 20 Dec 2004 04:48:29 -0000 1.8 *************** *** 1,4 **** using System; - using System.Runtime.CompilerServices; namespace NHibernate.Cache --- 1,3 ---- Index: ICacheConcurrencyStrategy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/ICacheConcurrencyStrategy.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ICacheConcurrencyStrategy.cs 26 Oct 2004 21:15:09 -0000 1.3 --- ICacheConcurrencyStrategy.cs 20 Dec 2004 04:48:29 -0000 1.4 *************** *** 13,17 **** /// When used to Cache Entities and Collections the <c>key</c> is the <c>id</c> of the /// Entity/Collection and the <c>value</c> should be set to the <see cref="Impl.CacheEntry"/> ! /// for an Entity and the results of <see cref="PeristentCollection"/>.Disassemble for a Collection. /// </para> /// </remarks> --- 13,17 ---- /// When used to Cache Entities and Collections the <c>key</c> is the <c>id</c> of the /// Entity/Collection and the <c>value</c> should be set to the <see cref="Impl.CacheEntry"/> ! /// for an Entity and the results of <see cref="Collection.PersistentCollection"/>.Disassemble for a Collection. /// </para> /// </remarks> *************** *** 61,65 **** /// /// </summary> - /// <param name="key"></param> /// <exception cref="CacheException"></exception> void Clear(); --- 61,64 ---- *************** *** 68,72 **** /// /// </summary> - /// <param name="key"></param> /// <exception cref="CacheException"></exception> void Destroy(); --- 67,70 ---- Index: ReadWriteCache.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/ReadWriteCache.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ReadWriteCache.cs 29 Oct 2004 05:55:26 -0000 1.5 --- ReadWriteCache.cs 20 Dec 2004 04:48:29 -0000 1.6 *************** *** 1,4 **** using System; - using System.Runtime.CompilerServices; namespace NHibernate.Cache --- 1,3 ---- Index: ReadOnlyCache.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/ReadOnlyCache.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ReadOnlyCache.cs 29 Oct 2004 05:55:26 -0000 1.6 --- ReadOnlyCache.cs 20 Dec 2004 04:48:29 -0000 1.7 *************** *** 1,4 **** using System; - using System.Runtime.CompilerServices; namespace NHibernate.Cache --- 1,3 ---- Index: CacheException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/CacheException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CacheException.cs 22 Nov 2004 03:50:04 -0000 1.3 --- CacheException.cs 20 Dec 2004 04:48:28 -0000 1.4 *************** *** 1,16 **** using System; ! namespace NHibernate.Cache { /// <summary> ! /// Represents any exception from an <c>ICache</c> /// </summary> [Serializable] ! public class CacheException : HibernateException { ! public CacheException(string message) : base(message) { } ! public CacheException(Exception e) : base(e) { } } ! } --- 1,20 ---- using System; ! namespace NHibernate.Cache { /// <summary> ! /// Represents any exception from an <see cref="ICache"/>. /// </summary> [Serializable] ! public class CacheException : HibernateException { ! public CacheException(string message) : base( message ) ! { ! } ! public CacheException(Exception e) : base( e ) ! { ! } } ! } \ No newline at end of file |