|
@@ -9,6 +9,8 @@ using WingServerCommon.Service;
|
|
|
using WingServerCommon.Log;
|
|
|
using WingServerCommon.Config;
|
|
|
using WingServerCommon.Config.Parameters;
|
|
|
+using WingInterfaceLibrary.OpLog;
|
|
|
+using WingCloudServer.InteractionCenter;
|
|
|
|
|
|
namespace WingCloudServer
|
|
|
{
|
|
@@ -52,8 +54,8 @@ namespace WingCloudServer
|
|
|
void InitializeServices()
|
|
|
{
|
|
|
//initiaize rpc client pool
|
|
|
- var remoteRpcHttpServices = LoadRemoteServiceConfig();//new RemoteServiceInfo[0]; //TODO from settings
|
|
|
- var rpcClientPool = new JsonRpcClientPool(_inProcessEngine);
|
|
|
+ var remoteRpcHttpServices = LoadRemoteServiceConfig();//new RemoteServiceInfo[0];
|
|
|
+ var rpcClientPool = new JsonRpcClientPool(_inProcessEngine);
|
|
|
rpcClientPool.Initialize(remoteRpcHttpServices.ToArray());
|
|
|
|
|
|
var folder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Services");
|
|
@@ -92,6 +94,19 @@ namespace WingCloudServer
|
|
|
}
|
|
|
|
|
|
//Rpc http service load and register to rpc http server
|
|
|
+ if(ConfigurationManager.IsDistributed)
|
|
|
+ {
|
|
|
+ if(ConfigurationManager.IsMaster)
|
|
|
+ {
|
|
|
+ _rpcHttpServer.RegisterService(typeof(IMasterInteractionCenterService), new MasterInteractionCenterService());
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //TODO determin if we need to assess slave server on master server
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
foreach (var service in rpcHttpServices)
|
|
|
{
|
|
|
var wingServiceType = LoadService(folder, service);
|
|
@@ -211,6 +226,23 @@ namespace WingCloudServer
|
|
|
private List<RemoteServiceInfo> LoadRemoteServiceConfig()
|
|
|
{
|
|
|
List<RemoteServiceInfo> resList = new List<RemoteServiceInfo>();
|
|
|
+ if(ConfigurationManager.IsDistributed)
|
|
|
+ {
|
|
|
+ if(ConfigurationManager.IsMaster)
|
|
|
+ {
|
|
|
+ //TODO determin if we need to assess slave server on master server
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var serviceInfo = new RemoteServiceInfo()
|
|
|
+ {
|
|
|
+ ServiceName="MasterInteractionCenterService",
|
|
|
+ Url = ConfigurationManager.MasterUrl
|
|
|
+ };
|
|
|
+ resList.Add(serviceInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
var remoteStr = ConfigurationManager.GetParammeter<StringParameter>("Services", "Remote").Value;
|
|
|
var rpcHttpServicesString = ConfigurationManager.GetParammeter<StringParameter>("Services", "JsonRpcHttp").Value;
|
|
|
if (!string.IsNullOrEmpty(remoteStr) && remoteStr.Split(',').Length > 0)
|