diff options
author | Melanie | 2010-02-15 00:20:48 +0000 |
---|---|---|
committer | Melanie | 2010-02-15 00:20:48 +0000 |
commit | c033223c63274ebe41075b24d108ca952fbd242c (patch) | |
tree | 8c969a9643c469feb37133b175be18eb52fdff49 /OpenSim/Region/CoreModules/ServiceConnectorsOut | |
parent | Extraneous debug messages removed (diff) | |
parent | Plug a small hole (diff) | |
download | opensim-SC_OLD-c033223c63274ebe41075b24d108ca952fbd242c.zip opensim-SC_OLD-c033223c63274ebe41075b24d108ca952fbd242c.tar.gz opensim-SC_OLD-c033223c63274ebe41075b24d108ca952fbd242c.tar.bz2 opensim-SC_OLD-c033223c63274ebe41075b24d108ca952fbd242c.tar.xz |
Merge branch 'master' into presence-refactor
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs | 48 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | 25 |
2 files changed, 43 insertions, 30 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs index fd3aaf4..2f21e6d 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs | |||
@@ -38,12 +38,9 @@ using OpenSim.Services.Interfaces; | |||
38 | 38 | ||
39 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | 39 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset |
40 | { | 40 | { |
41 | public class LocalAssetServicesConnector : | 41 | public class LocalAssetServicesConnector : ISharedRegionModule, IAssetService |
42 | ISharedRegionModule, IAssetService | ||
43 | { | 42 | { |
44 | private static readonly ILog m_log = | 43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | LogManager.GetLogger( | ||
46 | MethodBase.GetCurrentMethod().DeclaringType); | ||
47 | 44 | ||
48 | private IImprovedAssetCache m_Cache = null; | 45 | private IImprovedAssetCache m_Cache = null; |
49 | 46 | ||
@@ -72,7 +69,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
72 | IConfig assetConfig = source.Configs["AssetService"]; | 69 | IConfig assetConfig = source.Configs["AssetService"]; |
73 | if (assetConfig == null) | 70 | if (assetConfig == null) |
74 | { | 71 | { |
75 | m_log.Error("[ASSET CONNECTOR]: AssetService missing from OpenSim.ini"); | 72 | m_log.Error("[LOCAL ASSET SERVICES CONNECTOR]: AssetService missing from OpenSim.ini"); |
76 | return; | 73 | return; |
77 | } | 74 | } |
78 | 75 | ||
@@ -81,22 +78,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
81 | 78 | ||
82 | if (serviceDll == String.Empty) | 79 | if (serviceDll == String.Empty) |
83 | { | 80 | { |
84 | m_log.Error("[ASSET CONNECTOR]: No LocalServiceModule named in section AssetService"); | 81 | m_log.Error("[LOCAL ASSET SERVICES CONNECTOR]: No LocalServiceModule named in section AssetService"); |
85 | return; | 82 | return; |
86 | } | 83 | } |
87 | 84 | ||
88 | Object[] args = new Object[] { source }; | 85 | Object[] args = new Object[] { source }; |
89 | m_AssetService = | 86 | m_AssetService = ServerUtils.LoadPlugin<IAssetService>(serviceDll, args); |
90 | ServerUtils.LoadPlugin<IAssetService>(serviceDll, | ||
91 | args); | ||
92 | 87 | ||
93 | if (m_AssetService == null) | 88 | if (m_AssetService == null) |
94 | { | 89 | { |
95 | m_log.Error("[ASSET CONNECTOR]: Can't load asset service"); | 90 | m_log.Error("[LOCAL ASSET SERVICES CONNECTOR]: Can't load asset service"); |
96 | return; | 91 | return; |
97 | } | 92 | } |
98 | m_Enabled = true; | 93 | m_Enabled = true; |
99 | m_log.Info("[ASSET CONNECTOR]: Local asset connector enabled"); | 94 | m_log.Info("[LOCAL ASSET SERVICES CONNECTOR]: Local asset connector enabled"); |
100 | } | 95 | } |
101 | } | 96 | } |
102 | } | 97 | } |
@@ -134,11 +129,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
134 | m_Cache = null; | 129 | m_Cache = null; |
135 | } | 130 | } |
136 | 131 | ||
137 | m_log.InfoFormat("[ASSET CONNECTOR]: Enabled local assets for region {0}", scene.RegionInfo.RegionName); | 132 | m_log.InfoFormat("[LOCAL ASSET SERVICES CONNECTOR]: Enabled local assets for region {0}", scene.RegionInfo.RegionName); |
138 | 133 | ||
139 | if (m_Cache != null) | 134 | if (m_Cache != null) |
140 | { | 135 | { |
141 | m_log.InfoFormat("[ASSET CONNECTOR]: Enabled asset caching for region {0}", scene.RegionInfo.RegionName); | 136 | m_log.InfoFormat("[LOCAL ASSET SERVICES CONNECTOR]: Enabled asset caching for region {0}", scene.RegionInfo.RegionName); |
142 | } | 137 | } |
143 | else | 138 | else |
144 | { | 139 | { |
@@ -151,6 +146,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
151 | 146 | ||
152 | public AssetBase Get(string id) | 147 | public AssetBase Get(string id) |
153 | { | 148 | { |
149 | // m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Synchronously requesting asset {0}", id); | ||
150 | |||
154 | AssetBase asset = null; | 151 | AssetBase asset = null; |
155 | if (m_Cache != null) | 152 | if (m_Cache != null) |
156 | asset = m_Cache.Get(id); | 153 | asset = m_Cache.Get(id); |
@@ -160,7 +157,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
160 | asset = m_AssetService.Get(id); | 157 | asset = m_AssetService.Get(id); |
161 | if ((m_Cache != null) && (asset != null)) | 158 | if ((m_Cache != null) && (asset != null)) |
162 | m_Cache.Cache(asset); | 159 | m_Cache.Cache(asset); |
160 | |||
161 | // if (null == asset) | ||
162 | // m_log.WarnFormat("[LOCAL ASSET SERVICES CONNECTOR]: Could not synchronously find asset with id {0}", id); | ||
163 | } | 163 | } |
164 | |||
164 | return asset; | 165 | return asset; |
165 | } | 166 | } |
166 | 167 | ||
@@ -204,15 +205,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
204 | 205 | ||
205 | public bool Get(string id, Object sender, AssetRetrieved handler) | 206 | public bool Get(string id, Object sender, AssetRetrieved handler) |
206 | { | 207 | { |
207 | AssetBase asset = null; | 208 | // m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Asynchronously requesting asset {0}", id); |
208 | 209 | ||
209 | if (m_Cache != null) | 210 | if (m_Cache != null) |
210 | m_Cache.Get(id); | ||
211 | |||
212 | if (asset != null) | ||
213 | { | 211 | { |
214 | Util.FireAndForget(delegate { handler(id, sender, asset); }); | 212 | AssetBase asset = m_Cache.Get(id); |
215 | return true; | 213 | |
214 | if (asset != null) | ||
215 | { | ||
216 | Util.FireAndForget(delegate { handler(id, sender, asset); }); | ||
217 | return true; | ||
218 | } | ||
216 | } | 219 | } |
217 | 220 | ||
218 | return m_AssetService.Get(id, sender, delegate (string assetID, Object s, AssetBase a) | 221 | return m_AssetService.Get(id, sender, delegate (string assetID, Object s, AssetBase a) |
@@ -220,6 +223,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
220 | if ((a != null) && (m_Cache != null)) | 223 | if ((a != null) && (m_Cache != null)) |
221 | m_Cache.Cache(a); | 224 | m_Cache.Cache(a); |
222 | 225 | ||
226 | // if (null == a) | ||
227 | // m_log.WarnFormat("[LOCAL ASSET SERVICES CONNECTOR]: Could not asynchronously find asset with id {0}", id); | ||
228 | |||
223 | Util.FireAndForget(delegate { handler(assetID, s, a); }); | 229 | Util.FireAndForget(delegate { handler(assetID, s, a); }); |
224 | }); | 230 | }); |
225 | } | 231 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index 9d6da4f..54e62e2 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -73,7 +73,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
73 | IConfig inventoryConfig = source.Configs["InventoryService"]; | 73 | IConfig inventoryConfig = source.Configs["InventoryService"]; |
74 | if (inventoryConfig == null) | 74 | if (inventoryConfig == null) |
75 | { | 75 | { |
76 | m_log.Error("[INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini"); | 76 | m_log.Error("[LOCAL INVENTORY SERVICES CONNECTOR]: InventoryService missing from OpenSim.ini"); |
77 | return; | 77 | return; |
78 | } | 78 | } |
79 | 79 | ||
@@ -81,18 +81,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
81 | 81 | ||
82 | if (serviceDll == String.Empty) | 82 | if (serviceDll == String.Empty) |
83 | { | 83 | { |
84 | m_log.Error("[INVENTORY CONNECTOR]: No LocalServiceModule named in section InventoryService"); | 84 | m_log.Error("[LOCAL INVENTORY SERVICES CONNECTOR]: No LocalServiceModule named in section InventoryService"); |
85 | return; | 85 | return; |
86 | } | 86 | } |
87 | 87 | ||
88 | Object[] args = new Object[] { source }; | 88 | Object[] args = new Object[] { source }; |
89 | m_log.DebugFormat("[INVENTORY CONNECTOR]: Service dll = {0}", serviceDll); | 89 | m_log.DebugFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Service dll = {0}", serviceDll); |
90 | 90 | ||
91 | m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(serviceDll, args); | 91 | m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(serviceDll, args); |
92 | 92 | ||
93 | if (m_InventoryService == null) | 93 | if (m_InventoryService == null) |
94 | { | 94 | { |
95 | m_log.Error("[INVENTORY CONNECTOR]: Can't load inventory service"); | 95 | m_log.Error("[LOCAL INVENTORY SERVICES CONNECTOR]: Can't load inventory service"); |
96 | //return; | 96 | //return; |
97 | throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's"); | 97 | throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's"); |
98 | } | 98 | } |
@@ -111,7 +111,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
111 | Init(source); | 111 | Init(source); |
112 | 112 | ||
113 | m_Enabled = true; | 113 | m_Enabled = true; |
114 | m_log.Info("[INVENTORY CONNECTOR]: Local inventory connector enabled"); | 114 | m_log.Info("[LOCAL INVENTORY SERVICES CONNECTOR]: Local inventory connector enabled"); |
115 | } | 115 | } |
116 | } | 116 | } |
117 | } | 117 | } |
@@ -135,7 +135,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
135 | } | 135 | } |
136 | 136 | ||
137 | // m_log.DebugFormat( | 137 | // m_log.DebugFormat( |
138 | // "[INVENTORY CONNECTOR]: Registering IInventoryService to scene {0}", scene.RegionInfo.RegionName); | 138 | // "[LOCAL INVENTORY SERVICES CONNECTOR]: Registering IInventoryService to scene {0}", scene.RegionInfo.RegionName); |
139 | 139 | ||
140 | scene.RegisterModuleInterface<IInventoryService>(this); | 140 | scene.RegisterModuleInterface<IInventoryService>(this); |
141 | m_cache.AddRegion(scene); | 141 | m_cache.AddRegion(scene); |
@@ -155,7 +155,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
155 | return; | 155 | return; |
156 | 156 | ||
157 | m_log.InfoFormat( | 157 | m_log.InfoFormat( |
158 | "[INVENTORY CONNECTOR]: Enabled local invnetory for region {0}", scene.RegionInfo.RegionName); | 158 | "[LOCAL INVENTORY SERVICES CONNECTOR]: Enabled local inventory for region {0}", scene.RegionInfo.RegionName); |
159 | } | 159 | } |
160 | 160 | ||
161 | #region IInventoryService | 161 | #region IInventoryService |
@@ -210,7 +210,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
210 | return folders; | 210 | return folders; |
211 | } | 211 | } |
212 | } | 212 | } |
213 | m_log.WarnFormat("[INVENTORY CONNECTOR]: System folders for {0} not found", userID); | 213 | m_log.WarnFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: System folders for {0} not found", userID); |
214 | return new Dictionary<AssetType, InventoryFolderBase>(); | 214 | return new Dictionary<AssetType, InventoryFolderBase>(); |
215 | } | 215 | } |
216 | 216 | ||
@@ -309,7 +309,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
309 | 309 | ||
310 | public override InventoryItemBase GetItem(InventoryItemBase item) | 310 | public override InventoryItemBase GetItem(InventoryItemBase item) |
311 | { | 311 | { |
312 | return m_InventoryService.GetItem(item); | 312 | // m_log.DebugFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Requesting inventory item {0}", item.ID); |
313 | |||
314 | item = m_InventoryService.GetItem(item); | ||
315 | |||
316 | if (null == item) | ||
317 | m_log.ErrorFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Could not find item with id {0}"); | ||
318 | |||
319 | return item; | ||
313 | } | 320 | } |
314 | 321 | ||
315 | public override InventoryFolderBase GetFolder(InventoryFolderBase folder) | 322 | public override InventoryFolderBase GetFolder(InventoryFolderBase folder) |