Ignore:
Timestamp:
12/15/08 01:22:08 (13 years ago)
Author:
gkronber
Message:

worked on #419 (Refactor CEDMA plugins)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/ServerForm.cs

    r556 r988  
    4343  public partial class ServerForm : Form {
    4444    private ServiceHost host;
    45     private ServiceHost rdfHost;
    46     private Database database;
    4745    private Store store;
    48     private static readonly string dbFile = AppDomain.CurrentDomain.BaseDirectory + "/test.db3";
    49     private static readonly string connectionString = "Data Source=\"" + dbFile + "\";Pooling=False";
    5046    private static readonly string rdfFile = AppDomain.CurrentDomain.BaseDirectory + "rdf_store.db3";
    5147    private static readonly string rdfConnectionString = "sqlite:rdf:Data Source=\"" + rdfFile + "\"";
     
    6359      JobManager jobManager = new JobManager(gridAddress.Text);
    6460      jobManager.Reset();
    65       RunScheduler scheduler = new RunScheduler(database, jobManager, addressTextBox.Text);
    66       Thread runSchedulerThread = new Thread(scheduler.Run);
    67       runSchedulerThread.Start();
    68     }
    69 
    70     private void InitDatabase() {
    71       DbProviderFactory fact;
    72       fact = DbProviderFactories.GetFactory("System.Data.SQLite");
    73       if(!System.IO.File.Exists(dbFile)) {
    74         database = new Database(connectionString);
    75         database.CreateNew();
    76       } else {
    77         database = new Database(connectionString);
    78       }
    7961    }
    8062
     
    8466
    8567    private void Start() {
    86       InitDatabase();
    8768      InitRdfStore();
    8869      InitRunScheduler();
    8970
    90       host = new ServiceHost(database, new Uri(addressTextBox.Text));
    91       rdfHost = new ServiceHost(store, new Uri(addressTextBox.Text+"/RdfStore"));
     71      host = new ServiceHost(store, new Uri(addressTextBox.Text));
    9272      ServiceThrottlingBehavior throttlingBehavior = new ServiceThrottlingBehavior();
    9373      throttlingBehavior.MaxConcurrentSessions = 20;
    9474      host.Description.Behaviors.Add(throttlingBehavior);
    95       rdfHost.Description.Behaviors.Add(throttlingBehavior);
    9675      try {
    9776        NetTcpBinding binding = new NetTcpBinding();
     
    10180        binding.Security.Mode = SecurityMode.None;
    10281
    103         host.AddServiceEndpoint(typeof(IDatabase), binding, addressTextBox.Text);
     82        host.AddServiceEndpoint(typeof(IStore), binding, addressTextBox.Text);
    10483        host.Open();
    105         rdfHost.AddServiceEndpoint(typeof(IStore), binding, addressTextBox.Text+"/RdfStore");
    106         rdfHost.Open();
    10784      } catch(CommunicationException ex) {
    10885        MessageBox.Show("An exception occurred: " + ex.Message);
    10986        host.Abort();
    110         rdfHost.Abort();
    11187      }
    11288    }
Note: See TracChangeset for help on using the changeset viewer.