From 8088802c218d7eb4a47018b5b3bb70e7463a03b1 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 9 Feb 2009 21:47:55 +0000 Subject: From Alan Webb 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. --- OpenSim/Framework/Communications/Cache/AssetCache.cs | 7 ++++--- OpenSim/Framework/Communications/Capabilities/Caps.cs | 4 ++-- OpenSim/Framework/Communications/CommunicationsManager.cs | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 2b2467c..2296e46 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs @@ -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); /// /// 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. /// - public void RunAssetManager() + private void RunAssetManager() { while (true) { diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index 25a69f7..cfe9002 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs @@ -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 m_capsEventQueue = new Queue(); 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; diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index b4af991..2107f63 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs @@ -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 /// /// /// - public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, + public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer, IAssetCache assetCache, bool dumpAssetsToFile, LibraryRootFolder libraryRootFolder) { m_networkServersInfo = serversInfo; -- cgit v1.1