From 342126b7b9ca386f9160daecb51ecc14487a5f9f Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 22 Apr 2009 22:19:43 +0000 Subject: * Resolve http://opensimulator.org/mantis/view.php?id=3509 by putting some service initialization into CommsManager * What is really needed is a plugin and interface request system as being done for region modules --- .../Grid/UserServer.Modules/UserDataBaseService.cs | 16 ++------- OpenSim/Grid/UserServer/Main.cs | 11 ++++-- OpenSim/Grid/UserServer/UserServerCommsManager.cs | 40 ++++++++++++++++++++++ 3 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 OpenSim/Grid/UserServer/UserServerCommsManager.cs (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/UserServer.Modules/UserDataBaseService.cs b/OpenSim/Grid/UserServer.Modules/UserDataBaseService.cs index 485dd46..51f9708 100644 --- a/OpenSim/Grid/UserServer.Modules/UserDataBaseService.cs +++ b/OpenSim/Grid/UserServer.Modules/UserDataBaseService.cs @@ -43,13 +43,8 @@ namespace OpenSim.Grid.UserServer.Modules { protected IGridServiceCore m_core; - public UserDataBaseService() - : base(null) - { - } - - public UserDataBaseService(IInterServiceInventoryServices interServiceInventoryService) - : base(interServiceInventoryService) + public UserDataBaseService(CommunicationsManager commsManager) + : base(commsManager) { } @@ -57,13 +52,6 @@ namespace OpenSim.Grid.UserServer.Modules { m_core = core; - //we only need core components so we can request them from here - IInterServiceInventoryServices inventoryService; - if (m_core.TryGet(out inventoryService)) - { - m_interServiceInventoryService = inventoryService; - } - UserConfig cfg; if (m_core.TryGet(out cfg)) { diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index c0cba4a..0a5abd3 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -145,9 +145,16 @@ namespace OpenSim.Grid.UserServer /// protected virtual void StartupUserServerModules() { - m_log.Info("[STARTUP]: Establishing data connection"); + m_log.Info("[STARTUP]: Establishing data connection"); + + //we only need core components so we can request them from here + IInterServiceInventoryServices inventoryService; + TryGet(out inventoryService); + + CommunicationsManager commsManager = new UserServerCommsManager(inventoryService); + //setup database access service, for now this has to be created before the other modules. - m_userDataBaseService = new UserDataBaseService(); + m_userDataBaseService = new UserDataBaseService(commsManager); m_userDataBaseService.Initialise(this); //TODO: change these modules so they fetch the databaseService class in the PostInitialise method diff --git a/OpenSim/Grid/UserServer/UserServerCommsManager.cs b/OpenSim/Grid/UserServer/UserServerCommsManager.cs new file mode 100644 index 0000000..519dfbc --- /dev/null +++ b/OpenSim/Grid/UserServer/UserServerCommsManager.cs @@ -0,0 +1,40 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSim Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using OpenSim.Framework.Communications; + +namespace OpenSim.Grid.UserServer +{ + public class UserServerCommsManager : CommunicationsManager + { + public UserServerCommsManager(IInterServiceInventoryServices interServiceInventoryService) + : base(null, null, null, false, null) + { + m_interServiceInventoryService = interServiceInventoryService; + } + } +} -- cgit v1.1