Changeset 2050 for trunk/sources/HeuristicLab.CEDMA.Server/3.3/Server.cs
- Timestamp:
- 06/16/09 11:15:34 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Server/3.3/Server.cs
r1529 r2050 33 33 namespace HeuristicLab.CEDMA.Server { 34 34 public class Server { 35 private static readonly string rdfFile = AppDomain.CurrentDomain.BaseDirectory + "rdf_store.db3"; 36 private static readonly string rdfConnectionString = "sqlite:rdf:Data Source=\"" + rdfFile + "\""; 37 35 38 private ServiceHost host; 36 private IStore store; 39 private Store store; 40 private IDispatcher dispatcher; 41 private IExecuter executer; 37 42 38 43 private string gridServiceUrl; 39 40 44 public string GridServiceUrl { 41 45 get { return gridServiceUrl; } … … 44 48 45 49 private string cedmaServiceUrl; 46 47 50 public string CedmaServiceUrl { 48 51 get { return cedmaServiceUrl; } … … 50 53 } 51 54 52 public Server(IStore store) { 55 private int maxActiveJobs; 56 public int MaxActiveJobs { 57 get { return maxActiveJobs; } 58 set { 59 if (value > 0 && value <= 64) { 60 maxActiveJobs = value; 61 } 62 } 63 } 64 65 public Server() { 53 66 IPAddress[] addresses = Dns.GetHostAddresses(Dns.GetHostName()); 54 67 // windows XP returns the external ip on index 0 while windows vista returns the external ip as one of the last entries … … 61 74 } 62 75 cedmaServiceUrl = "net.tcp://" + addresses[index] + ":8002/CEDMA"; 63 this.store = store; 76 store = new Store(rdfConnectionString); 77 maxActiveJobs = 10; 64 78 } 65 79 … … 83 97 } 84 98 } 99 100 internal string[] GetActiveJobDescriptions() { 101 if (executer != null) return executer.GetJobs(); 102 else return new string[] { }; 103 } 104 105 internal void Connect(string serverUrl) { 106 dispatcher = new SimpleDispatcher(store); 107 if (serverUrl.Contains("ExecutionEngine")) { 108 executer = new HiveExecuter(dispatcher, store, serverUrl); 109 } else { 110 // default is grid backend 111 executer = new GridExecuter(dispatcher, store, serverUrl); 112 } 113 executer.Start(); 114 } 85 115 } 86 116 }
Note: See TracChangeset
for help on using the changeset viewer.