Skip to content

Commit 5271a71

Browse files
author
Kevin Williams
committed
fixing xml comments and letting ReSharper do reformatting
SVN: trunk@1162
1 parent e5c688f commit 5271a71

13 files changed

+362
-202
lines changed

src/NHibernate/Cache/CacheException.cs

+10-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,19 @@ namespace NHibernate.Cache
88
[Serializable]
99
public class CacheException : HibernateException
1010
{
11-
public CacheException(string message) : base( message )
11+
/// <summary>
12+
///
13+
/// </summary>
14+
/// <param name="message"></param>
15+
public CacheException( string message ) : base( message )
1216
{
1317
}
1418

15-
public CacheException(Exception e) : base( e )
19+
/// <summary>
20+
///
21+
/// </summary>
22+
/// <param name="e"></param>
23+
public CacheException( Exception e ) : base( e )
1624
{
1725
}
1826
}

src/NHibernate/Cache/CacheFactory.cs

+19-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using System;
21
using System.Xml;
2+
using log4net;
33

44
namespace NHibernate.Cache
55
{
@@ -8,15 +8,18 @@ namespace NHibernate.Cache
88
/// </summary>
99
public class CacheFactory
1010
{
11-
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( typeof(CacheFactory) );
11+
private static readonly ILog log = LogManager.GetLogger( typeof( CacheFactory ) );
1212

1313
private CacheFactory()
1414
{
1515
// not publically creatable
1616
}
1717

18+
/// <summary></summary>
1819
public const string ReadOnly = "read-only";
20+
/// <summary></summary>
1921
public const string ReadWrite = "read-write";
22+
/// <summary></summary>
2023
public const string NonstrictReadWrite = "nonstrict-read-write";
2124

2225
/// <summary>
@@ -26,11 +29,11 @@ private CacheFactory()
2629
/// <param name="name">The name of the class the strategy is being created for.</param>
2730
/// <param name="mutable"><c>true</c> if the object being stored in the cache is mutable.</param>
2831
/// <returns>An <see cref="ICacheConcurrencyStrategy"/> to use for this object in the <see cref="ICache"/>.</returns>
29-
public static ICacheConcurrencyStrategy CreateCache(XmlNode node, string name, bool mutable)
32+
public static ICacheConcurrencyStrategy CreateCache( XmlNode node, string name, bool mutable )
3033
{
31-
return CacheFactory.CreateCache( node.Attributes["usage"].Value, name, mutable );
34+
return CacheFactory.CreateCache( node.Attributes[ "usage" ].Value, name, mutable );
3235
}
33-
36+
3437
/// <summary>
3538
/// Creates an <see cref="ICacheConcurrencyStrategy"/> from the parameters.
3639
/// </summary>
@@ -39,36 +42,36 @@ public static ICacheConcurrencyStrategy CreateCache(XmlNode node, string name, b
3942
/// <param name="mutable"><c>true</c> if the object being stored in the cache is mutable.</param>
4043
/// <returns>An <see cref="ICacheConcurrencyStrategy"/> to use for this object in the <see cref="ICache"/>.</returns>
4144
// was private in h2.1
42-
public static ICacheConcurrencyStrategy CreateCache(string usage, string name, bool mutable)
45+
public static ICacheConcurrencyStrategy CreateCache( string usage, string name, bool mutable )
4346
{
44-
if( log.IsDebugEnabled )
47+
if( log.IsDebugEnabled )
4548
{
4649
log.Debug( "cache for: " + name + "usage strategy: " + usage );
4750
}
48-
51+
4952
ICacheConcurrencyStrategy ccs = null;
50-
switch( usage )
53+
switch( usage )
5154
{
52-
case CacheFactory.ReadOnly :
53-
if( mutable )
55+
case CacheFactory.ReadOnly:
56+
if( mutable )
5457
{
5558
log.Warn( "read-only cache configured for mutable: " + name );
5659
}
5760
ccs = new ReadOnlyCache();
5861
break;
59-
case CacheFactory.ReadWrite :
62+
case CacheFactory.ReadWrite:
6063
ccs = new ReadWriteCache();
6164
break;
62-
case CacheFactory.NonstrictReadWrite :
65+
case CacheFactory.NonstrictReadWrite:
6366
ccs = new NonstrictReadWriteCache();
6467
break;
65-
default :
68+
default:
6669
throw new MappingException( "cache usage attribute should be read-write, read-only, nonstrict-read-write, or transactional" );
6770
}
6871

6972
return ccs;
70-
73+
7174
}
7275

7376
}
74-
}
77+
}

src/NHibernate/Cache/CachedItem.cs

+7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ public class CachedItem
1515
private int theLock;
1616
private object value;
1717

18+
/// <summary>
19+
///
20+
/// </summary>
21+
/// <param name="value"></param>
1822
public CachedItem(object value)
1923
{
2024
this.value = value;
@@ -31,6 +35,9 @@ public long FreshTimestamp
3135
get { return freshTimestamp; }
3236
}
3337

38+
/// <summary>
39+
///
40+
/// </summary>
3441
public long UnlockTimestamp
3542
{
3643
get { return unlockTimestamp; }
+21-14
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,46 @@
1-
using System;
21
using System.Collections;
3-
using System.Runtime.CompilerServices;
42

5-
namespace NHibernate.Cache
3+
namespace NHibernate.Cache
64
{
75
/// <summary>
86
/// A simple <c>Hashtable</c> based cache
97
/// </summary>
108
public class HashtableCache : ICache
119
{
12-
private static object synchObject = new object();
10+
// private static object synchObject = new object();
1311
private Hashtable cache = new Hashtable();
1412
private string region;
1513

16-
public HashtableCache(string region)
14+
/// <summary>
15+
///
16+
/// </summary>
17+
/// <param name="region"></param>
18+
public HashtableCache( string region )
1719
{
1820
this.region = region;
1921
}
2022

2123
#region ICache Members
22-
23-
public object Get(object key)
24+
25+
/// <summary></summary>
26+
public object Get( object key )
2427
{
25-
return cache[key];
28+
return cache[ key ];
2629
}
2730

28-
public void Put(object key, object value)
31+
/// <summary></summary>
32+
public void Put( object key, object value )
2933
{
30-
cache[key] = value;
34+
cache[ key ] = value;
3135
}
3236

33-
public void Remove(object key)
37+
/// <summary></summary>
38+
public void Remove( object key )
3439
{
35-
cache.Remove(key);
40+
cache.Remove( key );
3641
}
3742

43+
/// <summary></summary>
3844
public void Clear()
3945
{
4046
cache.Clear();
@@ -48,11 +54,12 @@ public void Destroy()
4854
cache = new Hashtable();
4955
}
5056

57+
/// <summary></summary>
5158
public string Region
5259
{
53-
set { region = value; }
60+
set { region = value; }
5461
}
5562

5663
#endregion
5764
}
58-
}
65+
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
using System;
21
using System.Collections;
32

4-
namespace NHibernate.Cache
3+
namespace NHibernate.Cache
54
{
65
/// <summary>
76
/// Cache Provider plugin for NHibernate that is configured by using
@@ -11,16 +10,26 @@ public class HashtableCacheProvider : ICacheProvider
1110
{
1211
#region ICacheProvider Members
1312

14-
public ICache BuildCache(string regionName, IDictionary properties)
13+
/// <summary>
14+
///
15+
/// </summary>
16+
/// <param name="regionName"></param>
17+
/// <param name="properties"></param>
18+
/// <returns></returns>
19+
public ICache BuildCache( string regionName, IDictionary properties )
1520
{
1621
return new HashtableCache( regionName );
1722
}
1823

24+
/// <summary>
25+
///
26+
/// </summary>
27+
/// <returns></returns>
1928
public long NextTimestamp()
2029
{
2130
return Timestamper.Next();
2231
}
2332

2433
#endregion
2534
}
26-
}
35+
}

src/NHibernate/Cache/ICache.cs

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
3-
namespace NHibernate.Cache
1+
namespace NHibernate.Cache
42
{
53
/// <summary>
64
/// Implementors define a caching algorithm.
@@ -13,24 +11,28 @@ namespace NHibernate.Cache
1311
/// value is a <see cref="CachedItem"/>.
1412
/// </para>
1513
/// </remarks>
16-
public interface ICache
14+
public interface ICache
1715
{
18-
1916
/// <summary>
2017
/// Get the object from the Cache
2118
/// </summary>
2219
/// <param name="key"></param>
2320
/// <returns></returns>
24-
object Get(object key);
21+
object Get( object key );
2522

26-
void Put(object key, object value);
23+
/// <summary>
24+
///
25+
/// </summary>
26+
/// <param name="key"></param>
27+
/// <param name="value"></param>
28+
void Put( object key, object value );
2729

2830
/// <summary>
2931
/// Remove an item from the Cache.
3032
/// </summary>
3133
/// <param name="key">The Key of the Item in the Cache to remove.</param>
3234
/// <exception cref="CacheException"></exception>
33-
void Remove(object key);
35+
void Remove( object key );
3436

3537
/// <summary>
3638
/// Clear the Cache
@@ -48,9 +50,9 @@ public interface ICache
4850
/// Sets the Cache Region name.
4951
/// </summary>
5052
/// <exception cref="CacheException"></exception>
51-
string Region {set;}
53+
string Region { set; }
5254

5355
}
5456

5557

56-
}
58+
}

src/NHibernate/Cache/ICacheConcurrencyStrategy.cs

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
3-
namespace NHibernate.Cache
1+
namespace NHibernate.Cache
42
{
53
/// <summary>
64
/// Implementors manage transactional access to cached data.
@@ -15,16 +13,16 @@ namespace NHibernate.Cache
1513
/// for an Entity and the results of <see cref="Collection.PersistentCollection"/>.Disassemble for a Collection.
1614
/// </para>
1715
/// </remarks>
18-
public interface ICacheConcurrencyStrategy
19-
{
16+
public interface ICacheConcurrencyStrategy
17+
{
2018
/// <summary>
2119
/// Attempt to retrieve an object from the Cache
2220
/// </summary>
2321
/// <param name="key">The key (id) of the object to get out of the Cache.</param>
2422
/// <param name="txTimestamp">A timestamp prior to the transaction start time</param>
2523
/// <returns>The cached object or <c>null</c></returns>
2624
/// <exception cref="CacheException"></exception>
27-
object Get(object key, long txTimestamp);
25+
object Get( object key, long txTimestamp );
2826

2927
/// <summary>
3028
/// Attempt to Cache an object
@@ -34,28 +32,28 @@ public interface ICacheConcurrencyStrategy
3432
/// <param name="txTimestamp">A timestamp prior to the transaction start time</param>
3533
/// <returns><c>true</c> if the object was successfully cached</returns>
3634
/// <exception cref="CacheException"></exception>
37-
bool Put(object key, object value, long txTimestamp);
35+
bool Put( object key, object value, long txTimestamp );
3836

3937
/// <summary>
4038
/// We are going to attempt to update/delete the keyed object
4139
/// </summary>
4240
/// <param name="key">The key</param>
4341
/// <exception cref="CacheException"></exception>
44-
void Lock(object key);
42+
void Lock( object key );
4543

4644
/// <summary>
4745
/// We have finished the attempted update/delete (which may or may not have been successful)
4846
/// </summary>
4947
/// <param name="key">The key</param>
5048
/// <exception cref="CacheException"></exception>
51-
void Release(object key);
49+
void Release( object key );
5250

5351
/// <summary>
5452
///
5553
/// </summary>
5654
/// <param name="key"></param>
5755
/// <exception cref="CacheException"></exception>
58-
void Remove(object key);
56+
void Remove( object key );
5957

6058
/// <summary>
6159
///
@@ -73,6 +71,6 @@ public interface ICacheConcurrencyStrategy
7371
/// Gets or sets the <see cref="ICache"/> for this strategy to use.
7472
/// </summary>
7573
/// <value>The <see cref="ICache"/> for this strategy to use.</value>
76-
ICache Cache { get; set ;}
74+
ICache Cache { get; set; }
7775
}
78-
}
76+
}

0 commit comments

Comments
 (0)