diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut')
-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 66d11dd..3883dc6 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 | } |
@@ -138,7 +138,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
138 | } | 138 | } |
139 | 139 | ||
140 | // m_log.DebugFormat( | 140 | // m_log.DebugFormat( |
141 | // "[INVENTORY CONNECTOR]: Registering IInventoryService to scene {0}", scene.RegionInfo.RegionName); | 141 | // "[LOCAL INVENTORY SERVICES CONNECTOR]: Registering IInventoryService to scene {0}", scene.RegionInfo.RegionName); |
142 | 142 | ||
143 | scene.RegisterModuleInterface<IInventoryService>(this); | 143 | scene.RegisterModuleInterface<IInventoryService>(this); |
144 | m_cache.AddRegion(scene); | 144 | m_cache.AddRegion(scene); |
@@ -158,7 +158,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
158 | return; | 158 | return; |
159 | 159 | ||
160 | m_log.InfoFormat( | 160 | m_log.InfoFormat( |
161 | "[INVENTORY CONNECTOR]: Enabled local invnetory for region {0}", scene.RegionInfo.RegionName); | 161 | "[LOCAL INVENTORY SERVICES CONNECTOR]: Enabled local inventory for region {0}", scene.RegionInfo.RegionName); |
162 | } | 162 | } |
163 | 163 | ||
164 | #region IInventoryService | 164 | #region IInventoryService |
@@ -213,7 +213,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
213 | return folders; | 213 | return folders; |
214 | } | 214 | } |
215 | } | 215 | } |
216 | m_log.WarnFormat("[INVENTORY CONNECTOR]: System folders for {0} not found", userID); | 216 | m_log.WarnFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: System folders for {0} not found", userID); |
217 | return new Dictionary<AssetType, InventoryFolderBase>(); | 217 | return new Dictionary<AssetType, InventoryFolderBase>(); |
218 | } | 218 | } |
219 | 219 | ||
@@ -312,7 +312,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
312 | 312 | ||
313 | public override InventoryItemBase GetItem(InventoryItemBase item) | 313 | public override InventoryItemBase GetItem(InventoryItemBase item) |
314 | { | 314 | { |
315 | return m_InventoryService.GetItem(item); | 315 | // m_log.DebugFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Requesting inventory item {0}", item.ID); |
316 | |||
317 | item = m_InventoryService.GetItem(item); | ||
318 | |||
319 | if (null == item) | ||
320 | m_log.ErrorFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Could not find item with id {0}"); | ||
321 | |||
322 | return item; | ||
316 | } | 323 | } |
317 | 324 | ||
318 | public override InventoryFolderBase GetFolder(InventoryFolderBase folder) | 325 | public override InventoryFolderBase GetFolder(InventoryFolderBase folder) |