diff options
author | MW | 2009-02-25 18:33:15 +0000 |
---|---|---|
committer | MW | 2009-02-25 18:33:15 +0000 |
commit | 4db232763f578048c3339e6a60fe801cc3853b3d (patch) | |
tree | c43b1442bcf1893fb83894873ddfdacdee5a5130 /OpenSim/Grid/UserServer.Modules | |
parent | * Fix my own unit test (diff) | |
download | opensim-SC-4db232763f578048c3339e6a60fe801cc3853b3d.zip opensim-SC-4db232763f578048c3339e6a60fe801cc3853b3d.tar.gz opensim-SC-4db232763f578048c3339e6a60fe801cc3853b3d.tar.bz2 opensim-SC-4db232763f578048c3339e6a60fe801cc3853b3d.tar.xz |
More refactoring of the Grid, User and Messaging servers.
Diffstat (limited to '')
5 files changed, 94 insertions, 11 deletions
diff --git a/OpenSim/Grid/UserServer.Modules/GridInfoServiceModule.cs b/OpenSim/Grid/UserServer.Modules/GridInfoServiceModule.cs new file mode 100644 index 0000000..a6fdee0 --- /dev/null +++ b/OpenSim/Grid/UserServer.Modules/GridInfoServiceModule.cs | |||
@@ -0,0 +1,77 @@ | |||
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 OpenSim 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 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.IO; | ||
31 | using System.Reflection; | ||
32 | using log4net; | ||
33 | using log4net.Config; | ||
34 | using OpenMetaverse; | ||
35 | using OpenSim.Framework; | ||
36 | using OpenSim.Framework.Communications; | ||
37 | using OpenSim.Framework.Communications.Cache; | ||
38 | using OpenSim.Framework.Servers; | ||
39 | using OpenSim.Grid.Communications.OGS1; | ||
40 | using OpenSim.Grid.Framework; | ||
41 | |||
42 | namespace OpenSim.Grid.UserServer.Modules | ||
43 | { | ||
44 | public class GridInfoServiceModule | ||
45 | { | ||
46 | protected IUGAIMCore m_core; | ||
47 | protected GridInfoService m_gridInfoService; | ||
48 | protected BaseHttpServer m_httpServer; | ||
49 | |||
50 | public GridInfoServiceModule() | ||
51 | { | ||
52 | } | ||
53 | |||
54 | public void Initialise(IUGAIMCore core) | ||
55 | { | ||
56 | m_core = core; | ||
57 | m_gridInfoService = new GridInfoService(); | ||
58 | } | ||
59 | |||
60 | public void PostInitialise() | ||
61 | { | ||
62 | |||
63 | } | ||
64 | |||
65 | public void RegisterHandlers(BaseHttpServer httpServer) | ||
66 | { | ||
67 | m_httpServer = httpServer; | ||
68 | m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", | ||
69 | m_gridInfoService.RestGetGridInfoMethod)); | ||
70 | m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); | ||
71 | } | ||
72 | |||
73 | public void Close() | ||
74 | { | ||
75 | } | ||
76 | } | ||
77 | } | ||
diff --git a/OpenSim/Grid/UserServer.Modules/MessageServersConnector.cs b/OpenSim/Grid/UserServer.Modules/MessageServersConnector.cs index 59e9805..5b245ee 100644 --- a/OpenSim/Grid/UserServer.Modules/MessageServersConnector.cs +++ b/OpenSim/Grid/UserServer.Modules/MessageServersConnector.cs | |||
@@ -35,6 +35,7 @@ using Nwc.XmlRpc; | |||
35 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Servers; | 37 | using OpenSim.Framework.Servers; |
38 | using OpenSim.Grid.Framework; | ||
38 | 39 | ||
39 | namespace OpenSim.Grid.UserServer.Modules | 40 | namespace OpenSim.Grid.UserServer.Modules |
40 | { | 41 | { |
@@ -78,6 +79,8 @@ namespace OpenSim.Grid.UserServer.Modules | |||
78 | 79 | ||
79 | Thread m_NotifyThread; | 80 | Thread m_NotifyThread; |
80 | 81 | ||
82 | private IUGAIMCore m_core; | ||
83 | |||
81 | public event AgentLocationDelegate OnAgentLocation; | 84 | public event AgentLocationDelegate OnAgentLocation; |
82 | public event AgentLeavingDelegate OnAgentLeaving; | 85 | public event AgentLeavingDelegate OnAgentLeaving; |
83 | public event RegionStartupDelegate OnRegionStartup; | 86 | public event RegionStartupDelegate OnRegionStartup; |
@@ -86,18 +89,18 @@ namespace OpenSim.Grid.UserServer.Modules | |||
86 | public MessageServersConnector() | 89 | public MessageServersConnector() |
87 | { | 90 | { |
88 | MessageServers = new Dictionary<string, MessageServerInfo>(); | 91 | MessageServers = new Dictionary<string, MessageServerInfo>(); |
89 | m_NotifyThread = new Thread(new ThreadStart(NotifyQueueRunner)); | ||
90 | m_NotifyThread.Start(); | ||
91 | } | 92 | } |
92 | 93 | ||
93 | public void Initialise() | 94 | public void Initialise(IUGAIMCore core) |
94 | { | 95 | { |
95 | 96 | m_core = core; | |
97 | m_core.RegisterInterface<MessageServersConnector>(this); | ||
98 | m_NotifyThread = new Thread(new ThreadStart(NotifyQueueRunner)); | ||
99 | m_NotifyThread.Start(); | ||
96 | } | 100 | } |
97 | 101 | ||
98 | public void PostInitialise() | 102 | public void PostInitialise() |
99 | { | 103 | { |
100 | |||
101 | } | 104 | } |
102 | 105 | ||
103 | public void RegisterHandlers(BaseHttpServer httpServer) | 106 | public void RegisterHandlers(BaseHttpServer httpServer) |
diff --git a/OpenSim/Grid/UserServer.Modules/UserManager.cs b/OpenSim/Grid/UserServer.Modules/UserManager.cs index 1f4b07d..34daff2 100644 --- a/OpenSim/Grid/UserServer.Modules/UserManager.cs +++ b/OpenSim/Grid/UserServer.Modules/UserManager.cs | |||
@@ -35,6 +35,7 @@ using OpenMetaverse; | |||
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Communications; | 36 | using OpenSim.Framework.Communications; |
37 | using OpenSim.Framework.Servers; | 37 | using OpenSim.Framework.Servers; |
38 | using OpenSim.Grid.Framework; | ||
38 | 39 | ||
39 | namespace OpenSim.Grid.UserServer.Modules | 40 | namespace OpenSim.Grid.UserServer.Modules |
40 | { | 41 | { |
@@ -59,7 +60,7 @@ namespace OpenSim.Grid.UserServer.Modules | |||
59 | m_userDataBaseService = userDataBaseService; | 60 | m_userDataBaseService = userDataBaseService; |
60 | } | 61 | } |
61 | 62 | ||
62 | public void Initialise() | 63 | public void Initialise(IUGAIMCore core) |
63 | { | 64 | { |
64 | 65 | ||
65 | } | 66 | } |
diff --git a/OpenSim/Grid/UserServer.Modules/UserServerAvatarAppearanceModule.cs b/OpenSim/Grid/UserServer.Modules/UserServerAvatarAppearanceModule.cs index a1497b4..e68752d 100644 --- a/OpenSim/Grid/UserServer.Modules/UserServerAvatarAppearanceModule.cs +++ b/OpenSim/Grid/UserServer.Modules/UserServerAvatarAppearanceModule.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -35,6 +35,7 @@ using OpenMetaverse; | |||
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Communications; | 36 | using OpenSim.Framework.Communications; |
37 | using OpenSim.Framework.Servers; | 37 | using OpenSim.Framework.Servers; |
38 | using OpenSim.Grid.Framework; | ||
38 | 39 | ||
39 | namespace OpenSim.Grid.UserServer.Modules | 40 | namespace OpenSim.Grid.UserServer.Modules |
40 | { | 41 | { |
@@ -50,7 +51,7 @@ namespace OpenSim.Grid.UserServer.Modules | |||
50 | m_userDataBaseService = userDataBaseService; | 51 | m_userDataBaseService = userDataBaseService; |
51 | } | 52 | } |
52 | 53 | ||
53 | public void Initialise() | 54 | public void Initialise(IUGAIMCore core) |
54 | { | 55 | { |
55 | 56 | ||
56 | } | 57 | } |
diff --git a/OpenSim/Grid/UserServer.Modules/UserServerFriendsModule.cs b/OpenSim/Grid/UserServer.Modules/UserServerFriendsModule.cs index 9711a4b..6c1daea 100644 --- a/OpenSim/Grid/UserServer.Modules/UserServerFriendsModule.cs +++ b/OpenSim/Grid/UserServer.Modules/UserServerFriendsModule.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -35,6 +35,7 @@ using OpenMetaverse; | |||
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Communications; | 36 | using OpenSim.Framework.Communications; |
37 | using OpenSim.Framework.Servers; | 37 | using OpenSim.Framework.Servers; |
38 | using OpenSim.Grid.Framework; | ||
38 | 39 | ||
39 | namespace OpenSim.Grid.UserServer.Modules | 40 | namespace OpenSim.Grid.UserServer.Modules |
40 | { | 41 | { |
@@ -51,7 +52,7 @@ namespace OpenSim.Grid.UserServer.Modules | |||
51 | m_userDataBaseService = userDataBaseService; | 52 | m_userDataBaseService = userDataBaseService; |
52 | } | 53 | } |
53 | 54 | ||
54 | public void Initialise() | 55 | public void Initialise(IUGAIMCore core) |
55 | { | 56 | { |
56 | 57 | ||
57 | } | 58 | } |
@@ -170,4 +171,4 @@ namespace OpenSim.Grid.UserServer.Modules | |||
170 | return FriendListItemListtoXmlRPCResponse(returndata); | 171 | return FriendListItemListtoXmlRPCResponse(returndata); |
171 | } | 172 | } |
172 | } | 173 | } |
173 | } | 174 | } \ No newline at end of file |