forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathICache.cs
85 lines (75 loc) · 2.1 KB
/
ICache.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
using System;
namespace NHibernate.Cache
{
/// <summary>
/// Implementors define a caching algorithm.
/// </summary>
/// <remarks>
/// <threadsafety instance="true" />
/// <para>
/// All implementations <em>must</em> be threadsafe.
/// </para>
/// <para>
/// The key is the identifier of the object that is being cached and the
/// value is a <see cref="CachedItem"/>.
/// </para>
/// </remarks>
// Since 5.2
[Obsolete("Derive from CacheBase instead. NHibernate members using this type will switch to CacheBase in a future version.")]
public partial interface ICache
{
/// <summary>
/// Get the object from the Cache
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
object Get(object key);
/// <summary>
///
/// </summary>
/// <param name="key"></param>
/// <param name="value"></param>
void Put(object key, object value);
/// <summary>
/// Remove an item from the Cache.
/// </summary>
/// <param name="key">The Key of the Item in the Cache to remove.</param>
/// <exception cref="CacheException"></exception>
void Remove(object key);
/// <summary>
/// Clear the Cache
/// </summary>
/// <exception cref="CacheException"></exception>
void Clear();
/// <summary>
/// Clean up.
/// </summary>
/// <exception cref="CacheException"></exception>
void Destroy();
/// <summary>
/// If this is a clustered cache, lock the item
/// </summary>
/// <param name="key">The Key of the Item in the Cache to lock.</param>
/// <exception cref="CacheException"></exception>
void Lock(object key);
/// <summary>
/// If this is a clustered cache, unlock the item
/// </summary>
/// <param name="key">The Key of the Item in the Cache to unlock.</param>
/// <exception cref="CacheException"></exception>
void Unlock(object key);
/// <summary>
/// Generate a timestamp
/// </summary>
/// <returns></returns>
long NextTimestamp();
/// <summary>
/// Get a reasonable "lock timeout"
/// </summary>
int Timeout { get; }
/// <summary>
/// Gets the name of the cache region
/// </summary>
string RegionName { get; }
}
}