These changes replace all direct references to the AssetCache with
IAssetCache. There is no change to functionality. Everything works as
before.

This is laying the groundwork for making it possible to register
alternative asset caching mechanisms without disrupting other parts of
OpenSim or their dependencies upon AssetCache functionality.
This commit is contained in:
Sean Dague
2009-02-09 21:47:55 +00:00
parent 70051278c4
commit 8088802c21
27 changed files with 85 additions and 68 deletions

View File

@@ -37,7 +37,7 @@ using GlynnTucker.Cache;
namespace OpenSim.Framework.Communications.Cache
{
public delegate void AssetRequestCallback(UUID assetID, AssetBase asset);
// public delegate void AssetRequestCallback(UUID assetID, AssetBase asset);
/// <summary>
/// Manages local cache of assets and their sending to viewers.
@@ -47,7 +47,8 @@ namespace OpenSim.Framework.Communications.Cache
/// synchronously or async and passes the data back to the requester. The second mechanism fetches assets and
/// sends packetised data directly back to the client. The only point where they meet is AssetReceived() and
/// AssetNotFound(), which means they do share the same asset and texture caches.I agr
public class AssetCache : IAssetReceiver
public class AssetCache : IAssetCache, IAssetReceiver
{
protected ICache m_memcache = new SimpleMemoryCache();
@@ -148,7 +149,7 @@ namespace OpenSim.Framework.Communications.Cache
/// Process the asset queue which holds data which is packeted up and sent
/// directly back to the client.
/// </summary>
public void RunAssetManager()
private void RunAssetManager()
{
while (true)
{

View File

@@ -98,7 +98,7 @@ namespace OpenSim.Framework.Communications.Capabilities
//private string eventQueue = "0100/";
private BaseHttpServer m_httpListener;
private UUID m_agentID;
private AssetCache m_assetCache;
private IAssetCache m_assetCache;
private int m_eventQueueCount = 1;
private Queue<string> m_capsEventQueue = new Queue<string>();
private bool m_dumpAssetsToFile;
@@ -121,7 +121,7 @@ namespace OpenSim.Framework.Communications.Capabilities
public FetchInventoryDescendentsCAPS CAPSFetchInventoryDescendents = null;
public GetClientDelegate GetClient = null;
public Caps(AssetCache assetCache, BaseHttpServer httpServer, string httpListen, uint httpPort, string capsPath,
public Caps(IAssetCache assetCache, BaseHttpServer httpServer, string httpListen, uint httpPort, string capsPath,
UUID agent, bool dumpAssetsToFile, string regionName)
{
m_assetCache = assetCache;

View File

@@ -87,11 +87,11 @@ namespace OpenSim.Framework.Communications
}
protected IAvatarService m_avatarService;
public AssetCache AssetCache
public IAssetCache AssetCache
{
get { return m_assetCache; }
}
protected AssetCache m_assetCache;
protected IAssetCache m_assetCache;
public IInterServiceInventoryServices InterServiceInventoryService
{
@@ -127,7 +127,7 @@ namespace OpenSim.Framework.Communications
/// <param name="httpServer"></param>
/// <param name="assetCache"></param>
/// <param name="dumpAssetsToFile"></param>
public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache,
public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer, IAssetCache assetCache,
bool dumpAssetsToFile, LibraryRootFolder libraryRootFolder)
{
m_networkServersInfo = serversInfo;