Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4090


Ignore:
Timestamp:
07/23/10 09:17:32 (14 years ago)
Author:
cneumuel
Message:

replaced spring-component discovery method for ServiceHost with HL Type Discovery (#1098)

Location:
branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server/3.3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server/3.3/App.config

    r3011 r4090  
    77    </sectionGroup>
    88  </configSections>
     9 
     10  <!--
     11  <applicationSettings>
     12    <HeuristicLab.Hive.Server.Core.Properties.Settings>
     13      <setting name="HiveServerConnectionString" serializeAs="String">
     14        <value>Data Source=127.0.0.1;Initial Catalog=HeuristicLab.Hive;Persist Security Info=True;User ID=hive;Password=hive;Pooling=true;MultipleActiveResultSets=true</value>
     15      </setting>
     16    </HeuristicLab.Hive.Server.Core.Properties.Settings>
     17  </applicationSettings>
     18  -->
     19 
     20  <!-- [chn] which connectionstring is used? -->
     21 
     22  <connectionStrings>
     23    <add name="HeuristicLab.Hive.Server.LINQDataAccess.Properties.Settings.HeuristicLab_Hive_LinqConnectionString"
     24        connectionString="Data Source=127.0.0.1;Initial Catalog=HeuristicLab.Hive.Linq;Integrated Security=True;MultipleActiveResultSets=True"
     25        providerName="System.Data.SqlClient" />
     26  </connectionStrings>
     27 
     28  <!-- [chn] spring-config won't be merged anyway, so remove it when all sping-dependencies are resolved -->
     29  <spring>
     30    <context>
     31      <resource uri="config://spring/objects"/>
     32    </context>
     33
     34    <objects xmlns="http://www.springframework.net" xmlns:aop="http://www.springframework.net/aop">
     35      <object id="clientFacade" singleton="false" type="HeuristicLab.Hive.Server.Core.ClientFacade, HeuristicLab.Hive.Server.Core-3.3" />
     36      <object id="executionEngineFacade" singleton="false" type="HeuristicLab.Hive.Server.Core.ExecutionEngineFacade, HeuristicLab.Hive.Server.Core-3.3" />
     37      <object id="serverConsoleFacade" singleton="false" type="HeuristicLab.Hive.Server.Core.ServerConsoleFacade, HeuristicLab.Hive.Server.Core-3.3" />
     38      <object id="serviceOperation" type="Spring.Aop.Support.SdkRegularExpressionMethodPointcut, Spring.Aop">
     39        <property name="patterns">
     40          <list>
     41            <value>HeuristicLab.Hive.Server.Core.ClientFacade.*</value>
     42            <value>HeuristicLab.Hive.Server.Core.ExecutionEngineFacade.*</value>
     43            <value>HeuristicLab.Hive.Server.Core.ServerConsoleFacade.*</value>
     44          </list>
     45        </property>
     46      </object>
     47
     48      <object id="sci" type="HeuristicLab.Hive.Server.ServiceCallInterception, HeuristicLab.Hive.Server-3.3" />
     49
     50      <aop:config>
     51        <aop:advisor pointcut-ref="serviceOperation" advice-ref="sci"/>
     52      </aop:config>
     53    </objects>
     54  </spring>
    955</configuration>
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server/3.3/HeuristicLab.Hive.Server-3.3.csproj

    r4077 r4090  
    1010    <AppDesignerFolder>Properties</AppDesignerFolder>
    1111    <RootNamespace>HeuristicLab.Hive.Server</RootNamespace>
    12     <AssemblyName>HeuristicLab.Hive.Server-3.2</AssemblyName>
     12    <AssemblyName>HeuristicLab.Hive.Server-3.3</AssemblyName>
    1313    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    1414    <FileAlignment>512</FileAlignment>
     
    8181      <HintPath>..\..\..\..\..\..\..\..\..\Programme\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
    8282    </Reference>
     83    <Reference Include="HeuristicLab.Tracing-3.3">
     84      <HintPath>..\..\..\..\..\..\..\..\..\Programme\HeuristicLab 3.3\HeuristicLab.Tracing-3.3.dll</HintPath>
     85    </Reference>
     86    <Reference Include="Spring.Aop">
     87      <HintPath>..\..\HeuristicLab.ExtLibs\HeuristicLab.SpringNET\1.3.0\Spring.Aop.dll</HintPath>
     88    </Reference>
     89    <Reference Include="Spring.Core">
     90      <HintPath>..\..\HeuristicLab.ExtLibs\HeuristicLab.SpringNET\1.3.0\Spring.Core.dll</HintPath>
     91    </Reference>
     92    <Reference Include="Spring.Services">
     93      <HintPath>..\..\HeuristicLab.ExtLibs\HeuristicLab.SpringNET\1.3.0\Spring.Services.dll</HintPath>
     94    </Reference>
    8395    <Reference Include="System" />
    8496    <Reference Include="System.Core">
     
    142154      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    143155    </Compile>
    144     <Compile Include="ServiceCallInterception.cs" />
    145156  </ItemGroup>
    146157  <ItemGroup>
     
    159170  </ItemGroup>
    160171  <ItemGroup>
    161     <None Include="App.config">
     172    <None Include="app.config">
     173      <SubType>Designer</SubType>
    162174    </None>
    163175    <None Include="Resources\HeuristicLab.ico" />
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server/3.3/HiveServerApplication.cs

    r2904 r4090  
    3333using HeuristicLab.Hive.Contracts.Interfaces;
    3434using HeuristicLab.Hive.Server.Properties;
    35 using Spring.ServiceModel;
    3635
    3736namespace HeuristicLab.Hive.Server {
     
    6968      string curServiceHost = "";
    7069      Uri uriTcp;
    71       /*IEnumerable<IClientFacade> clientCommunicatorInstances = ApplicationManager.Manager.GetInstances<IClientFacade>();
    72       IEnumerable<IServerConsoleFacade> serverConsoleInstances = ApplicationManager.Manager.GetInstances<IServerConsoleFacade>();
    73       IEnumerable<IExecutionEngineFacade> executionEngineInstances = ApplicationManager.Manager.GetInstances<IExecutionEngineFacade>();*/
    74       SpringServiceHost serviceHost = null;
     70      IClientFacade clientCommunicatorInstance = ApplicationManager.Manager.GetInstances<IClientFacade>().First();
     71      IServerConsoleFacade serverConsoleInstance = ApplicationManager.Manager.GetInstances<IServerConsoleFacade>().First();
     72      IExecutionEngineFacade executionEngineInstance = ApplicationManager.Manager.GetInstances<IExecutionEngineFacade>().First();
     73      //SpringServiceHost serviceHost = null;
     74      ServiceHost serviceHost = null;
     75
    7576      switch (svc) {
    7677        case Services.ClientCommunicator:
    77         //  if (clientCommunicatorInstances.Count() > 0) {
    78             uriTcp = new Uri("net.tcp://" + ipAddress + ":" + port + "/HiveServer/");
    79             //serviceHost = new ServiceHost(clientCommunicatorInstances.First().GetType(), uriTcp);
    80             //serviceHost = new ServiceHost(typeof(ClientFacade), uriTcp);
    81             serviceHost = new SpringServiceHost("clientFacade", uriTcp);
    82             serviceHost.AddServiceEndpoint(typeof(IClientFacade), streamedBinding, STR_ClientCommunicator);
    83            
    84             ServiceDebugBehavior sdb = serviceHost.Description.Behaviors.Find<ServiceDebugBehavior>();
    85             if (sdb == null) {
    86               sdb = new ServiceDebugBehavior();
    87               serviceHost.Description.Behaviors.Add(sdb);
    88             }
    89             sdb.IncludeExceptionDetailInFaults = true;
     78          //  if (clientCommunicatorInstances.Count() > 0) {
     79          uriTcp = new Uri("net.tcp://" + ipAddress + ":" + port + "/HiveServer/");
     80          serviceHost = new ServiceHost(clientCommunicatorInstance.GetType(), uriTcp);
     81          //serviceHost = new ServiceHost(typeof(ClientFacade), uriTcp);
     82          //serviceHost = new SpringServiceHost("clientFacade", uriTcp);
     83          serviceHost.AddServiceEndpoint(typeof(IClientFacade), streamedBinding, STR_ClientCommunicator);
    9084
    91            
     85          ServiceDebugBehavior sdb = serviceHost.Description.Behaviors.Find<ServiceDebugBehavior>();
     86          if (sdb == null) {
     87            sdb = new ServiceDebugBehavior();
     88            serviceHost.Description.Behaviors.Add(sdb);
     89          }
     90          sdb.IncludeExceptionDetailInFaults = true;
    9291
    93             curServiceHost = STR_ClientCommunicator;
    94         //  }
     92
     93
     94          curServiceHost = STR_ClientCommunicator;
     95          //  }
    9596          break;
    9697        case Services.ServerConsoleFacade:
    97         //  if (serverConsoleInstances.Count() > 0) {
    98             uriTcp = new Uri("net.tcp://" + ipAddress + ":" + port + "/HiveServerConsole/");
    99             //serviceHost = new ServiceHost(serverConsoleInstances.First().GetType(), uriTcp);
    100             serviceHost = new SpringServiceHost("serverConsoleFacade", uriTcp);
    101             serviceHost.AddServiceEndpoint(typeof(IServerConsoleFacade), binding, STR_ServerConsoleFacade);
    102             curServiceHost = STR_ServerConsoleFacade;
    103         //  }
     98          //  if (serverConsoleInstances.Count() > 0) {
     99          uriTcp = new Uri("net.tcp://" + ipAddress + ":" + port + "/HiveServerConsole/");
     100          serviceHost = new ServiceHost(serverConsoleInstance.GetType(), uriTcp);
     101          //serviceHost = new SpringServiceHost("serverConsoleFacade", uriTcp);
     102          serviceHost.AddServiceEndpoint(typeof(IServerConsoleFacade), binding, STR_ServerConsoleFacade);
     103          curServiceHost = STR_ServerConsoleFacade;
     104          //  }
    104105          break;
    105106        case Services.ExecutionEngineFacade:
    106         //  if (executionEngineInstances.Count() > 0) {
    107             uriTcp = new Uri("net.tcp://" + ipAddress + ":" + port + "/ExecutionEngine/");
    108             //serviceHost = new ServiceHost(executionEngineInstances.First().GetType(), uriTcp);
    109             serviceHost = new SpringServiceHost("executionEngineFacade", uriTcp);
    110             serviceHost.AddServiceEndpoint(typeof(IExecutionEngineFacade), streamedBinding, STR_ExecutionEngineFacade);
    111             curServiceHost = STR_ExecutionEngineFacade;
    112         //  }
     107          //  if (executionEngineInstances.Count() > 0) {
     108          uriTcp = new Uri("net.tcp://" + ipAddress + ":" + port + "/ExecutionEngine/");
     109          serviceHost = new ServiceHost(executionEngineInstance.GetType(), uriTcp);
     110          //serviceHost = new SpringServiceHost("executionEngineFacade", uriTcp);
     111          serviceHost.AddServiceEndpoint(typeof(IExecutionEngineFacade), streamedBinding, STR_ExecutionEngineFacade);
     112          curServiceHost = STR_ExecutionEngineFacade;
     113          //  }
    113114          break;
    114115        case Services.All:
     
    160161      //Start services and record their base address
    161162      Dictionary<string, Uri> baseAddrDict = new Dictionary<string, Uri>();
    162       baseAddrDict.Add(STR_ClientCommunicator,
    163         StartService(Services.ClientCommunicator, addresses[index], WcfSettings.DEFAULTPORT));
    164       baseAddrDict.Add(STR_ServerConsoleFacade,
    165         StartService(Services.ServerConsoleFacade, addresses[index], WcfSettings.DEFAULTPORT));
    166       baseAddrDict.Add(STR_ExecutionEngineFacade,
    167         StartService(Services.ExecutionEngineFacade, addresses[index], WcfSettings.DEFAULTPORT));
     163      baseAddrDict.Add(STR_ClientCommunicator, StartService(Services.ClientCommunicator, addresses[index], WcfSettings.DEFAULTPORT));
     164      baseAddrDict.Add(STR_ServerConsoleFacade, StartService(Services.ServerConsoleFacade, addresses[index], WcfSettings.DEFAULTPORT));
     165      baseAddrDict.Add(STR_ExecutionEngineFacade, StartService(Services.ExecutionEngineFacade, addresses[index], WcfSettings.DEFAULTPORT));
    168166
    169167      IEnumerable<ILifecycleManager> lifecycleManagers = ApplicationManager.Manager.GetInstances<ILifecycleManager>();
    170168      if (lifecycleManagers.Count() > 0) {
    171         ILifecycleManager lifecycleManager =
    172           lifecycleManagers.First();
     169        ILifecycleManager lifecycleManager = lifecycleManagers.First();
    173170
    174171        lifecycleManager.Init();
     172
     173        // [chn] remove gui code here, how to display any response from server?
    175174        Form mainForm = new MainForm(baseAddrDict);
    176175        Application.Run(mainForm);
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server/3.3/HiveServerPlugin.cs

    r4077 r4090  
    2727
    2828namespace HeuristicLab.Hive.Server {
    29   [Plugin("HeuristicLab.Hive.Server-3.3")]
     29  [Plugin("HeuristicLab.Hive.Server", "3.3")]
    3030  [PluginFile("HeuristicLab.Hive.Server-3.3.dll", PluginFileType.Assembly)]
    31   [PluginDependency("HeuristicLab.Core-3.3")]
    32   [PluginDependency("HeuristicLab.DataAccess-3.3")]
    33   [PluginDependency("HeuristicLab.Hive.Server.Core-3.3")]
    34   [PluginDependency("HeuristicLab.Hive.Contracts-3.3")]
    35   [PluginDependency("HeuristicLab.Hive.Server.LINQDataAccess-3.3")]
    36   [PluginDependency("HeuristicLab.SpringNET", "1.3.0.0")]
    37   [PluginDependency("HeuristicLab.Tracing", "3.3.0")]
     31  [PluginDependency("HeuristicLab.Core", "3.3")]
     32  [PluginDependency("HeuristicLab.DataAccess", "3.3")]
     33  [PluginDependency("HeuristicLab.Hive.Server.Core", "3.3")]
     34  [PluginDependency("HeuristicLab.Hive.Contracts", "3.3")]
     35  [PluginDependency("HeuristicLab.Hive.Server.LINQDataAccess", "3.3")]
     36  //[PluginDependency("HeuristicLab.SpringNET", "1.3.0.0")]
     37  [PluginDependency("HeuristicLab.Tracing", "3.3")]
    3838  public class HiveServerPlugin : PluginBase {
    3939  }
Note: See TracChangeset for help on using the changeset viewer.