diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs | 68 |
1 files changed, 41 insertions, 27 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs index 74ece2e..c1b7235 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs | |||
@@ -50,6 +50,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
50 | 50 | ||
51 | private bool m_Enabled = false; | 51 | private bool m_Enabled = false; |
52 | 52 | ||
53 | public LocalGridServicesConnector() | ||
54 | { | ||
55 | } | ||
56 | |||
57 | public LocalGridServicesConnector(IConfigSource source) | ||
58 | { | ||
59 | InitialiseService(source); | ||
60 | } | ||
61 | |||
53 | #region ISharedRegionModule | 62 | #region ISharedRegionModule |
54 | 63 | ||
55 | public Type ReplaceableInterface | 64 | public Type ReplaceableInterface |
@@ -70,38 +79,43 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
70 | string name = moduleConfig.GetString("GridServices", ""); | 79 | string name = moduleConfig.GetString("GridServices", ""); |
71 | if (name == Name) | 80 | if (name == Name) |
72 | { | 81 | { |
73 | IConfig assetConfig = source.Configs["GridService"]; | 82 | InitialiseService(source); |
74 | if (assetConfig == null) | ||
75 | { | ||
76 | m_log.Error("[GRID CONNECTOR]: GridService missing from OpenSim.ini"); | ||
77 | return; | ||
78 | } | ||
79 | |||
80 | string serviceDll = assetConfig.GetString("LocalServiceModule", | ||
81 | String.Empty); | ||
82 | |||
83 | if (serviceDll == String.Empty) | ||
84 | { | ||
85 | m_log.Error("[GRID CONNECTOR]: No LocalServiceModule named in section GridService"); | ||
86 | return; | ||
87 | } | ||
88 | |||
89 | Object[] args = new Object[] { source }; | ||
90 | m_GridService = | ||
91 | ServerUtils.LoadPlugin<IGridService>(serviceDll, | ||
92 | args); | ||
93 | |||
94 | if (m_GridService == null) | ||
95 | { | ||
96 | m_log.Error("[GRID CONNECTOR]: Can't load asset service"); | ||
97 | return; | ||
98 | } | ||
99 | m_Enabled = true; | 83 | m_Enabled = true; |
100 | m_log.Info("[GRID CONNECTOR]: Local grid connector enabled"); | 84 | m_log.Info("[LOCAL GRID CONNECTOR]: Local grid connector enabled"); |
101 | } | 85 | } |
102 | } | 86 | } |
103 | } | 87 | } |
104 | 88 | ||
89 | private void InitialiseService(IConfigSource source) | ||
90 | { | ||
91 | IConfig assetConfig = source.Configs["GridService"]; | ||
92 | if (assetConfig == null) | ||
93 | { | ||
94 | m_log.Error("[LOCAL GRID CONNECTOR]: GridService missing from OpenSim.ini"); | ||
95 | return; | ||
96 | } | ||
97 | |||
98 | string serviceDll = assetConfig.GetString("LocalServiceModule", | ||
99 | String.Empty); | ||
100 | |||
101 | if (serviceDll == String.Empty) | ||
102 | { | ||
103 | m_log.Error("[LOCAL GRID CONNECTOR]: No LocalServiceModule named in section GridService"); | ||
104 | return; | ||
105 | } | ||
106 | |||
107 | Object[] args = new Object[] { source }; | ||
108 | m_GridService = | ||
109 | ServerUtils.LoadPlugin<IGridService>(serviceDll, | ||
110 | args); | ||
111 | |||
112 | if (m_GridService == null) | ||
113 | { | ||
114 | m_log.Error("[LOCAL GRID CONNECTOR]: Can't load asset service"); | ||
115 | return; | ||
116 | } | ||
117 | } | ||
118 | |||
105 | public void PostInitialise() | 119 | public void PostInitialise() |
106 | { | 120 | { |
107 | } | 121 | } |