Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/24/09 17:27:17 (15 years ago)
Author:
gkronber
Message:

Added views for the executer and the dispatcher and the server (which contains the executer and dispatcher views). #676 (Cockpit for the CEDMA Server to control algorithm settings)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/Server.cs

    r2075 r2088  
    3232using HeuristicLab.Grid;
    3333using HeuristicLab.Grid.HiveBridge;
     34using HeuristicLab.Core;
    3435
    3536namespace HeuristicLab.CEDMA.Server {
    36   public class Server {
     37  public class Server : IViewable {
    3738    private static readonly string rdfFile = AppDomain.CurrentDomain.BaseDirectory + "rdf_store.db3";
    3839    private static readonly string rdfConnectionString = "sqlite:rdf:Data Source=\"" + rdfFile + "\"";
     
    4041    private ServiceHost host;
    4142    private Store store;
     43
    4244    private IDispatcher dispatcher;
     45    public IDispatcher Dispatcher { get { return dispatcher; } }
    4346    private IExecuter executer;
     47    public IExecuter Executer { get { return executer; } }
    4448
    4549    private string gridServiceUrl;
     
    5357      get { return cedmaServiceUrl; }
    5458      set { cedmaServiceUrl = value; }
    55     }
    56 
    57     private int maxActiveJobs;
    58     public int MaxActiveJobs {
    59       get { return maxActiveJobs; }
    60       set {
    61         if (value > 0) {
    62           maxActiveJobs = value;
    63           if (executer != null) {
    64             executer.MaxActiveJobs = value;
    65           }
    66         }
    67       }
    6859    }
    6960
     
    8071      cedmaServiceUrl = "net.tcp://" + addresses[index] + ":8002/CEDMA";
    8172      store = new Store(rdfConnectionString);
    82       maxActiveJobs = 10;
    8373    }
    8474
     
    10393    }
    10494
    105     internal string[] GetActiveJobDescriptions() {
    106       if (executer != null) return executer.GetJobs();
    107       else return new string[] { };
    108     }
    109 
    11095    internal void Connect(string serverUrl) {
    11196      dispatcher = new SimpleDispatcher(store);
     
    118103      }
    119104      executer = new GridExecuter(dispatcher, store, gridServer);
    120       executer.MaxActiveJobs = MaxActiveJobs;
    121105      executer.Start();
    122106    }
     107    #region IViewable Members
     108
     109    public IView CreateView() {
     110      return new ServerForm(this);
     111    }
     112
     113    #endregion
    123114  }
    124115}
Note: See TracChangeset for help on using the changeset viewer.