aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Servers/Base
diff options
context:
space:
mode:
authorMelanie Thielker2009-05-09 02:49:55 +0000
committerMelanie Thielker2009-05-09 02:49:55 +0000
commitc1e7352d75b62b6c97e79c4fdb37b9493aba697a (patch)
tree0bf2e2b12fafc2fc08dce9c50a0fa198b787979c /OpenSim/Servers/Base
parentFInish basic asset server functionality on the new asset server (diff)
downloadopensim-SC-c1e7352d75b62b6c97e79c4fdb37b9493aba697a.zip
opensim-SC-c1e7352d75b62b6c97e79c4fdb37b9493aba697a.tar.gz
opensim-SC-c1e7352d75b62b6c97e79c4fdb37b9493aba697a.tar.bz2
opensim-SC-c1e7352d75b62b6c97e79c4fdb37b9493aba697a.tar.xz
Add the asset service connectors and sample config. READ WARNINGS!!!
Diffstat (limited to 'OpenSim/Servers/Base')
-rw-r--r--OpenSim/Servers/Base/ServerUtils.cs35
1 files changed, 34 insertions, 1 deletions
diff --git a/OpenSim/Servers/Base/ServerUtils.cs b/OpenSim/Servers/Base/ServerUtils.cs
index 58d2b2b..4e8f472 100644
--- a/OpenSim/Servers/Base/ServerUtils.cs
+++ b/OpenSim/Servers/Base/ServerUtils.cs
@@ -27,11 +27,12 @@
27 27
28using System; 28using System;
29using System.IO; 29using System.IO;
30using System.Reflection;
30using System.Xml; 31using System.Xml;
31using System.Xml.Serialization; 32using System.Xml.Serialization;
32using System.Text; 33using System.Text;
33 34
34namespace OpenSim.Servers.AssetServer 35namespace OpenSim.Servers.Base
35{ 36{
36 public static class ServerUtils 37 public static class ServerUtils
37 { 38 {
@@ -92,5 +93,37 @@ namespace OpenSim.Servers.AssetServer
92 93
93 return ret; 94 return ret;
94 } 95 }
96
97 public static T LoadPlugin<T>(string dllName, Object[] args) where T:class
98 {
99 string interfaceName = typeof(T).ToString();
100
101 try
102 {
103 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
104
105 foreach (Type pluginType in pluginAssembly.GetTypes())
106 {
107 if (pluginType.IsPublic)
108 {
109 Type typeInterface =
110 pluginType.GetInterface(interfaceName, true);
111 if (typeInterface != null)
112 {
113 T plug = (T)Activator.CreateInstance(pluginType,
114 args);
115
116 return plug;
117 }
118 }
119 }
120
121 return null;
122 }
123 catch (Exception e)
124 {
125 return null;
126 }
127 }
95 } 128 }
96} 129}