From: Alan Webb <awebb@linux.vnet.ibm.com>

I've changed the extension point name, and the internal references that
used the same string. I also fixed up the messaging around the asset
loader so that it is more explicit.
GenericGridServerConcept
Sean Dague 2009-02-18 13:15:07 +00:00
parent 383f8b3ac6
commit 8ed631307b
4 changed files with 48 additions and 32 deletions

View File

@ -8,10 +8,10 @@
<Extension path="/OpenSim/AssetCache"> <Extension path="/OpenSim/AssetCache">
<Cache id="Default" provider="Default" type="OpenSim.Framework.Communications.Cache.AssetCache" /> <Cache id="Default" provider="Default" type="OpenSim.Framework.Communications.Cache.AssetCache" />
</Extension> </Extension>
<Extension path="/OpenSim/AssetServerClient"> <Extension path="/OpenSim/AssetClient">
<ServerClient id="Crypto" provider="Crypto" type="OpenSim.Framework.Communications.Cache.CryptoGridAssetClient" /> <AssetClient id="Crypto" provider="Crypto" type="OpenSim.Framework.Communications.Cache.CryptoGridAssetClient" />
<ServerClient id="Grid" provider="Grid" type="OpenSim.Framework.Communications.Cache.GridAssetClient" /> <AssetClient id="Grid" provider="Grid" type="OpenSim.Framework.Communications.Cache.GridAssetClient" />
<ServerClient id="File" provider="File" type="OpenSim.Framework.Communications.Cache.FileAssetClient" /> <AssetClient id="File" provider="File" type="OpenSim.Framework.Communications.Cache.FileAssetClient" />
<ServerClient id="SQL" provider="SQL" type="OpenSim.Framework.Communications.Cache.SQLAssetServer" /> <AssetClient id="SQL" provider="SQL" type="OpenSim.Framework.Communications.Cache.SQLAssetServer" />
</Extension> </Extension>
</Addin> </Addin>

View File

@ -65,11 +65,11 @@ namespace OpenSim.Framework
void AssetNotFound(UUID assetID, bool IsTexture); void AssetNotFound(UUID assetID, bool IsTexture);
} }
public class AssetServerClientPluginInitialiser : PluginInitialiserBase public class AssetClientPluginInitialiser : PluginInitialiserBase
{ {
private ConfigSettings config; private ConfigSettings config;
public AssetServerClientPluginInitialiser (ConfigSettings p_sv) public AssetClientPluginInitialiser (ConfigSettings p_sv)
{ {
config = p_sv; config = p_sv;
} }
@ -80,12 +80,12 @@ namespace OpenSim.Framework
} }
} }
public class LegacyAssetServerClientPluginInitialiser : PluginInitialiserBase public class LegacyAssetClientPluginInitialiser : PluginInitialiserBase
{ {
private ConfigSettings config; private ConfigSettings config;
private string assetURL; private string assetURL;
public LegacyAssetServerClientPluginInitialiser (ConfigSettings p_sv, string p_url) public LegacyAssetClientPluginInitialiser (ConfigSettings p_sv, string p_url)
{ {
config = p_sv; config = p_sv;
assetURL = p_url; assetURL = p_url;
@ -97,14 +97,14 @@ namespace OpenSim.Framework
} }
} }
public class CryptoAssetServerClientPluginInitialiser : PluginInitialiserBase public class CryptoAssetClientPluginInitialiser : PluginInitialiserBase
{ {
private ConfigSettings config; private ConfigSettings config;
private string assetURL; private string assetURL;
private string currdir; private string currdir;
private bool test; private bool test;
public CryptoAssetServerClientPluginInitialiser (ConfigSettings p_sv, string p_url, string p_dir, bool p_test) public CryptoAssetClientPluginInitialiser (ConfigSettings p_sv, string p_url, string p_dir, bool p_test)
{ {
config = p_sv; config = p_sv;
assetURL = p_url; assetURL = p_url;

View File

@ -59,7 +59,7 @@ namespace OpenSim
// class during system startup. // class during system startup.
private const string PLUGIN_ASSET_CACHE = "/OpenSim/AssetCache"; private const string PLUGIN_ASSET_CACHE = "/OpenSim/AssetCache";
private const string PLUGIN_ASSET_SERVER_CLIENT = "/OpenSim/AssetServerClient"; private const string PLUGIN_ASSET_SERVER_CLIENT = "/OpenSim/AssetClient";
protected string proxyUrl; protected string proxyUrl;
protected int proxyOffset = 0; protected int proxyOffset = 0;
@ -329,9 +329,9 @@ namespace OpenSim
protected virtual void InitialiseAssetCache() protected virtual void InitialiseAssetCache()
{ {
LegacyAssetServerClientPluginInitialiser linit = null; LegacyAssetClientPluginInitialiser linit = null;
CryptoAssetServerClientPluginInitialiser cinit = null; CryptoAssetClientPluginInitialiser cinit = null;
AssetServerClientPluginInitialiser init = null; AssetClientPluginInitialiser init = null;
IAssetServer assetServer = null; IAssetServer assetServer = null;
string mode = m_configSettings.AssetStorage; string mode = m_configSettings.AssetStorage;
@ -358,7 +358,7 @@ namespace OpenSim
// of whether the server is standalone. // of whether the server is standalone.
case "grid" : case "grid" :
linit = new LegacyAssetServerClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL); linit = new LegacyAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL);
assetServer = loadAssetServer("Grid", linit); assetServer = loadAssetServer("Grid", linit);
break; break;
@ -367,7 +367,7 @@ namespace OpenSim
// of whether the server is standalone. // of whether the server is standalone.
case "cryptogrid" : case "cryptogrid" :
cinit = new CryptoAssetServerClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL, cinit = new CryptoAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL,
Environment.CurrentDirectory, true); Environment.CurrentDirectory, true);
assetServer = loadAssetServer("Crypto", cinit); assetServer = loadAssetServer("Crypto", cinit);
break; break;
@ -376,7 +376,7 @@ namespace OpenSim
// of whether the server is standalone. // of whether the server is standalone.
case "cryptogrid_eou" : case "cryptogrid_eou" :
cinit = new CryptoAssetServerClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL, cinit = new CryptoAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL,
Environment.CurrentDirectory, false); Environment.CurrentDirectory, false);
assetServer = loadAssetServer("Crypto", cinit); assetServer = loadAssetServer("Crypto", cinit);
break; break;
@ -385,7 +385,7 @@ namespace OpenSim
// of whether the server is standalone. // of whether the server is standalone.
case "file" : case "file" :
linit = new LegacyAssetServerClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL); linit = new LegacyAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL);
assetServer = loadAssetServer("File", linit); assetServer = loadAssetServer("File", linit);
break; break;
@ -403,7 +403,7 @@ namespace OpenSim
default : default :
try try
{ {
init = new AssetServerClientPluginInitialiser(m_configSettings); init = new AssetClientPluginInitialiser(m_configSettings);
assetServer = loadAssetServer(m_configSettings.AssetStorage, init); assetServer = loadAssetServer(m_configSettings.AssetStorage, init);
break; break;
} }
@ -417,7 +417,7 @@ namespace OpenSim
if (assetServer == null) if (assetServer == null)
{ {
init = new AssetServerClientPluginInitialiser(m_configSettings); init = new AssetClientPluginInitialiser(m_configSettings);
SQLAssetServer sqlAssetServer = (SQLAssetServer) loadAssetServer("SQL", init); SQLAssetServer sqlAssetServer = (SQLAssetServer) loadAssetServer("SQL", init);
sqlAssetServer.LoadDefaultAssets(m_configSettings.AssetSetsXMLFile); sqlAssetServer.LoadDefaultAssets(m_configSettings.AssetSetsXMLFile);
assetServer = sqlAssetServer; assetServer = sqlAssetServer;
@ -437,14 +437,28 @@ namespace OpenSim
private IAssetServer loadAssetServer(string id, PluginInitialiserBase pi) private IAssetServer loadAssetServer(string id, PluginInitialiserBase pi)
{ {
if(id != null && id != String.Empty)
{
m_log.DebugFormat("[OPENSIMBASE] Attempting to load asset server id={0}", id); m_log.DebugFormat("[OPENSIMBASE] Attempting to load asset server id={0}", id);
try
{
PluginLoader<IAssetServer> loader = new PluginLoader<IAssetServer>(pi); PluginLoader<IAssetServer> loader = new PluginLoader<IAssetServer>(pi);
loader.AddFilter(PLUGIN_ASSET_SERVER_CLIENT, new PluginProviderFilter(id)); loader.AddFilter(PLUGIN_ASSET_SERVER_CLIENT, new PluginProviderFilter(id));
loader.Load(PLUGIN_ASSET_SERVER_CLIENT); loader.Load(PLUGIN_ASSET_SERVER_CLIENT);
if (loader.Plugins.Count > 0) if (loader.Plugins.Count > 0)
{
m_log.DebugFormat("[OPENSIMBASE] Asset server {0} loaded", id);
return (IAssetServer) loader.Plugins[0]; return (IAssetServer) loader.Plugins[0];
else }
}
catch (Exception e)
{
m_log.DebugFormat("[OPENSIMBASE] Asset server {0} not loaded ({1})", id, e.Message);
}
}
return null; return null;
} }
@ -465,10 +479,12 @@ namespace OpenSim
IAssetCache assetCache = null; IAssetCache assetCache = null;
m_log.DebugFormat("[OPENSIMBASE] Attempting to load asset cache id={0}", m_configSettings.AssetCache);
if (m_configSettings.AssetCache != null && m_configSettings.AssetCache != String.Empty) if (m_configSettings.AssetCache != null && m_configSettings.AssetCache != String.Empty)
{ {
m_log.DebugFormat("[OPENSIMBASE] Attempting to load asset cache id={0}", m_configSettings.AssetCache);
try try
{ {

View File

@ -9,7 +9,7 @@
<ExtensionPoint path="/OpenSim/AssetCache" name="Region Asset Cache Plugin-point" > <ExtensionPoint path="/OpenSim/AssetCache" name="Region Asset Cache Plugin-point" >
<ExtensionNode name="Cache" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Framework.IAssetCache"/> <ExtensionNode name="Cache" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Framework.IAssetCache"/>
</ExtensionPoint> </ExtensionPoint>
<ExtensionPoint path="/OpenSim/AssetServerClient" name="Region Asset Cache Server Interface Plugin-point"> <ExtensionPoint path="/OpenSim/AssetClient" name="Region Asset Cache Server Interface Plugin-point">
<ExtensionNode name="ServerClient" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Framework.IAssetServer"/> <ExtensionNode name="AssetClient" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Framework.IAssetServer"/>
</ExtensionPoint> </ExtensionPoint>
</Addin> </Addin>