Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/01/10 21:20:01 (14 years ago)
Author:
kgrading
Message:

added functionality (#830)

Location:
trunk/sources/HeuristicLab.Hive.Server.Core/3.2
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ClientCommunicator.cs

    r2846 r2904  
    3939using System.Runtime.Serialization.Formatters.Binary;
    4040using HeuristicLab.Tracing;
     41using Linq = HeuristicLab.Hive.Server.LINQDataAccess;
    4142
    4243namespace HeuristicLab.Hive.Server.Core {
     
    6061    private IInternalJobManager jobManager;
    6162    private IScheduler scheduler;
     63
     64    Linq.ClientDao clientDao = new Linq.ClientDao();
    6265
    6366    private static int PENDING_TIMEOUT = 100;
     
    195198    /// <returns></returns>
    196199    public Response Login(ClientInfo clientInfo) {
    197       ISession session = factory.GetSessionForCurrentThread();
    198       ITransaction tx = null;
    199 
    200       try {
    201         IClientAdapter clientAdapter =
    202           session.GetDataAdapter<ClientInfo, IClientAdapter>();
    203 
    204         tx = session.BeginTransaction();
     200    //  ISession session = factory.GetSessionForCurrentThread();
     201    //  ITransaction tx = null;
     202
     203    //  try {
     204    //    IClientAdapter clientAdapter =
     205    //      session.GetDataAdapter<ClientInfo, IClientAdapter>();
     206
     207    //    tx = session.BeginTransaction();
    205208
    206209        Response response = new Response();
     
    215218
    216219        clientInfo.State = State.idle;
    217         clientAdapter.Update(clientInfo);
     220
     221        if (clientDao.FindById(clientInfo.Id) == null)
     222          clientDao.Insert(clientInfo);
     223        else
     224          clientDao.Update(clientInfo);
     225        //clientAdapter.Update(clientInfo);
    218226        response.Success = true;
    219227        response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_LOGIN_SUCCESS;
    220228
    221         tx.Commit();
     229        //tx.Commit();
    222230        return response;
    223       }
    224       catch (Exception ex) {
     231      //}
     232      /*catch (Exception ex) {
    225233        if (tx != null)
    226234          tx.Rollback();
     
    230238        if (session != null)
    231239          session.EndSession();
    232       }
     240      } */
    233241    }
    234242
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ClientFacade.cs

    r2122 r2904  
    3636  [ServiceBehavior(InstanceContextMode =
    3737    InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple)]
    38   class ClientFacade: IClientFacade {
     38  public class ClientFacade: IClientFacade {
     39
     40    public ClientFacade() {     
     41    }
    3942
    4043    private IClientCommunicator clientCommunicator =
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ClientManager.cs

    r2086 r2904  
    2929using HeuristicLab.Hive.Server.DataAccess;
    3030using HeuristicLab.DataAccess.Interfaces;
     31using HeuristicLab.Hive.Server.LINQDataAccess;
     32using ClientGroup=HeuristicLab.Hive.Contracts.BusinessObjects.ClientGroup;
     33using Resource=HeuristicLab.Hive.Contracts.BusinessObjects.Resource;
    3134
    3235namespace HeuristicLab.Hive.Server.Core {
    3336  class ClientManager: IClientManager {
     37
     38    ClientDao clientDao = new ClientDao();
    3439
    3540    ISessionFactory factory;
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/DbTestApp.cs

    r2591 r2904  
    3434using HeuristicLab.Hive.Server.Core;
    3535using HeuristicLab.Core;
     36using HeuristicLab.Hive.Server.LINQDataAccess;
    3637
    3738namespace HeuristicLab.Hive.Server {
     
    298299
    299300      IJobAdapter jobAdapter =
    300         session.GetDataAdapter<Job, IJobAdapter>();
     301        session.GetDataAdapter<HeuristicLab.Hive.Contracts.BusinessObjects.Job, IJobAdapter>();
    301302
    302303      Stream s = jobAdapter.GetSerializedJobStream(
     
    358359      IStorable restoredJob =
    359360        PersistenceManager.RestoreFromGZip(response.Obj.SerializedJobResultData);
     361    }
     362
     363    private void TestLINQImplementation() {     
     364      ClientDao clientDao = new ClientDao();     
     365      ClientInfo info = new ClientInfo();
     366      info.Id = Guid.NewGuid();
     367      info.FreeMemory = 1000;
     368      info.Login = DateTime.Now;
     369      info.Memory = 1000;
     370      info.Name = "jackie";
     371      info.NrOfCores = 3;
     372      info.NrOfFreeCores = 2;
     373      info.CpuSpeedPerCore = 2500;
     374      info.State = State.idle;
     375      info = clientDao.Insert(info);
     376
    360377    }
    361378
     
    365382      //TestJobStreaming();
    366383      //TestJobResultStreaming();
    367       TestJobResultDeserialization();
    368     }
     384      //TestJobResultDeserialization();
     385
     386      TestLINQImplementation();
     387
     388    }
     389
     390
    369391  }
    370392}
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ExecutionEngineFacade.cs

    r2099 r2904  
    2929
    3030namespace HeuristicLab.Hive.Server.Core {
    31   class ExecutionEngineFacade: IExecutionEngineFacade {
     31  public class ExecutionEngineFacade: IExecutionEngineFacade {
    3232
    3333    private IJobManager jobManager =
    3434      ServiceLocator.GetJobManager();
     35
     36    public ExecutionEngineFacade() {
     37     
     38    }
    3539
    3640    #region IExecutionEngineFacade Members
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/HeuristicLab.Hive.Server.Core-3.2.csproj

    r2608 r2904  
    6868    <Reference Include="System" />
    6969    <Reference Include="System.Core">
     70      <RequiredTargetFramework>3.5</RequiredTargetFramework>
     71    </Reference>
     72    <Reference Include="System.Data.Linq">
    7073      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    7174    </Reference>
     
    149152      <Name>HeuristicLab.Hive.Server.DataAccess-3.2</Name>
    150153    </ProjectReference>
     154    <ProjectReference Include="..\..\HeuristicLab.Hive.Server.LINQDataAccess\3.2\HeuristicLab.Hive.Server.LINQDataAccess-3.2.csproj">
     155      <Project>{A4499DDD-D1B8-414F-98F6-903C2C71BEB0}</Project>
     156      <Name>HeuristicLab.Hive.Server.LINQDataAccess-3.2</Name>
     157    </ProjectReference>
    151158    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
    152159      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
     
    171178      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    172179    </EmbeddedResource>
     180  </ItemGroup>
     181  <ItemGroup>
     182    <WCFMetadata Include="Service References\" />
    173183  </ItemGroup>
    174184  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ServerConsoleFacade.cs

    r2099 r2904  
    4343
    4444    public Guid sessionID = Guid.Empty;
     45
     46    public ServerConsoleFacade() {     
     47    }
    4548
    4649    public Response Login(string username, string password) {
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/app.config

    r2608 r2904  
    11<?xml version="1.0" encoding="utf-8" ?>
    22<configuration>
    3   <configSections>
     3  <configSections> 
     4    <sectionGroup name="spring">
     5      <section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
     6      <section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core"/>
     7    </sectionGroup>   
    48    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
    59      <section name="HeuristicLab.Hive.Server.Core.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
     
    1317    </HeuristicLab.Hive.Server.Core.Properties.Settings>
    1418  </applicationSettings>
     19  <spring>
     20    <context>
     21      <resource uri="config://spring/objects"/>
     22    </context>
     23   
     24    <objects xmlns="http://www.springframework.net"
     25         xmlns:aop="http://www.springframework.net/aop">
     26      <object id="calculator" singleton="false"
     27              type="HeuristicLab.Hive.Server.Core.ClientFacade, HeuristicLab.Hive.Server.Core-3.2" />
     28
     29      <object id="serviceOperation" type="Spring.Aop.Support.SdkRegularExpressionMethodPointcut, Spring.Aop">
     30        <property name="patterns">
     31          <list>
     32            <value>HeuristicLab.Hive.Server.Core.ClientFacade.*</value>
     33          </list>
     34        </property>
     35      </object>
     36
     37      <object id="sci" type="HeuristicLab.Hive.Server.ServiceCallInterception, HeuristicLab.Hive.Server-3.2" />
     38
     39      <aop:config>
     40        <aop:advisor pointcut-ref="serviceOperation" advice-ref="sci"/>
     41      </aop:config>
     42    </objects>
     43  </spring>
    1544</configuration>
Note: See TracChangeset for help on using the changeset viewer.