Index: src/Fragmentation/Automation/Operations/Servers/SendJobToWorkerOperation.cpp
===================================================================
--- src/Fragmentation/Automation/Operations/Servers/SendJobToWorkerOperation.cpp	(revision 50d0954c9954f199b1e23cb238803411a30172b2)
+++ src/Fragmentation/Automation/Operations/Servers/SendJobToWorkerOperation.cpp	(revision 50d0954c9954f199b1e23cb238803411a30172b2)
@@ -0,0 +1,64 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * SendJobToWorkerOperation.cpp
+ *
+ *  Created on: Feb 22, 2012
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+// boost asio needs specific operator new
+#include <boost/asio.hpp>
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "SendJobToWorkerOperation.hpp"
+
+#include <boost/bind.hpp>
+#include <iostream>
+#include "Connection.hpp" // Must come before boost/serialization headers.
+#include "CodePatterns/Info.hpp"
+#include "CodePatterns/Log.hpp"
+
+/** Handle connect operation to shutdown scheduler.
+ *
+ * \param e error code if something went wrong
+ * \param endpoint_iterator endpoint of the connection
+ */
+void SendJobToWorkerOperation::handle_connect(const boost::system::error_code& e,
+    boost::asio::ip::tcp::resolver::iterator endpoint_iterator)
+{
+  Info info(__FUNCTION__);
+  if (!e)
+  {
+    // The connection::async_write() function will automatically
+    // serialize the data structure for us.
+    LOG(1, "INFO: Sending job #" << job->getId() << ".");
+    connection_.async_write(job,
+      boost::bind(&SendJobToWorkerOperation::handle_FinishOperation, this,
+      boost::asio::placeholders::error));
+  } else if (endpoint_iterator != boost::asio::ip::tcp::resolver::iterator()) {
+    // Try the next endpoint.
+    connection_.socket().close();
+    boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator;
+    connection_.socket().async_connect(endpoint,
+      boost::bind(&SendJobToWorkerOperation::handle_connect, this,
+      boost::asio::placeholders::error, ++endpoint_iterator));
+  } else {
+    // An error occurred. Log it and return. Since we are not starting a new
+    // operation the io_service will run out of work to do and the client will
+    // exit.
+    Exitflag = ErrorFlag;
+    ELOG(1, e.message());
+  }
+}
Index: src/Fragmentation/Automation/Operations/Servers/SendJobToWorkerOperation.hpp
===================================================================
--- src/Fragmentation/Automation/Operations/Servers/SendJobToWorkerOperation.hpp	(revision 50d0954c9954f199b1e23cb238803411a30172b2)
+++ src/Fragmentation/Automation/Operations/Servers/SendJobToWorkerOperation.hpp	(revision 50d0954c9954f199b1e23cb238803411a30172b2)
@@ -0,0 +1,57 @@
+/*
+ * SendJobToWorkerOperation.hpp
+ *
+ *  Created on: Feb 22, 2012
+ *      Author: heber
+ */
+
+#ifndef FRAGMENTCONTROLLER_SENDJOBTOWORKEROPERATION_HPP_
+#define FRAGMENTCONTROLLER_SENDJOBTOWORKEROPERATION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <boost/asio.hpp>
+#include <string>
+#include <vector>
+
+#include "Connection.hpp"
+
+#include "Jobs/FragmentJob.hpp"
+#include "Jobs/SystemCommandJob.hpp"
+#include "Operations/AsyncOperation.hpp"
+#include "WorkerAddress.hpp"
+
+class SendJobToWorkerOperation : public AsyncOperation  {
+public:
+  /// Constructor for class SendJobToWorkerOperation.
+  SendJobToWorkerOperation(Connection &_connection) :
+    AsyncOperation(std::string("sendjobtoworker"),_connection),
+    job( new SystemCommandJob(std::string("/bin/true"), std::string("donothing"), JobId::NoJob) )
+  {}
+  /// Destructor for class SendJobToWorkerOperation
+  ~SendJobToWorkerOperation() {}
+
+  /** Setter for job.
+   *
+   * @param _job job to take over internally
+   */
+  void setJob(FragmentJob::ptr &_job)
+  {
+    job.reset();
+    job = _job;
+  }
+
+public:
+  // virtual function pointer to the connection handler
+  virtual void handle_connect(const boost::system::error_code& e,
+      boost::asio::ip::tcp::resolver::iterator endpoint_iterator);
+
+private:
+  //!> job to send to
+  FragmentJob::ptr job;
+};
+
+#endif /* FRAGMENTCONTROLLER_SENDJOBTOWORKEROPERATION_HPP_ */
Index: src/Fragmentation/Automation/Operations/Servers/ShutdownWorkerOperation.cpp
===================================================================
--- src/Fragmentation/Automation/Operations/Servers/ShutdownWorkerOperation.cpp	(revision 50d0954c9954f199b1e23cb238803411a30172b2)
+++ src/Fragmentation/Automation/Operations/Servers/ShutdownWorkerOperation.cpp	(revision 50d0954c9954f199b1e23cb238803411a30172b2)
@@ -0,0 +1,46 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2011 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * ShutdownWorkerOperation.cpp
+ *
+ *  Created on: 11.12.2011
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+// boost asio needs specific operator new
+#include <boost/asio.hpp>
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "ShutdownWorkerOperation.hpp"
+
+#include <boost/bind.hpp>
+#include <iostream>
+#include "Connection.hpp" // Must come before boost/serialization headers.
+#include "CodePatterns/Info.hpp"
+#include "ControllerChoices.hpp"
+#include "Jobs/SystemCommandJob.hpp"
+#include "JobId.hpp"
+
+FragmentJob::ptr ShutdownWorkerOperation::NoJob(new SystemCommandJob(std::string(""), std::string(""), JobId::NoJob));
+
+/** Virtual internal function to give shutdown choice.
+ *
+ */
+void ShutdownWorkerOperation::internal()
+{
+  Info info(__FUNCTION__);
+
+  // send the NoJob
+  connection_.sync_write(NoJob);
+}
Index: src/Fragmentation/Automation/Operations/Servers/ShutdownWorkerOperation.hpp
===================================================================
--- src/Fragmentation/Automation/Operations/Servers/ShutdownWorkerOperation.hpp	(revision 50d0954c9954f199b1e23cb238803411a30172b2)
+++ src/Fragmentation/Automation/Operations/Servers/ShutdownWorkerOperation.hpp	(revision 50d0954c9954f199b1e23cb238803411a30172b2)
@@ -0,0 +1,45 @@
+/*
+ * ShutdownWorkerOperation.hpp
+ *
+ *  Created on: Mar 04, 2012
+ *      Author: heber
+ */
+
+#ifndef FRAGMENTCONTROLLER_SHUTDOWNWORKEROPERATION_HPP_
+#define FRAGMENTCONTROLLER_SHUTDOWNWORKEROPERATION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <boost/asio.hpp>
+#include <string>
+#include <vector>
+
+#include "Connection.hpp"
+
+#include "Jobs/FragmentJob.hpp"
+#include "Operations/SyncOperation.hpp"
+
+/** Synchronous operation that gives shutdown command.
+ *
+ */
+class ShutdownWorkerOperation : public SyncOperation  {
+public:
+  /// Constructor for class ShutdownWorkerOperation.
+  ShutdownWorkerOperation(Connection &_connection) :
+    SyncOperation(std::string("shutdown"),_connection) {}
+  /// Destructor for class ShutdownWorkerOperation
+  ~ShutdownWorkerOperation() {}
+
+public:
+  // function that implements read&writes in between connect/disconnect
+  virtual void internal();
+
+private:
+  //!> static entity to indicate to clients that the queue is empty.
+  static FragmentJob::ptr NoJob;
+};
+
+#endif /* FRAGMENTCONTROLLER_SHUTDOWNWORKEROPERATION_HPP_ */
