Index: branches/thasling/DistributedGA/DistributedGA.Hive/DistributedGA.Hive.csproj
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Hive/DistributedGA.Hive.csproj	(revision 13555)
+++ branches/thasling/DistributedGA/DistributedGA.Hive/DistributedGA.Hive.csproj	(revision 13556)
@@ -6,5 +6,5 @@
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <ProjectGuid>{F191E644-1AFC-4825-8897-E79A6ED91B20}</ProjectGuid>
-    <OutputType>Exe</OutputType>
+    <OutputType>Library</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>DistributedGA.Hive</RootNamespace>
@@ -32,13 +32,48 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup>
+    <StartupObject />
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="HeuristicLab.Clients.Hive-3.3">
       <HintPath>..\..\..\..\Users\Lokal\Downloads\HeuristicLab 3.3.13\HeuristicLab.Clients.Hive-3.3.dll</HintPath>
     </Reference>
-    <Reference Include="HeuristicLab.Clients.Hive.JobManager-3.3">
-      <HintPath>..\..\..\..\Users\Lokal\Downloads\HeuristicLab 3.3.13\HeuristicLab.Clients.Hive.JobManager-3.3.dll</HintPath>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>..\..\..\..\Users\Lokal\Downloads\HeuristicLab 3.3.13\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\..\Users\Lokal\Downloads\HeuristicLab 3.3.13\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>..\..\..\..\Users\Lokal\Downloads\HeuristicLab 3.3.13\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3">
+      <HintPath>..\..\..\..\Users\Lokal\Downloads\HeuristicLab 3.3.13\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Hive-3.3">
+      <HintPath>..\..\..\..\Users\Lokal\Downloads\HeuristicLab 3.3.13\HeuristicLab.Hive-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3">
+      <HintPath>..\..\..\..\Users\Lokal\Downloads\HeuristicLab 3.3.13\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Users\Lokal\Downloads\HeuristicLab 3.3.13\HeuristicLab.Parameters-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3">
+      <HintPath>..\..\..\..\Users\Lokal\Downloads\HeuristicLab 3.3.13\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>..\..\..\..\Users\Lokal\Downloads\HeuristicLab 3.3.13\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
     <Reference Include="System.ServiceModel" />
     <Reference Include="System.Xml.Linq" />
@@ -49,9 +84,17 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Program.cs" />
+    <Compile Include="P2PTask.cs" />
+    <Compile Include="Plugin.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>
     <None Include="App.config" />
+    <None Include="HeuristicLab.snk" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\DistributedGA.Core\DistributedGA.Core.csproj">
+      <Project>{02e73f42-bdc9-4a7a-b74f-5879def27320}</Project>
+      <Name>DistributedGA.Core</Name>
+    </ProjectReference>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Index: branches/thasling/DistributedGA/DistributedGA.Hive/P2PTask.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Hive/P2PTask.cs	(revision 13556)
+++ branches/thasling/DistributedGA/DistributedGA.Hive/P2PTask.cs	(revision 13556)
@@ -0,0 +1,239 @@
+﻿using System;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using DistributedGA.Core;
+using DistributedGA.Core.Domain;
+using DistributedGA.Core.Implementation;
+using DistributedGA.Core.Interface;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace DistributedGA.Hive {
+  [StorableClass]
+  [Creatable(Category = "Haslinger's Very Special XO", Priority = 1000)]
+  public class P2PTask : ParameterizedNamedItem, IOptimizer {
+
+    [Storable]
+    private Log log;
+    [Storable]
+    private DateTime startTime;
+    [Storable]
+    private RunCollection runCollection;
+
+    #region Constructors and Cloning
+    [StorableConstructor]
+    protected P2PTask(bool deserializing) { }
+    protected P2PTask(P2PTask original, Cloner cloner)
+      : base(original, cloner) {
+      log = cloner.Clone(original.log);
+      startTime = original.startTime;
+      runCollection = cloner.Clone(original.runCollection);
+    }
+    public P2PTask() {
+      Name = "P2PTask";
+      Description = "P2PTask";
+      runCollection = new RunCollection();
+
+      Parameters.Add(new ValueParameter<StringValue>("LanIpPrefix", "", new StringValue("10.")));
+      Parameters.Add(new ValueParameter<StringValue>("ContactServerURL", "", new StringValue("http://10.42.1.150:9090/DistributedGA.ContactServer/ContactService")));
+
+      log = new Log();
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    protected virtual void AfterDeserialization() {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new P2PTask(this, cloner);
+    }
+    #endregion
+
+    #region ITask Members
+    public ExecutionState ExecutionState { get; private set; }
+
+    public TimeSpan ExecutionTime { get; private set; }
+
+    public void Prepare() {
+      Prepare(true);
+    }
+    public void Prepare(bool clearRuns) {
+      // ignore
+      ExecutionState = HeuristicLab.Core.ExecutionState.Prepared;
+      OnExecutionStateChanged();
+      OnPrepared();
+    }
+
+    private CancellationTokenSource cts;
+    private ManualResetEvent stoppedEvent;
+
+    public void Start() {
+      Task.Factory.StartNew(() => {
+        cts = new CancellationTokenSource();
+        stoppedEvent = new ManualResetEvent(false);
+        startTime = DateTime.Now;
+
+        ExecutionState = HeuristicLab.Core.ExecutionState.Started;
+        OnExecutionStateChanged();
+        OnStarted();
+
+        try {
+          log.LogMessage("Starting peer...");
+          IMessageHandler h = new PeerNetworkMessageHandler();
+          var lanIpPrefix = ((StringValue)(Parameters["LanIpPrefix"].ActualValue)).Value;
+          var contactServerUri = ((StringValue)(Parameters["ContactServerURL"].ActualValue)).Value;
+          h.Init(lanIpPrefix, contactServerUri);
+          PeerInfo pi = h.GetPeerInfo();
+          log.LogMessage(string.Format("Peer is hostet at IP: {0} and port: {1}", pi.IpAddress, pi.Port));
+          Thread.Sleep(1000 * 20);
+          log.LogMessage("Current peers within network:");
+          foreach (var item in h.GetCurrentNetwork()) {
+            log.LogMessage(string.Format("Peer at {0}:{1}", item.IpAddress, item.Port));
+          }
+          int i = 1;
+          while (i < 10 && !cts.Token.IsCancellationRequested) {
+            i++;
+            Thread.Sleep(1000 * 10);
+            var pop1 = CreatePopulation();
+            log.LogMessage("Publish population into network...");
+            h.PublishDataToNetwork(pop1);
+            log.LogMessage("Population published.");
+            log.LogMessage("Recieved populations:");
+            foreach (var item in h.GetDataFromNetwork()) {
+              log.LogMessage(string.Format("Population with Quality: {0:2} in Iteration {1}", item.Quality, item.IterationNumber));
+            }
+            ExecutionTime = DateTime.Now - startTime;
+            OnExecutionTimeChanged();
+          }
+        } catch (Exception ex) {
+          log.LogMessage(ex.Message);
+          log.LogMessage("press any key to continue...");
+        }
+
+        var run = new Run();
+        var results = new ResultCollection();
+
+        run.Results.Add("Execution Time", new TimeSpanValue(ExecutionTime));
+        run.Results.Add("Log", log);
+
+        runCollection.Add(run);
+
+        stoppedEvent.Set();
+        ExecutionState = HeuristicLab.Core.ExecutionState.Stopped;
+
+        OnExecutionStateChanged();
+        OnStopped();
+      });
+    }
+
+
+    public void Pause() {
+      if (cts != null) cts.Cancel();
+      stoppedEvent.WaitOne();
+
+      ExecutionState = HeuristicLab.Core.ExecutionState.Paused;
+      OnExecutionStateChanged();
+
+      OnPaused();
+    }
+
+    public void Stop() {
+      if (cts != null) cts.Cancel();
+      stoppedEvent.WaitOne();
+
+      ExecutionState = HeuristicLab.Core.ExecutionState.Stopped;
+      OnExecutionStateChanged();
+
+      OnStopped();
+    }
+
+    public event EventHandler Started;
+    protected virtual void OnStarted() {
+      EventHandler handler = Started;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+
+    public event EventHandler Stopped;
+    protected virtual void OnStopped() {
+      EventHandler handler = Stopped;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+
+    public event EventHandler Paused;
+    protected virtual void OnPaused() {
+      EventHandler handler = Paused;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+
+    public event EventHandler Prepared;
+    protected virtual void OnPrepared() {
+      EventHandler handler = Prepared;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+
+
+    public event EventHandler ComputeInParallelChanged;
+    protected virtual void OnComputeInParallelChanged() {
+      EventHandler handler = ComputeInParallelChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+    #endregion
+
+    #region Events
+    public event EventHandler ExecutionTimeChanged;
+    protected virtual void OnExecutionTimeChanged() {
+      EventHandler handler = ExecutionTimeChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+    public event EventHandler ExecutionStateChanged;
+    protected virtual void OnExecutionStateChanged() {
+      EventHandler handler = ExecutionStateChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+    #endregion
+
+    public override string ToString() {
+      return Name;
+    }
+
+
+
+    private static SolutionInfo[] CreatePopulation() {
+      SolutionInfo si1 = new SolutionInfo() {
+        IterationNumber = 1,
+        Quality = 3.5f,
+        Solution = new Solution() {
+        }
+      };
+      SolutionInfo si2 = new SolutionInfo() {
+        IterationNumber = 2,
+        Quality = 3.5f,
+        Solution = new Solution() {
+        }
+      };
+      SolutionInfo si3 = new SolutionInfo() {
+        IterationNumber = 3,
+        Quality = 3.5f,
+        Solution = new Solution() {
+        }
+      };
+      return new SolutionInfo[] { si1, si2, si3 };
+    }
+
+    public System.Collections.Generic.IEnumerable<IOptimizer> NestedOptimizers {
+      get { return Enumerable.Empty<IOptimizer>(); }
+    }
+
+    public RunCollection Runs {
+      get { return runCollection; }
+    }
+
+    public event EventHandler<EventArgs<Exception>> ExceptionOccurred;
+
+  }
+}
Index: branches/thasling/DistributedGA/DistributedGA.Hive/Plugin.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Hive/Plugin.cs	(revision 13556)
+++ branches/thasling/DistributedGA/DistributedGA.Hive/Plugin.cs	(revision 13556)
@@ -0,0 +1,19 @@
+﻿using HeuristicLab.PluginInfrastructure;
+
+namespace DistributedGA.Hive {
+  [Plugin("DistributedGA.Hive", "1.0.0.0")]
+  [PluginFile("DistributedGA.Core.dll", PluginFileType.Assembly)]
+  [PluginFile("DistributedGA.Hive.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Clients.Hive", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Hive", "3.3")]
+  [PluginDependency("HeuristicLab.Persistence", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3")]
+  public class Plugin : PluginBase {
+
+  }
+}
Index: branches/thasling/DistributedGA/DistributedGA.Hive/Program.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Hive/Program.cs	(revision 13555)
+++ 	(revision )
@@ -1,29 +1,0 @@
-﻿using System;
-using System.ServiceModel;
-using HeuristicLab.Clients.Hive;
-namespace DistributedGA.Hive {
-  class Program {
-    const string HIVESERVICEURI = @"http://services.heuristiclab.com/Hive-3.3/HiveService.svc";
-
-    static void Main(string[] args) {
-      var client = CreateHiveClient();
-      var myJob = CreateJob();
-      client.AddJob(myJob);
-    }
-
-    private static IHiveService CreateHiveClient() {
-      var binding = new WSHttpBinding();
-      var endpoint = new EndpointAddress(HIVESERVICEURI);
-      var myChannelFactory = new ChannelFactory<IHiveService>(binding, endpoint);
-
-      IHiveService client = null;
-      client = myChannelFactory.CreateChannel();
-      return client;
-    }
-
-    private static Job CreateJob() {
-      throw new NotImplementedException();
-    }
-  }
-
-}
