Changeset 2591 for trunk/sources/HeuristicLab.Security.Server/3.2
- Timestamp:
- 01/05/10 10:31:40 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Security.Server/3.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Security.Server/3.2/SecurityServerApplication.cs
r1766 r2591 6 6 using System.ServiceModel.Description; 7 7 using System.Net; 8 using System.Linq; 8 9 using HeuristicLab.Security.Contracts.Interfaces; 9 10 using System.Windows.Forms; … … 11 12 namespace HeuristicLab.Security.Server { 12 13 13 [ClassInfo(Name = "Security Server", 14 Description = "Server application for the security.", 15 AutoRestart = true)] 14 [Application("Security Server", "Server application for the security.", true)] 16 15 public class SecurityServerApplication : ApplicationBase { 17 16 public const string STR_PermissionManager = "PermissionManager"; 18 public const string STR_SecurityManager = "SecurityManager"; 17 public const string STR_SecurityManager = "SecurityManager"; 19 18 20 19 int DEFAULT_PORT_SM = 9111; 21 20 int DEFAULT_PORT_PM = 9112; 22 21 23 private DiscoveryService discService = new DiscoveryService();24 22 private Dictionary<string, ServiceHost> runningServices = new Dictionary<string, ServiceHost>(); 25 23 private NetTcpBinding binding = (NetTcpBinding)HeuristicLab.Hive.Contracts.WcfSettings.GetBinding(); … … 30 28 All 31 29 } 32 30 33 31 private bool AddMexEndpoint(ServiceHost serviceHost) { 34 32 if (serviceHost != null) { … … 48 46 Uri uriTcp; 49 47 String result = ""; 50 I SecurityManager[] securityManagerInstances = discService.GetInstances<ISecurityManager>();51 I PermissionManager[] permissionManagerInstances = discService.GetInstances<IPermissionManager>();48 IEnumerable<ISecurityManager> securityManagerInstances = ApplicationManager.Manager.GetInstances<ISecurityManager>(); 49 IEnumerable<IPermissionManager> permissionManagerInstances = ApplicationManager.Manager.GetInstances<IPermissionManager>(); 52 50 ServiceHost serviceHost = null; 53 51 switch (svc) { 54 52 case Services.PermissionManager: 55 if (permissionManagerInstances. Length> 0) {56 uriTcp = new Uri("net.tcp://" + ipAddress + ":" + port + "/SecurityServer/"); 57 serviceHost = new ServiceHost(permissionManagerInstances [0].GetType(), uriTcp);53 if (permissionManagerInstances.Count() > 0) { 54 uriTcp = new Uri("net.tcp://" + ipAddress + ":" + port + "/SecurityServer/"); 55 serviceHost = new ServiceHost(permissionManagerInstances.First().GetType(), uriTcp); 58 56 serviceHost.AddServiceEndpoint(typeof(IPermissionManager), binding, STR_PermissionManager); 59 57 curServiceHost = STR_PermissionManager; … … 62 60 break; 63 61 case Services.SecurityManager: 64 if (securityManagerInstances. Length> 0) {62 if (securityManagerInstances.Count() > 0) { 65 63 uriTcp = new Uri("net.tcp://" + ipAddress + ":" + port + "/SecurityServer/"); 66 serviceHost = new ServiceHost(securityManagerInstances [0].GetType(), uriTcp);64 serviceHost = new ServiceHost(securityManagerInstances.First().GetType(), uriTcp); 67 65 serviceHost.AddServiceEndpoint(typeof(ISecurityManager), binding, STR_SecurityManager); 68 66 curServiceHost = STR_SecurityManager; … … 77 75 if ((serviceHost != null) && (!String.IsNullOrEmpty(curServiceHost))) { 78 76 AddMexEndpoint(serviceHost); 79 // WcfSettings.SetServiceCertificate(serviceHost);77 // WcfSettings.SetServiceCertificate(serviceHost); 80 78 serviceHost.Open(); 81 79 runningServices.Add(curServiceHost, serviceHost); … … 112 110 break; 113 111 } 114 112 115 113 //Start services and record their base address 116 114 Dictionary<string, String> baseAddrDict = new Dictionary<string, String>(); … … 126 124 StopService(Services.All); 127 125 } 128 } 126 } 129 127 } -
trunk/sources/HeuristicLab.Security.Server/3.2/SecurityServerPlugin.cs
r1713 r2591 26 26 27 27 namespace HeuristicLab.Security.Server { 28 [ ClassInfo(Name ="HeuristicLab.Security.Server-3.2")]29 [PluginFile( Filename = "HeuristicLab.Security.Server-3.2.dll", Filetype =PluginFileType.Assembly)]30 [ Dependency(Dependency ="HeuristicLab.Core-3.2")]28 [Plugin("HeuristicLab.Security.Server-3.2")] 29 [PluginFile("HeuristicLab.Security.Server-3.2.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.Core-3.2")] 31 31 public class SecurityServerPlugin : PluginBase { 32 32 }
Note: See TracChangeset
for help on using the changeset viewer.