diff options
author | Mike Mazur | 2009-02-16 02:27:01 +0000 |
---|---|---|
committer | Mike Mazur | 2009-02-16 02:27:01 +0000 |
commit | f1e71ca5e115366e55fb1b721d85cef08e3e5816 (patch) | |
tree | 7f8bcad91db1de772a6580abe255fb39e706e2e0 /OpenSim | |
parent | Move NullAuthentication and AuthorizeAll extensions to plugins. (diff) | |
download | opensim-SC_OLD-f1e71ca5e115366e55fb1b721d85cef08e3e5816.zip opensim-SC_OLD-f1e71ca5e115366e55fb1b721d85cef08e3e5816.tar.gz opensim-SC_OLD-f1e71ca5e115366e55fb1b721d85cef08e3e5816.tar.bz2 opensim-SC_OLD-f1e71ca5e115366e55fb1b721d85cef08e3e5816.tar.xz |
- add list for backend plugins and Dispose() all plugins on shutdown
- fix some plugin names
- remove most references to ExtensionLoader
- remove commented out AssetInventoryServer blobs from prebuild.xml
Diffstat (limited to 'OpenSim')
9 files changed, 25 insertions, 18 deletions
diff --git a/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs b/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs index c6c7da2..19f2081 100644 --- a/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs +++ b/OpenSim/Grid/AssetInventoryServer/AssetInventoryServer.cs | |||
@@ -56,6 +56,7 @@ namespace OpenSim.Grid.AssetInventoryServer | |||
56 | public IMetricsProvider MetricsProvider; | 56 | public IMetricsProvider MetricsProvider; |
57 | 57 | ||
58 | private List<IAssetInventoryServerPlugin> frontends = new List<IAssetInventoryServerPlugin>(); | 58 | private List<IAssetInventoryServerPlugin> frontends = new List<IAssetInventoryServerPlugin>(); |
59 | private List<IAssetInventoryServerPlugin> backends = new List<IAssetInventoryServerPlugin>(); | ||
59 | 60 | ||
60 | public AssetInventoryServer() | 61 | public AssetInventoryServer() |
61 | { | 62 | { |
@@ -107,8 +108,13 @@ namespace OpenSim.Grid.AssetInventoryServer | |||
107 | } | 108 | } |
108 | 109 | ||
109 | StorageProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/StorageProvider", "OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll") as IAssetStorageProvider; | 110 | StorageProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/StorageProvider", "OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll") as IAssetStorageProvider; |
111 | backends.Add(StorageProvider); | ||
112 | |||
110 | InventoryProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/InventoryProvider", "OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll") as IInventoryStorageProvider; | 113 | InventoryProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/InventoryProvider", "OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll") as IInventoryStorageProvider; |
114 | backends.Add(InventoryProvider); | ||
115 | |||
111 | MetricsProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/MetricsProvider", String.Empty) as IMetricsProvider; | 116 | MetricsProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/MetricsProvider", String.Empty) as IMetricsProvider; |
117 | backends.Add(MetricsProvider); | ||
112 | 118 | ||
113 | try | 119 | try |
114 | { | 120 | { |
@@ -122,20 +128,32 @@ namespace OpenSim.Grid.AssetInventoryServer | |||
122 | } | 128 | } |
123 | 129 | ||
124 | frontends.AddRange(LoadAssetInventoryServerPlugins("/OpenSim/AssetInventoryServer/Frontend", String.Empty)); | 130 | frontends.AddRange(LoadAssetInventoryServerPlugins("/OpenSim/AssetInventoryServer/Frontend", String.Empty)); |
131 | |||
125 | AuthenticationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthenticationProvider", String.Empty) as IAuthenticationProvider; | 132 | AuthenticationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthenticationProvider", String.Empty) as IAuthenticationProvider; |
133 | backends.Add(AuthenticationProvider); | ||
134 | |||
126 | AuthorizationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthorizationProvider", String.Empty) as IAuthorizationProvider; | 135 | AuthorizationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthorizationProvider", String.Empty) as IAuthorizationProvider; |
136 | backends.Add(AuthorizationProvider); | ||
127 | 137 | ||
128 | return true; | 138 | return true; |
129 | } | 139 | } |
130 | 140 | ||
131 | public void Shutdown() | 141 | public void Shutdown() |
132 | { | 142 | { |
133 | foreach (IExtension<AssetInventoryServer> extension in ExtensionLoader<AssetInventoryServer>.Extensions) | 143 | foreach (IAssetInventoryServerPlugin plugin in frontends) |
144 | { | ||
145 | Logger.Log.Debug("Disposing plugin " + plugin.Name); | ||
146 | try { plugin.Dispose(); } | ||
147 | catch (Exception ex) | ||
148 | { Logger.Log.ErrorFormat("Failure shutting down plugin {0}: {1}", plugin.Name, ex.Message); } | ||
149 | } | ||
150 | |||
151 | foreach (IAssetInventoryServerPlugin plugin in backends) | ||
134 | { | 152 | { |
135 | Logger.Log.Debug("Disposing extension " + extension.GetType().Name); | 153 | Logger.Log.Debug("Disposing plugin " + plugin.Name); |
136 | try { extension.Stop(); } | 154 | try { plugin.Dispose(); } |
137 | catch (Exception ex) | 155 | catch (Exception ex) |
138 | { Logger.Log.ErrorFormat("Failure shutting down extension {0}: {1}", extension.GetType().Name, ex.Message); } | 156 | { Logger.Log.ErrorFormat("Failure shutting down plugin {0}: {1}", plugin.Name, ex.Message); } |
139 | } | 157 | } |
140 | 158 | ||
141 | if (HttpServer != null) | 159 | if (HttpServer != null) |
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/AuthorizeAllPlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/AuthorizeAllPlugin.cs index 8974b6f..1c0fca7 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/AuthorizeAllPlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/AuthorizeAllPlugin.cs | |||
@@ -71,7 +71,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins | |||
71 | 71 | ||
72 | public string Name | 72 | public string Name |
73 | { | 73 | { |
74 | get { return "AssetInventoryServer Null authentication frontend"; } | 74 | get { return "AssetInventoryServer Authorize All"; } |
75 | } | 75 | } |
76 | 76 | ||
77 | #endregion IPlugin implementation | 77 | #endregion IPlugin implementation |
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/NullAuthenticationPlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/NullAuthenticationPlugin.cs index 81e58c6..ccb21b0 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/NullAuthenticationPlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/NullAuthenticationPlugin.cs | |||
@@ -71,7 +71,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins | |||
71 | 71 | ||
72 | public string Name | 72 | public string Name |
73 | { | 73 | { |
74 | get { return "AssetInventoryServer Null authentication frontend"; } | 74 | get { return "AssetInventoryServer Null authentication"; } |
75 | } | 75 | } |
76 | 76 | ||
77 | #endregion IPlugin implementation | 77 | #endregion IPlugin implementation |
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetFrontendPlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetFrontendPlugin.cs index ebab557..f831e24 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetFrontendPlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetFrontendPlugin.cs | |||
@@ -34,7 +34,6 @@ using System.IO; | |||
34 | using System.Text; | 34 | using System.Text; |
35 | using System.Xml; | 35 | using System.Xml; |
36 | using System.Xml.Serialization; | 36 | using System.Xml.Serialization; |
37 | using ExtensionLoader; | ||
38 | using OpenMetaverse; | 37 | using OpenMetaverse; |
39 | using HttpServer; | 38 | using HttpServer; |
40 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
@@ -147,8 +146,6 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim | |||
147 | { | 146 | { |
148 | Metadata metadata = new Metadata(); | 147 | Metadata metadata = new Metadata(); |
149 | 148 | ||
150 | Logger.Log.Debug("Handling OpenSim asset upload"); | ||
151 | |||
152 | try | 149 | try |
153 | { | 150 | { |
154 | AssetBase asset = (AssetBase) new XmlSerializer(typeof (AssetBase)).Deserialize(request.Body); | 151 | AssetBase asset = (AssetBase) new XmlSerializer(typeof (AssetBase)).Deserialize(request.Body); |
@@ -185,7 +182,6 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim | |||
185 | response.Status = HttpStatusCode.BadRequest; | 182 | response.Status = HttpStatusCode.BadRequest; |
186 | } | 183 | } |
187 | 184 | ||
188 | Logger.Log.Debug("Finished handling OpenSim asset upload, Status: " + response.Status.ToString()); | ||
189 | return true; | 185 | return true; |
190 | } | 186 | } |
191 | } | 187 | } |
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetStoragePlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetStoragePlugin.cs index 6c02cde..eb000ae 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetStoragePlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimAssetStoragePlugin.cs | |||
@@ -32,8 +32,6 @@ using System.Collections.Generic; | |||
32 | using System.Net; | 32 | using System.Net; |
33 | using System.Data; | 33 | using System.Data; |
34 | using MySql.Data.MySqlClient; | 34 | using MySql.Data.MySqlClient; |
35 | using ExtensionLoader; | ||
36 | using ExtensionLoader.Config; | ||
37 | using OpenMetaverse; | 35 | using OpenMetaverse; |
38 | using OpenMetaverse.StructuredData; | 36 | using OpenMetaverse.StructuredData; |
39 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryFrontendPlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryFrontendPlugin.cs index 6e33cdf..0f3867a 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryFrontendPlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryFrontendPlugin.cs | |||
@@ -32,7 +32,6 @@ using System.Collections.Generic; | |||
32 | using System.Net; | 32 | using System.Net; |
33 | using System.IO; | 33 | using System.IO; |
34 | using System.Xml; | 34 | using System.Xml; |
35 | using ExtensionLoader; | ||
36 | using OpenMetaverse; | 35 | using OpenMetaverse; |
37 | using OpenMetaverse.StructuredData; | 36 | using OpenMetaverse.StructuredData; |
38 | using HttpServer; | 37 | using HttpServer; |
@@ -92,7 +91,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim | |||
92 | 91 | ||
93 | public string Name | 92 | public string Name |
94 | { | 93 | { |
95 | get { return "AssetInventoryServer OpenSim asset frontend"; } | 94 | get { return "AssetInventoryServer OpenSim inventory frontend"; } |
96 | } | 95 | } |
97 | 96 | ||
98 | #endregion IPlugin implementation | 97 | #endregion IPlugin implementation |
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryStoragePlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryStoragePlugin.cs index 3fd06c0..a41c48d 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryStoragePlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryStoragePlugin.cs | |||
@@ -32,8 +32,6 @@ using System.Collections.Generic; | |||
32 | using System.Net; | 32 | using System.Net; |
33 | using System.Data; | 33 | using System.Data; |
34 | using MySql.Data.MySqlClient; | 34 | using MySql.Data.MySqlClient; |
35 | using ExtensionLoader; | ||
36 | using ExtensionLoader.Config; | ||
37 | using OpenMetaverse; | 35 | using OpenMetaverse; |
38 | using OpenMetaverse.StructuredData; | 36 | using OpenMetaverse.StructuredData; |
39 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs index fd198d9..301a55f 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs | |||
@@ -31,7 +31,6 @@ using System; | |||
31 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
32 | using System.Net; | 32 | using System.Net; |
33 | using System.IO; | 33 | using System.IO; |
34 | using ExtensionLoader; | ||
35 | using OpenMetaverse; | 34 | using OpenMetaverse; |
36 | using OpenMetaverse.StructuredData; | 35 | using OpenMetaverse.StructuredData; |
37 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs index 78dae35..415874a 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs | |||
@@ -32,7 +32,6 @@ using System.Collections.Generic; | |||
32 | using System.Net; | 32 | using System.Net; |
33 | using System.IO; | 33 | using System.IO; |
34 | using System.Text; | 34 | using System.Text; |
35 | using ExtensionLoader; | ||
36 | using OpenMetaverse; | 35 | using OpenMetaverse; |
37 | using OpenMetaverse.StructuredData; | 36 | using OpenMetaverse.StructuredData; |
38 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |