aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs
diff options
context:
space:
mode:
authorMelanie2010-01-11 05:13:47 +0000
committerMelanie2010-01-11 05:13:47 +0000
commitca75ad674315d924397576219f3bd3c5e1a75146 (patch)
tree2ec6fc565f8ba628660bcc26ef44fa9e9f2f12f9 /OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs
parentRefactor. Instantiate sim status handlers in opensim base, not in a plugin (diff)
downloadopensim-SC_OLD-ca75ad674315d924397576219f3bd3c5e1a75146.zip
opensim-SC_OLD-ca75ad674315d924397576219f3bd3c5e1a75146.tar.gz
opensim-SC_OLD-ca75ad674315d924397576219f3bd3c5e1a75146.tar.bz2
opensim-SC_OLD-ca75ad674315d924397576219f3bd3c5e1a75146.tar.xz
Remove CreateCommsManagerPlugin
Diffstat (limited to 'OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs')
-rw-r--r--OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs144
1 files changed, 0 insertions, 144 deletions
diff --git a/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs b/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs
deleted file mode 100644
index 3cd02f4..0000000
--- a/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs
+++ /dev/null
@@ -1,144 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31using log4net;
32using OpenSim.Data;
33using OpenSim.Framework;
34using OpenSim.Framework.Communications;
35using OpenSim.Framework.Communications.Cache;
36using OpenSim.Framework.Communications.Osp;
37using OpenSim.Framework.Servers;
38using OpenSim.Framework.Servers.HttpServer;
39
40namespace OpenSim.ApplicationPlugins.CreateCommsManager
41{
42 public class CreateCommsManagerPlugin : IApplicationPlugin
43 {
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45
46 #region IApplicationPlugin Members
47
48 // TODO: required by IPlugin, but likely not at all right
49 private string m_name = "CreateCommsManagerPlugin";
50 private string m_version = "0.0";
51
52 public string Version
53 {
54 get { return m_version; }
55 }
56
57 public string Name
58 {
59 get { return m_name; }
60 }
61
62 protected OpenSimBase m_openSim;
63
64 protected BaseHttpServer m_httpServer;
65
66 protected CommunicationsManager m_commsManager;
67
68 protected IRegionCreator m_regionCreator;
69
70 public void Initialise()
71 {
72 m_log.Info("[LOADREGIONS]: " + Name + " cannot be default-initialized!");
73 throw new PluginNotInitialisedException(Name);
74 }
75
76 public void Initialise(OpenSimBase openSim)
77 {
78 m_openSim = openSim;
79 m_httpServer = openSim.HttpServer;
80
81 InitialiseCommsManager(openSim);
82 }
83
84 public void PostInitialise()
85 {
86 if (m_openSim.ApplicationRegistry.TryGet<IRegionCreator>(out m_regionCreator))
87 {
88 m_regionCreator.OnNewRegionCreated += RegionCreated;
89 }
90 }
91
92 public void Dispose()
93 {
94 }
95
96 #endregion
97
98 private void RegionCreated(IScene scene)
99 {
100 }
101
102 protected void InitialiseCommsManager(OpenSimBase openSim)
103 {
104 LibraryRootFolder libraryRootFolder = new LibraryRootFolder(m_openSim.ConfigurationSettings.LibrariesXMLFile);
105
106 InitialiseStandardServices(libraryRootFolder);
107
108 openSim.CommunicationsManager = m_commsManager;
109 }
110
111 protected void InitialiseStandardServices(LibraryRootFolder libraryRootFolder)
112 {
113 // Standalone mode is determined by !startupConfig.GetBoolean("gridmode", false)
114 if (m_openSim.ConfigurationSettings.Standalone)
115 {
116 InitialiseStandaloneServices(libraryRootFolder);
117 }
118 else
119 {
120 // We are in grid mode
121 InitialiseGridServices(libraryRootFolder);
122 }
123 }
124
125 /// <summary>
126 /// Initialises the backend services for standalone mode, and registers some http handlers
127 /// </summary>
128 /// <param name="libraryRootFolder"></param>
129 protected virtual void InitialiseStandaloneServices(LibraryRootFolder libraryRootFolder)
130 {
131
132 CreateGridInfoService();
133 }
134
135 protected virtual void InitialiseGridServices(LibraryRootFolder libraryRootFolder)
136 {
137
138 }
139
140 private void CreateGridInfoService()
141 {
142 }
143 }
144}