aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/PluginLoader.cs
diff options
context:
space:
mode:
authorMike Mazur2008-07-31 09:24:28 +0000
committerMike Mazur2008-07-31 09:24:28 +0000
commit2270b252656146d9d74b84665a7ace6c3139db30 (patch)
tree7a967ee50349cf4301ed801e0b8c85f5060ffe1d /OpenSim/Framework/PluginLoader.cs
parentdropping intermediate GridInfoPlugin.addin.xml, as it's no longer (diff)
downloadopensim-SC_OLD-2270b252656146d9d74b84665a7ace6c3139db30.zip
opensim-SC_OLD-2270b252656146d9d74b84665a7ace6c3139db30.tar.gz
opensim-SC_OLD-2270b252656146d9d74b84665a7ace6c3139db30.tar.bz2
opensim-SC_OLD-2270b252656146d9d74b84665a7ace6c3139db30.tar.xz
Thanks, sempuki, for a patch that moves all Grid Server's plugins to
PluginLoader. Fix issue 1871.
Diffstat (limited to 'OpenSim/Framework/PluginLoader.cs')
-rw-r--r--OpenSim/Framework/PluginLoader.cs24
1 files changed, 22 insertions, 2 deletions
diff --git a/OpenSim/Framework/PluginLoader.cs b/OpenSim/Framework/PluginLoader.cs
index 616fa3e..3bc4de6 100644
--- a/OpenSim/Framework/PluginLoader.cs
+++ b/OpenSim/Framework/PluginLoader.cs
@@ -96,6 +96,11 @@ namespace OpenSim.Framework
96 get { return loaded; } 96 get { return loaded; }
97 } 97 }
98 98
99 public T Plugin
100 {
101 get { return (loaded.Count == 1)? loaded [0] : default (T); }
102 }
103
99 public PluginLoader () 104 public PluginLoader ()
100 { 105 {
101 Initialiser = new PluginInitialiserBase(); 106 Initialiser = new PluginInitialiserBase();
@@ -114,11 +119,26 @@ namespace OpenSim.Framework
114 initialise_plugin_dir_ (dir); 119 initialise_plugin_dir_ (dir);
115 } 120 }
116 121
117 public void AddExtensionPoint (string extpoint) 122 public void Add (string extpoint)
118 { 123 {
124 if (extpoints.Contains (extpoint))
125 return;
126
119 extpoints.Add (extpoint); 127 extpoints.Add (extpoint);
120 } 128 }
121 129
130 public void Add (string extpoint, IPluginConstraint cons)
131 {
132 Add (extpoint);
133 AddConstraint (extpoint, cons);
134 }
135
136 public void Add (string extpoint, IPluginFilter filter)
137 {
138 Add (extpoint);
139 AddFilter (extpoint, filter);
140 }
141
122 public void AddConstraint (string extpoint, IPluginConstraint cons) 142 public void AddConstraint (string extpoint, IPluginConstraint cons)
123 { 143 {
124 constraints.Add (extpoint, cons); 144 constraints.Add (extpoint, cons);
@@ -131,7 +151,7 @@ namespace OpenSim.Framework
131 151
132 public void Load (string extpoint) 152 public void Load (string extpoint)
133 { 153 {
134 AddExtensionPoint (extpoint); 154 Add (extpoint);
135 Load(); 155 Load();
136 } 156 }
137 157