diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs b/OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs index c4cc007..41d4bc6 100644 --- a/OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs | |||
@@ -45,6 +45,9 @@ namespace OpenSim.Region.CoreModules.Asset | |||
45 | MethodBase.GetCurrentMethod().DeclaringType); | 45 | MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | private bool m_Enabled = false; | 47 | private bool m_Enabled = false; |
48 | private Cache m_Cache = new Cache(CacheMedium.Memory, | ||
49 | CacheStrategy.Aggressive, | ||
50 | CacheFlags.AllowUpdate); | ||
48 | 51 | ||
49 | public string Name | 52 | public string Name |
50 | { | 53 | { |
@@ -69,6 +72,8 @@ namespace OpenSim.Region.CoreModules.Asset | |||
69 | m_Enabled = true; | 72 | m_Enabled = true; |
70 | 73 | ||
71 | m_log.Info("[ASSET CACHE]: Core asset cache enabled"); | 74 | m_log.Info("[ASSET CACHE]: Core asset cache enabled"); |
75 | |||
76 | m_Cache.Size = 32768; | ||
72 | } | 77 | } |
73 | } | 78 | } |
74 | } | 79 | } |
@@ -99,19 +104,22 @@ namespace OpenSim.Region.CoreModules.Asset | |||
99 | 104 | ||
100 | public void Cache(AssetBase asset) | 105 | public void Cache(AssetBase asset) |
101 | { | 106 | { |
107 | m_Cache.Store(asset.ID, asset); | ||
102 | } | 108 | } |
103 | 109 | ||
104 | public AssetBase Get(string id) | 110 | public AssetBase Get(string id) |
105 | { | 111 | { |
106 | return null; | 112 | return (AssetBase)m_Cache.Get(id); |
107 | } | 113 | } |
108 | 114 | ||
109 | public void Expire(string id) | 115 | public void Expire(string id) |
110 | { | 116 | { |
117 | m_Cache.Invalidate(id); | ||
111 | } | 118 | } |
112 | 119 | ||
113 | public void Clear() | 120 | public void Clear() |
114 | { | 121 | { |
122 | m_Cache.Clear(); | ||
115 | } | 123 | } |
116 | } | 124 | } |
117 | } | 125 | } |