From e0e0db366061eae148364e3d5670f275b1ab25b7 Mon Sep 17 00:00:00 2001
From: Mike Mazur
Date: Fri, 18 Jul 2008 04:51:41 +0000
Subject: Thanks, sempuki, for a patch that moves all grid plugins to new
PluginLoader (issue 1763).
---
OpenSim/Data/MSSQL/MSSQLGridData.cs | 22 +++++++++++++++++-----
OpenSim/Data/MSSQL/MSSQLLogData.cs | 30 ++++++++++++++++++++++++------
2 files changed, 41 insertions(+), 11 deletions(-)
(limited to 'OpenSim/Data/MSSQL')
diff --git a/OpenSim/Data/MSSQL/MSSQLGridData.cs b/OpenSim/Data/MSSQL/MSSQLGridData.cs
index 0abd0d0..7de77d1 100644
--- a/OpenSim/Data/MSSQL/MSSQLGridData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLGridData.cs
@@ -33,12 +33,18 @@ using System.Security.Cryptography;
using System.Text;
using libsecondlife;
using log4net;
+using Mono.Addins;
+using OpenSim.Framework;
+
+[assembly : Addin]
+[assembly : AddinDependency("OpenSim.Data", "0.5")]
namespace OpenSim.Data.MSSQL
{
///
/// A grid data interface for MSSQL Server
///
+ [Extension("/OpenSim/GridDataStore")]
public class MSSQLGridData : GridDataBase
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -50,6 +56,12 @@ namespace OpenSim.Data.MSSQL
private string m_regionsTableName;
+ override public void Initialise()
+ {
+ m_log.Info("[MSSQLGridData]: " + Name + " cannot be default-initialized!");
+ throw new PluginNotInitialisedException (Name);
+ }
+
///
/// Initialises the Grid Interface
///
@@ -101,7 +113,7 @@ namespace OpenSim.Data.MSSQL
///
/// Shuts down the grid interface
///
- override public void Close()
+ override public void Dispose()
{
// nothing to close
}
@@ -110,18 +122,18 @@ namespace OpenSim.Data.MSSQL
/// The name of this DB provider.
///
/// A string containing the storage system name
- override public string getName()
+ override public string Name
{
- return "Sql OpenGridData";
+ get { return "Sql OpenGridData"; }
}
///
/// Database provider version.
///
/// A string containing the storage system version
- override public string getVersion()
+ override public string Version
{
- return "0.1";
+ get { return "0.1"; }
}
///
diff --git a/OpenSim/Data/MSSQL/MSSQLLogData.cs b/OpenSim/Data/MSSQL/MSSQLLogData.cs
index 849d0fb..d0d81b6 100644
--- a/OpenSim/Data/MSSQL/MSSQLLogData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLLogData.cs
@@ -25,21 +25,39 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+using System;
+using System.Reflection;
using System.Collections.Generic;
using System.Data;
+using log4net;
+using Mono.Addins;
+using OpenSim.Framework;
+
+// Only one attribute per assembly. See: *GridData.cs
+// [assembly : Addin]
+// [assembly : AddinDependency("OpenSim.Data", "0.5")]
namespace OpenSim.Data.MSSQL
{
///
/// An interface to the log database for MSSQL
///
- internal class MSSQLLogData : ILogData
+ [Extension("/OpenSim/GridLogData")]
+ internal class MSSQLLogData : ILogDataPlugin
{
+ private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+
///
/// The database manager
///
public MSSQLManager database;
+ public void Initialise()
+ {
+ m_log.Info("[MSSQLLogData]: " + Name + " cannot be default-initialized!");
+ throw new PluginNotInitialisedException (Name);
+ }
+
///
/// Artificial constructor called when the plugin is loaded
///
@@ -97,15 +115,15 @@ namespace OpenSim.Data.MSSQL
/// Returns the name of this DB provider
///
/// A string containing the DB provider name
- public string getName()
+ public string Name
{
- return "MSSQL Logdata Interface";
+ get { return "MSSQL Logdata Interface"; }
}
///
/// Closes the database provider
///
- public void Close()
+ public void Dispose()
{
// Do nothing.
}
@@ -114,9 +132,9 @@ namespace OpenSim.Data.MSSQL
/// Returns the version of this DB provider
///
/// A string containing the provider version
- public string getVersion()
+ public string Version
{
- return "0.1";
+ get { return "0.1"; }
}
}
}
--
cgit v1.1