ETCH-243 Added log messages to the binding-cpp

- Added logger and some log messages
- Added runtime to different components

Change-Id: I68715800f8d6dab3cf65262debb0b7249b7c9724

git-svn-id: https://svn.apache.org/repos/asf/incubator/etch/trunk@1376584 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/binding-cpp/runtime/include/common/EtchObject.h b/binding-cpp/runtime/include/common/EtchObject.h
index 527b4a6..2c496c4 100644
--- a/binding-cpp/runtime/include/common/EtchObject.h
+++ b/binding-cpp/runtime/include/common/EtchObject.h
@@ -20,7 +20,8 @@
 #define __ETCHOBJECT_H__

 

 #include "capu/util/SmartPointer.h"

-#include "EtchConfig.h"

+#include "capu/container/List.h"

+#include "EtchError.h"

 

 class EtchObjectType;

 

@@ -47,20 +48,23 @@
    */

   virtual ~EtchObject();

 

-  /**
-  * Returns object type id of this type.
-  */
-  const EtchObjectType* GetObjectType() const;

+  /**

+  * Returns object type id of this type.

+  */

+  virtual const EtchObjectType* getObjectType() const;

 

   /**

-   * Returns object type id of this object.

+   * Returns true if the type hierarchy of this instance

+   * is from the given type.

+   * @param type to check

+   * @return true if the instance is compatible to the given type

    */

-  const EtchObjectType* getObjectType() const;

+   virtual capu::bool_t isInstanceOf(const EtchObjectType* type) const;

 

   /**

    * Returns hash code

    */

-  virtual capu::uint32_t getHashCode() const;
+  virtual capu::uint32_t getHashCode() const;

 

   /**

    * @return true if two object is equal

@@ -68,10 +72,19 @@
    */

   virtual capu::bool_t equals(const EtchObject * other) const;

 

-private:

+  protected:

+    /**

+     * Adds the object type to the type hierachy of this instance.

+     * @param type that should be added to type hierachy of this instance.

+     */

+    virtual status_t addObjectType(const EtchObjectType* type);

 

-  const EtchObjectType* mType;

+    // TODO remove me if object hierachy was refactored

+    virtual status_t setObjectType(const EtchObjectType* type);

 

+  private:

+    const EtchObjectType* mType;

+    capu::List<const EtchObjectType*> mTypes;

 };

 

 typedef capu::SmartPointer<EtchObject> EtchObjectPtr;

diff --git a/binding-cpp/runtime/include/common/EtchSocket.h b/binding-cpp/runtime/include/common/EtchSocket.h
index 0f13ff8..fc29a12 100644
--- a/binding-cpp/runtime/include/common/EtchSocket.h
+++ b/binding-cpp/runtime/include/common/EtchSocket.h
@@ -29,7 +29,7 @@
   /**
    * EtchObjectType for EtchSocket.
    */
-  static const EtchObjectType* TYPE();;
+  static const EtchObjectType* TYPE();
 
   /**
    * Default Constructor
diff --git a/binding-cpp/runtime/include/serialization/EtchAuthenticationExceptionSerializer.h b/binding-cpp/runtime/include/serialization/EtchAuthenticationExceptionSerializer.h
index 706962d..382fe18 100644
--- a/binding-cpp/runtime/include/serialization/EtchAuthenticationExceptionSerializer.h
+++ b/binding-cpp/runtime/include/serialization/EtchAuthenticationExceptionSerializer.h
@@ -28,6 +28,7 @@
 #include "serialization/EtchClass2TypeMap.h"
 #include "serialization/EtchValidatorString.h"
 
+class EtchRuntime;
 
 class EtchAuthenticationExceptionSerializer : public EtchImportExportHelper {
 public:
@@ -55,7 +56,7 @@
   static status_t Init(EtchType* type, EtchClass2TypeMap* class2type);
 
 private:
-
+  EtchRuntime* mRuntime;
   EtchField mField;
   EtchType* mType;
   const static EtchString& FIELD_NAME();
diff --git a/binding-cpp/runtime/include/serialization/EtchBinaryTaggedDataInput.h b/binding-cpp/runtime/include/serialization/EtchBinaryTaggedDataInput.h
index fedbede..97633eb 100644
--- a/binding-cpp/runtime/include/serialization/EtchBinaryTaggedDataInput.h
+++ b/binding-cpp/runtime/include/serialization/EtchBinaryTaggedDataInput.h
@@ -26,6 +26,7 @@
 #include "serialization/EtchValidatorString.h"
 #include "serialization/EtchValidatorObject.h"
 
+class EtchRuntime;
 
 class EtchBinaryTaggedDataInput : public EtchBinaryTaggedData, public EtchTaggedDataInput {
 public:
@@ -50,7 +51,7 @@
   status_t readMessage(capu::SmartPointer<EtchFlexBuffer> buf, capu::SmartPointer<EtchMessage> &message);
 
 private:
-
+  EtchRuntime* mRuntime;
   capu::SmartPointer<EtchFlexBuffer> mBuffer;
   capu::int32_t mLengthBudget;
   capu::SmartPointer<EtchValidator> mIntOrStrValidator;
@@ -82,6 +83,4 @@
   status_t readBytes(capu::int8_t*& array, capu::uint32_t &length);
 };
 
-
 #endif
-
diff --git a/binding-cpp/runtime/include/serialization/EtchBinaryTaggedDataOutput.h b/binding-cpp/runtime/include/serialization/EtchBinaryTaggedDataOutput.h
index ebf3627..f98e54b 100644
--- a/binding-cpp/runtime/include/serialization/EtchBinaryTaggedDataOutput.h
+++ b/binding-cpp/runtime/include/serialization/EtchBinaryTaggedDataOutput.h
@@ -26,6 +26,8 @@
 #include "serialization/EtchValidatorString.h"

 #include "serialization/EtchValidatorNone.h"

 

+class EtchRuntime;

+

 class EtchBinaryTaggedDataOutput : public EtchTaggedDataOutput, public EtchBinaryTaggedData {

 public:

 

@@ -35,7 +37,6 @@
    */

   static const EtchString& STRING_TYPE_AND_FIELD();
 

-

   /**

    * Constructs the BinaryTaggedDataInput with a null buffer.

    *
@@ -56,6 +57,7 @@
   status_t writeMessage(capu::SmartPointer<EtchMessage> msg, capu::SmartPointer<EtchFlexBuffer> buf);

 

 private:

+  EtchRuntime* mRuntime;

   capu::SmartPointer<EtchFlexBuffer> mBuffer;

   EtchLevel mLevel;

   capu::bool_t mStringTypeAndField;

diff --git a/binding-cpp/runtime/include/serialization/EtchDateSerializer.h b/binding-cpp/runtime/include/serialization/EtchDateSerializer.h
index 6661fba..20aeedd 100644
--- a/binding-cpp/runtime/include/serialization/EtchDateSerializer.h
+++ b/binding-cpp/runtime/include/serialization/EtchDateSerializer.h
@@ -27,6 +27,8 @@
 #include "serialization/EtchClass2TypeMap.h"
 #include "serialization/EtchValidatorLong.h"
 
+class EtchRuntime;
+
 class EtchDateSerializer : public EtchImportExportHelper {
 public:
 
@@ -59,7 +61,7 @@
   static status_t Init(EtchType* type, EtchClass2TypeMap* class2type);
 
 private:
-
+  EtchRuntime* mRuntime;
   EtchField mField;
   EtchType* mType;
   const static EtchString& FIELD_NAME();
diff --git a/binding-cpp/runtime/include/serialization/EtchHashTableSerializer.h b/binding-cpp/runtime/include/serialization/EtchHashTableSerializer.h
index 3023278..1102ed5 100644
--- a/binding-cpp/runtime/include/serialization/EtchHashTableSerializer.h
+++ b/binding-cpp/runtime/include/serialization/EtchHashTableSerializer.h
@@ -29,6 +29,8 @@
 #include "serialization/EtchValidatorObject.h"
 #include "serialization/EtchValidatorObject.h"
 
+class EtchRuntime;
+
 class EtchHashTableSerializer : public EtchImportExportHelper {
 public:
 
@@ -60,7 +62,7 @@
   static status_t Init(EtchType* type, EtchClass2TypeMap* class2type);
 
 private:
-
+  EtchRuntime* mRuntime;
   EtchField mField;
   EtchType* mType;
   const static EtchString& FIELD_NAME();
diff --git a/binding-cpp/runtime/include/serialization/EtchListSerializer.h b/binding-cpp/runtime/include/serialization/EtchListSerializer.h
index b1973fd..7bb47fc 100644
--- a/binding-cpp/runtime/include/serialization/EtchListSerializer.h
+++ b/binding-cpp/runtime/include/serialization/EtchListSerializer.h
@@ -28,6 +28,8 @@
 #include "serialization/EtchClass2TypeMap.h"
 #include "serialization/EtchValidatorObject.h"
 
+class EtchRuntime;
+
 class EtchListSerializer : public EtchImportExportHelper {
 public:
 
@@ -59,7 +61,7 @@
   static status_t Init(EtchType* type, EtchClass2TypeMap* class2type);
 
 private:
-
+  EtchRuntime* mRuntime;
   EtchType* mType;
   EtchField mField;
   const static EtchString& FIELD_NAME();
diff --git a/binding-cpp/runtime/include/serialization/EtchRuntimeExceptionSerializer.h b/binding-cpp/runtime/include/serialization/EtchRuntimeExceptionSerializer.h
index 6c8a437..7b8fefe 100644
--- a/binding-cpp/runtime/include/serialization/EtchRuntimeExceptionSerializer.h
+++ b/binding-cpp/runtime/include/serialization/EtchRuntimeExceptionSerializer.h
@@ -29,6 +29,8 @@
 #include "serialization/EtchClass2TypeMap.h"
 #include "serialization/EtchValidatorString.h"
 
+class EtchRuntime;
+
 class EtchRuntimeExceptionSerializer : public EtchImportExportHelper {
 public:
 
@@ -60,7 +62,7 @@
   static status_t Init(EtchType* type, EtchClass2TypeMap* class2type);
 
 private:
-
+  EtchRuntime* mRuntime;
   EtchType* mType;
   EtchField mField;
   const static EtchString& FIELD_NAME();
diff --git a/binding-cpp/runtime/include/serialization/EtchSetSerializer.h b/binding-cpp/runtime/include/serialization/EtchSetSerializer.h
index f345c7c..55f3249 100644
--- a/binding-cpp/runtime/include/serialization/EtchSetSerializer.h
+++ b/binding-cpp/runtime/include/serialization/EtchSetSerializer.h
@@ -29,6 +29,7 @@
 #include "serialization/EtchClass2TypeMap.h"
 #include "serialization/EtchValidatorObject.h"
 
+class EtchRuntime;
 
 class EtchSetSerializer : public EtchImportExportHelper {
 public:
@@ -55,7 +56,7 @@
   static status_t Init(EtchType* type, EtchClass2TypeMap* class2type);
 
 private:
-
+  EtchRuntime* mRuntime;
   EtchField mField;
   EtchType* mType;
   const static EtchString& FIELD_NAME();
diff --git a/binding-cpp/runtime/include/serialization/EtchValidator.h b/binding-cpp/runtime/include/serialization/EtchValidator.h
index e9e1654..87f2552 100644
--- a/binding-cpp/runtime/include/serialization/EtchValidator.h
+++ b/binding-cpp/runtime/include/serialization/EtchValidator.h
@@ -23,6 +23,7 @@
 #include "common/EtchObject.h"
 #include "common/EtchObjectType.h"
 #include "common/EtchError.h"
+#include "support/EtchRuntime.h"
 
 class EtchValidator : public EtchObject {
 public:
@@ -78,5 +79,60 @@
 
 };
 
+/**
+ * Etch validator chaches for each runtime
+ */
+class EtchValidatorCaches : public EtchRuntimeListener {
+public:
+  /**
+   * Validator cache
+   */
+  struct ValidatorCache {
+    capu::uint64_t id;
+    capu::SmartPointer<EtchValidator> validators[EtchValidator::MAX_CACHED];
+  };
+
+  /**
+   * Construct a new instance from the Validators class.
+   */
+  EtchValidatorCaches() {
+  }
+
+  /**
+   * Destructor
+   */
+  virtual ~EtchValidatorCaches() {
+    capu::List<ValidatorCache*>::Iterator iter = mValidatorsCache.begin();
+    while(iter.hasNext()) {
+      ValidatorCache* entry = NULL;
+      iter.next(&entry);
+      delete entry;
+    }
+    mValidatorsCache.clear();
+  }
+
+  status_t onRuntimeChanged(EtchRuntime* runtime) {
+    return ETCH_OK;
+  }
+
+  capu::SmartPointer<EtchValidator>* get(EtchRuntime* runtime) {
+    capu::List<ValidatorCache*>::Iterator iter = mValidatorsCache.begin();
+    while(iter.hasNext()) {
+      ValidatorCache* entry = NULL;
+      iter.next(&entry);
+      if(entry->id == runtime->getId()) {
+        return entry->validators;
+      }
+    }
+    ValidatorCache* entry = new ValidatorCache();
+    entry->id = runtime->getId();
+    mValidatorsCache.add(entry);
+    return entry->validators;
+  }
+
+private:
+  capu::List<ValidatorCache*> mValidatorsCache;
+};
+
 #endif /* ETCHVALIDATOR_H */
 
diff --git a/binding-cpp/runtime/include/serialization/EtchValidatorBoolean.h b/binding-cpp/runtime/include/serialization/EtchValidatorBoolean.h
index 07c0800..0bc8c38 100644
--- a/binding-cpp/runtime/include/serialization/EtchValidatorBoolean.h
+++ b/binding-cpp/runtime/include/serialization/EtchValidatorBoolean.h
@@ -18,10 +18,13 @@
 
 #ifndef __ETCHVALIDATORBOOLEAN_H__
 #define __ETCHVALIDATORBOOLEAN_H__
+
 #include "serialization/EtchTypeValidator.h"
 #include "common/EtchBool.h"
 #include "common/EtchNativeArray.h"
 
+class EtchRuntime;
+
 class EtchValidatorBoolean : public EtchTypeValidator {
 public:
 
@@ -56,7 +59,8 @@
   EtchValidatorBoolean(capu::uint32_t ndim);
 
 private:
-  static capu::SmartPointer<EtchValidator>* Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 };
 
 
diff --git a/binding-cpp/runtime/include/serialization/EtchValidatorByte.h b/binding-cpp/runtime/include/serialization/EtchValidatorByte.h
index a16979d..31d76fb 100644
--- a/binding-cpp/runtime/include/serialization/EtchValidatorByte.h
+++ b/binding-cpp/runtime/include/serialization/EtchValidatorByte.h
@@ -18,6 +18,7 @@
 
 #ifndef __ETCHVALIDATORBYTE_H__
 #define __ETCHVALIDATORBYTE_H__
+
 #include "serialization/EtchTypeValidator.h"
 #include "common/EtchByte.h"
 #include "common/EtchShort.h"
@@ -27,6 +28,8 @@
 #include "common/EtchNativeArray.h"
 #include "capu/os/NumericLimits.h"
 
+class EtchRuntime;
+
 class EtchValidatorByte : public EtchTypeValidator {
 public:
 
@@ -61,7 +64,8 @@
   EtchValidatorByte(capu::uint32_t ndim);
 
 private:
-  static capu::SmartPointer<EtchValidator>* Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 
 };
 
diff --git a/binding-cpp/runtime/include/serialization/EtchValidatorCustom.h b/binding-cpp/runtime/include/serialization/EtchValidatorCustom.h
index 0554b2d..4da8c7c 100644
--- a/binding-cpp/runtime/include/serialization/EtchValidatorCustom.h
+++ b/binding-cpp/runtime/include/serialization/EtchValidatorCustom.h
@@ -116,8 +116,7 @@
   EtchValidatorCustom(const EtchObjectType *type, capu::uint32_t ndim, capu::bool_t sub);
 
 private:
-
-  static EtchHashTable<EtchValidatorCustomKey, capu::SmartPointer<EtchValidator> >& Validators();
+  static EtchHashTable<EtchValidatorCustomKey, capu::SmartPointer<EtchValidator> >& Validators(EtchRuntime* runtime);
 };
 
 #endif /* ETCHVALIDATORCUSTOM_H */
diff --git a/binding-cpp/runtime/include/serialization/EtchValidatorDouble.h b/binding-cpp/runtime/include/serialization/EtchValidatorDouble.h
index 997652f..b630c88 100644
--- a/binding-cpp/runtime/include/serialization/EtchValidatorDouble.h
+++ b/binding-cpp/runtime/include/serialization/EtchValidatorDouble.h
@@ -25,6 +25,8 @@
 #include "capu/os/NumericLimits.h"
 #include "common/EtchNativeArray.h"
 
+class EtchRuntime;
+
 class EtchValidatorDouble : public EtchTypeValidator {
 public:
 
@@ -59,10 +61,9 @@
   EtchValidatorDouble(capu::uint32_t ndim);
 
 private:
-  static capu::SmartPointer<EtchValidator>* Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 
 };
 
-
 #endif /* __ETCHVALIDATORDOUBLE_H__ */
-
diff --git a/binding-cpp/runtime/include/serialization/EtchValidatorFloat.h b/binding-cpp/runtime/include/serialization/EtchValidatorFloat.h
index 575a0ad..5006f0f 100644
--- a/binding-cpp/runtime/include/serialization/EtchValidatorFloat.h
+++ b/binding-cpp/runtime/include/serialization/EtchValidatorFloat.h
@@ -18,12 +18,15 @@
 
 #ifndef __ETCHVALIDATORFLOAT_H__
 #define __ETCHVALIDATORFLOAT_H__
+
 #include "serialization/EtchTypeValidator.h"
 #include "common/EtchDouble.h"
 #include "common/EtchFloat.h"
 #include "serialization/EtchTypeCodes.h"
 #include "common/EtchNativeArray.h"
 
+class EtchRuntime;
+
 class EtchValidatorFloat : public EtchTypeValidator {
 public:
 
@@ -58,7 +61,8 @@
   EtchValidatorFloat(capu::uint32_t ndim);
 
 private:
-  static capu::SmartPointer<EtchValidator>* Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 
 };
 
diff --git a/binding-cpp/runtime/include/serialization/EtchValidatorInt.h b/binding-cpp/runtime/include/serialization/EtchValidatorInt.h
index 937ed05..0132bd6 100644
--- a/binding-cpp/runtime/include/serialization/EtchValidatorInt.h
+++ b/binding-cpp/runtime/include/serialization/EtchValidatorInt.h
@@ -28,6 +28,8 @@
 #include "common/EtchNativeArray.h"
 #include "capu/os/NumericLimits.h"
 
+class EtchRuntime;
+
 class EtchValidatorInt : public EtchTypeValidator {
 public:
 
@@ -62,7 +64,8 @@
   EtchValidatorInt(capu::uint32_t ndim);
 
 private:
-  static capu::SmartPointer<EtchValidator>* Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 
 };
 
diff --git a/binding-cpp/runtime/include/serialization/EtchValidatorLong.h b/binding-cpp/runtime/include/serialization/EtchValidatorLong.h
index 6b4a328..c557cc8 100644
--- a/binding-cpp/runtime/include/serialization/EtchValidatorLong.h
+++ b/binding-cpp/runtime/include/serialization/EtchValidatorLong.h
@@ -27,6 +27,8 @@
 #include "common/EtchNativeArray.h"
 #include "capu/os/NumericLimits.h"
 
+class EtchRuntime;
+
 class EtchValidatorLong : public EtchTypeValidator {
 public:
 
@@ -62,7 +64,8 @@
   EtchValidatorLong(capu::uint32_t ndim);
 
 private:
-  static capu::SmartPointer<EtchValidator>* Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 
 };
 
diff --git a/binding-cpp/runtime/include/serialization/EtchValidatorNone.h b/binding-cpp/runtime/include/serialization/EtchValidatorNone.h
index e068994..bac40b2 100644
--- a/binding-cpp/runtime/include/serialization/EtchValidatorNone.h
+++ b/binding-cpp/runtime/include/serialization/EtchValidatorNone.h
@@ -22,6 +22,8 @@
 #include "serialization/EtchValidator.h"
 #include "serialization/EtchBinaryTaggedData.h"
 
+class EtchRuntime;
+
 class EtchValidatorNone : public EtchValidator {
 public:
   virtual ~EtchValidatorNone();
@@ -52,7 +54,8 @@
   EtchValidatorNone();
 
 private:
-  static capu::SmartPointer<EtchValidator>& Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 
 };
 
diff --git a/binding-cpp/runtime/include/serialization/EtchValidatorObject.h b/binding-cpp/runtime/include/serialization/EtchValidatorObject.h
index 96dc2d6..fdd27e6 100644
--- a/binding-cpp/runtime/include/serialization/EtchValidatorObject.h
+++ b/binding-cpp/runtime/include/serialization/EtchValidatorObject.h
@@ -22,6 +22,8 @@
 
 #include "serialization/EtchTypeValidator.h"
 
+class EtchRuntime;
+
 class EtchValidatorObject : public EtchTypeValidator {
 public:
 
@@ -56,7 +58,8 @@
   EtchValidatorObject(capu::uint32_t ndim);
 
 private:
-  static capu::SmartPointer<EtchValidator>* Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 
 };
 
diff --git a/binding-cpp/runtime/include/serialization/EtchValidatorRuntimeException.h b/binding-cpp/runtime/include/serialization/EtchValidatorRuntimeException.h
index 44dee58..797885e 100644
--- a/binding-cpp/runtime/include/serialization/EtchValidatorRuntimeException.h
+++ b/binding-cpp/runtime/include/serialization/EtchValidatorRuntimeException.h
@@ -21,6 +21,8 @@
 #include "serialization/EtchValidator.h"
 #include "common/EtchRuntimeException.h"
 
+class EtchRuntime;
+
 class EtchValidatorRuntimeException : public EtchValidator {
 public:
 
@@ -55,7 +57,8 @@
   EtchValidatorRuntimeException();
 
 private:
-  static capu::SmartPointer<EtchValidator>& Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 };
 
 #endif
diff --git a/binding-cpp/runtime/include/serialization/EtchValidatorShort.h b/binding-cpp/runtime/include/serialization/EtchValidatorShort.h
index 4607877..50df7aa 100644
--- a/binding-cpp/runtime/include/serialization/EtchValidatorShort.h
+++ b/binding-cpp/runtime/include/serialization/EtchValidatorShort.h
@@ -28,6 +28,8 @@
 #include "common/EtchNativeArray.h"
 #include "capu/os/NumericLimits.h"
 
+class EtchRuntime;
+
 class EtchValidatorShort : public EtchTypeValidator {
 public:
 
@@ -63,8 +65,8 @@
   EtchValidatorShort(capu::uint32_t ndim);
 
 private:
-
-  static capu::SmartPointer<EtchValidator>* Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 
 };
 
diff --git a/binding-cpp/runtime/include/serialization/EtchValidatorString.h b/binding-cpp/runtime/include/serialization/EtchValidatorString.h
index 89b8874..93d6403 100644
--- a/binding-cpp/runtime/include/serialization/EtchValidatorString.h
+++ b/binding-cpp/runtime/include/serialization/EtchValidatorString.h
@@ -23,6 +23,8 @@
 #include "common/EtchString.h"
 #include "common/EtchNativeArray.h"
 
+class EtchRuntime;
+
 class EtchValidatorString : public EtchTypeValidator {
 public:
 
@@ -57,7 +59,8 @@
   EtchValidatorString(capu::uint32_t ndim);
 
 private:
-  static capu::SmartPointer<EtchValidator>* Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 
 };
 
diff --git a/binding-cpp/runtime/include/serialization/EtchValidatorStructValue.h b/binding-cpp/runtime/include/serialization/EtchValidatorStructValue.h
index bd11d3e..232fc67 100644
--- a/binding-cpp/runtime/include/serialization/EtchValidatorStructValue.h
+++ b/binding-cpp/runtime/include/serialization/EtchValidatorStructValue.h
@@ -24,6 +24,7 @@
 #include "serialization/EtchType.h"
 #include "serialization/EtchStructValue.h"
 
+class EtchRuntime;
 
 class EtchValidatorStructValue : public EtchTypeValidator {
 public:
@@ -62,7 +63,7 @@
   EtchValidatorStructValue(EtchType* type, capu::uint32_t ndim);
 
 private:
-
+  EtchRuntime* mRuntime;
   EtchType* mType;
 
 };
diff --git a/binding-cpp/runtime/include/support/EtchDefaultServerFactory.h b/binding-cpp/runtime/include/support/EtchDefaultServerFactory.h
index f4b32bb..e306dda 100644
--- a/binding-cpp/runtime/include/support/EtchDefaultServerFactory.h
+++ b/binding-cpp/runtime/include/support/EtchDefaultServerFactory.h
@@ -1,4 +1,3 @@
-
 /* $Id$
  *
  * Licensed to the Apache Software Foundation (ASF) under one
diff --git a/binding-cpp/runtime/include/support/EtchRemoteBase.h b/binding-cpp/runtime/include/support/EtchRemoteBase.h
index 1a4ab91..e3f3d02 100644
--- a/binding-cpp/runtime/include/support/EtchRemoteBase.h
+++ b/binding-cpp/runtime/include/support/EtchRemoteBase.h
@@ -26,6 +26,8 @@
 #include "support/EtchDeliveryService.h"
 #include "serialization/EtchValueFactory.h"
 
+class EtchRuntime;
+
 /**
  * Base class for call to message translators.
  */
@@ -185,6 +187,7 @@
   status_t stopAndWaitDown(capu::int32_t maxDelay);
 
 private:
+  EtchRuntime* mRuntime;
   EtchDeliveryService * mSvc;
   EtchValueFactory* mVf;
 };
diff --git a/binding-cpp/runtime/include/support/EtchRuntime.h b/binding-cpp/runtime/include/support/EtchRuntime.h
index c92902e..818ab2b 100644
--- a/binding-cpp/runtime/include/support/EtchRuntime.h
+++ b/binding-cpp/runtime/include/support/EtchRuntime.h
@@ -20,6 +20,7 @@
 #include "capu/os/Mutex.h"
 #include "capu/container/List.h"
 #include "common/EtchError.h"
+#include "util/EtchLogger.h"
 
 class EtchRuntime;
 
@@ -84,9 +85,28 @@
    */
   status_t shutdown();
 
+  /**
+   * Sets Logger
+   * @param logger
+   */
+  status_t setLogger(EtchLogger* logger);
+
+  /**
+   * Gets Logger
+   * @return logger if exists
+   */
+  EtchLogger* getLogger();
+
+  /**
+   * TODO: Remove this after refactoring! A instance to the runtime shoulde be injected to each class
+   */
+  static EtchRuntime* getRuntime();
+
 private:
+  static EtchRuntime* sRuntime;
   static capu::uint64_t sId;
   capu::uint64_t mId;
+  EtchLogger* mLogger;
   capu::bool_t mIsClosed;
   capu::Mutex mMutex;
   capu::List<EtchRuntimeListener*> mListeners;
@@ -100,5 +120,6 @@
    * Fire onRuntimeChanged callback
    */
   status_t fireOnRuntimeChanged();
+
 };
 #endif /* ETCHRUNTIME_H */
diff --git a/binding-cpp/runtime/include/support/EtchStubBase.h b/binding-cpp/runtime/include/support/EtchStubBase.h
index 3f51d17..613e8ca 100644
--- a/binding-cpp/runtime/include/support/EtchStubBase.h
+++ b/binding-cpp/runtime/include/support/EtchStubBase.h
@@ -88,6 +88,8 @@
 class EtchStubPoolRunnable : public EtchPoolRunnable {
 public:
 
+  virtual ~EtchStubPoolRunnable() {}
+
   /**
    * Constructs the StubPoolRunnable.
    * @param stub the stub of this service
diff --git a/binding-cpp/runtime/include/transport/EtchConnection.h b/binding-cpp/runtime/include/transport/EtchConnection.h
index 09c664a..d60e44e 100644
--- a/binding-cpp/runtime/include/transport/EtchConnection.h
+++ b/binding-cpp/runtime/include/transport/EtchConnection.h
@@ -40,6 +40,11 @@
    */
   EtchConnection();
 
+  /**
+   * Destructor
+   */
+  virtual ~EtchConnection() {}
+
   /** Source query to get the local address. */
   static const EtchString LOCAL_ADDRESS;
 
diff --git a/binding-cpp/runtime/include/transport/EtchDefaultDeliveryService.h b/binding-cpp/runtime/include/transport/EtchDefaultDeliveryService.h
index deaaeab..ffad1a6 100644
--- a/binding-cpp/runtime/include/transport/EtchDefaultDeliveryService.h
+++ b/binding-cpp/runtime/include/transport/EtchDefaultDeliveryService.h
@@ -31,6 +31,8 @@
 #include "util/EtchURL.h"
 #include "util/EtchResources.h"
 
+class EtchRuntime;
+
 /**
  * Default implementation of DeliveryService.
  */
@@ -128,6 +130,7 @@
   virtual status_t endcall(EtchMailbox* mb, EtchType* responseType, capu::SmartPointer<EtchObject>& result);
 
 private:
+  EtchRuntime* mRuntime;
   status_t waitUp(capu::int32_t maxDelay);
   status_t waitDown(capu::int32_t maxDelay);
   void init(EtchURL* url);
diff --git a/binding-cpp/runtime/include/transport/EtchMessagizer.h b/binding-cpp/runtime/include/transport/EtchMessagizer.h
index 696448d..333d010 100644
--- a/binding-cpp/runtime/include/transport/EtchMessagizer.h
+++ b/binding-cpp/runtime/include/transport/EtchMessagizer.h
@@ -35,6 +35,7 @@
 #include "util/EtchResources.h"
 #include "util/EtchURL.h"
 
+class EtchRuntime;
 
 class EtchMessagizer : public EtchSessionPacket, public EtchTransportMessage {
 public:
@@ -117,6 +118,7 @@
   status_t sessionPacket(capu::SmartPointer<EtchWho> sender, capu::SmartPointer<EtchFlexBuffer> buf);
 
 private:
+  EtchRuntime* mRuntime;
   static capu::Mutex mutex;
   EtchTransportPacket* mTransport;
   EtchTaggedDataInput* mTdi;
diff --git a/binding-cpp/runtime/include/transport/EtchPacketizer.h b/binding-cpp/runtime/include/transport/EtchPacketizer.h
index f656d5b..e80d0d4 100644
--- a/binding-cpp/runtime/include/transport/EtchPacketizer.h
+++ b/binding-cpp/runtime/include/transport/EtchPacketizer.h
@@ -18,6 +18,7 @@
 
 #ifndef __ETCHPACKETIZER_H__
 #define __ETCHPACKETIZER_H__
+
 #include "capu/util/SmartPointer.h"
 #include "transport/EtchSessionData.h"
 #include "transport/EtchTransportPacket.h"
@@ -28,6 +29,8 @@
 #include "util/EtchResources.h"
 #include "common/EtchString.h"
 
+class EtchRuntime;
+
 /**
  * Packetizes a stream data source. Reads a packet header:
  * a 32-bit flag and a 32-bit length, both big-endian, verifies
@@ -135,6 +138,7 @@
   status_t sessionNotify(capu::SmartPointer<EtchObject> event);
 
 private:
+  EtchRuntime* mRuntime;
 
   EtchTransportData* mTransport;
 
diff --git a/binding-cpp/runtime/include/transport/EtchPlainMailboxManager.h b/binding-cpp/runtime/include/transport/EtchPlainMailboxManager.h
index 21041b6..272c7e4 100644
--- a/binding-cpp/runtime/include/transport/EtchPlainMailboxManager.h
+++ b/binding-cpp/runtime/include/transport/EtchPlainMailboxManager.h
@@ -20,12 +20,15 @@
 #define __ETCHPLAINMAILBOXMANAGER_H__
 
 #include "capu/os/Mutex.h"
+
+#include "common/EtchString.h"
+#include "transport/EtchMailboxManager.h"
+#include "support/EtchPlainMailbox.h"
 #include "util/EtchURL.h"
 #include "util/EtchResources.h"
 #include "util/EtchIdGenerator.h"
-#include "transport/EtchMailboxManager.h"
-#include "support/EtchPlainMailbox.h"
-#include "common/EtchString.h"
+
+class EtchRuntime;
 
 class EtchPlainMailboxManager : public EtchMailboxManager {
 public:
@@ -102,6 +105,7 @@
 
 
 private:
+  EtchRuntime* mRuntime;
   EtchSessionMessage* mSession;
   EtchTransportMessage* mTransport;
   capu::bool_t mUp;
diff --git a/binding-cpp/runtime/include/transport/EtchTcpConnection.h b/binding-cpp/runtime/include/transport/EtchTcpConnection.h
index 71162b3..5a55604 100644
--- a/binding-cpp/runtime/include/transport/EtchTcpConnection.h
+++ b/binding-cpp/runtime/include/transport/EtchTcpConnection.h
@@ -25,13 +25,15 @@
 #include "common/EtchError.h"

 #include "common/EtchString.h"

 #include "common/EtchSocket.h"
-#include "util/EtchURL.h"

-#include "util/EtchResources.h"

+#include "support/EtchRuntime.h"

 #include "transport/EtchConnection.h"
 #include "transport/EtchTransportData.h"

 #include "transport/EtchFlexBuffer.h"

 #include "transport/EtchSessionData.h"

 #include "transport/EtchTcpOption.h"

+#include "util/EtchURL.h"

+#include "util/EtchResources.h"

+#include "util/EtchLogger.h"

 
 class EtchRuntime;
 

diff --git a/binding-cpp/runtime/include/transport/EtchTcpListener.h b/binding-cpp/runtime/include/transport/EtchTcpListener.h
index f5fb08a..f57fff6 100644
--- a/binding-cpp/runtime/include/transport/EtchTcpListener.h
+++ b/binding-cpp/runtime/include/transport/EtchTcpListener.h
@@ -19,20 +19,23 @@
 

 #ifndef __ETCHTCPLISTENER_H__

 #define __ETCHTCPLISTENER_H__

+

+#include "capu/os/ServerSocket.h"

+#include "capu/os/Socket.h"

+#include "capu/util/Runnable.h"

+#include "capu/util/SmartPointer.h"

 
 #include "common/EtchError.h"

 #include "common/EtchObject.h"

-#include "capu/util/SmartPointer.h"

+#include "common/EtchSocket.h"

+#include "common/EtchServerSocket.h"

 #include "transport/EtchTransport.h"

 #include "transport/EtchSessionListener.h"

-#include "common/EtchSocket.h"

 #include "transport/EtchConnection.h"

-#include "capu/os/ServerSocket.h"

-#include "capu/os/Socket.h"

-#include "common/EtchServerSocket.h"

 #include "util/EtchURL.h"

 #include "util/EtchResources.h"

-#include "capu/util/Runnable.h"
+

+class EtchRuntime;

 

 /**

  * Implementation of a connection which handles a socket listener.

@@ -101,6 +104,7 @@
   virtual status_t readSocket();

 

 private:

+  EtchRuntime* mRuntime;

   EtchServerSocket* mSocket;

   capu::uint16_t mPort;

   capu::uint8_t mBackLog;

diff --git a/binding-cpp/runtime/include/util/EtchLogger.h b/binding-cpp/runtime/include/util/EtchLogger.h
new file mode 100644
index 0000000..f4ba1b8
--- /dev/null
+++ b/binding-cpp/runtime/include/util/EtchLogger.h
@@ -0,0 +1,30 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __ETCHLOGGER_H__
+#define __ETCHLOGGER_H__
+
+#include "capu/util/Appender.h"
+#include "capu/util/Logger.h"
+#include "capu/util/ConsoleAppender.h"
+
+typedef capu::Appender EtchAppender;
+typedef capu::ConsoleAppender EtchConsoleAppender;
+typedef capu::Logger EtchLogger;
+
+#endif /* ETCHLOGGER_H */
diff --git a/binding-cpp/runtime/lib/capu/modules/capu/CMakeLists.txt b/binding-cpp/runtime/lib/capu/modules/capu/CMakeLists.txt
index 763f0e2..d56ea2e 100644
--- a/binding-cpp/runtime/lib/capu/modules/capu/CMakeLists.txt
+++ b/binding-cpp/runtime/lib/capu/modules/capu/CMakeLists.txt
@@ -42,9 +42,6 @@
 ADD_FILE(os/Memory SOURCE_GROUP arch_source_group)
 ADD_FILE(os/Math SOURCE_GROUP arch_source_group)
 ADD_FILE(util/SmartPointer)
-ADD_FILE(util/Logger)
-ADD_FILE(util/Appender)
-ADD_FILE(util/ConsoleAppender)
 ADD_FILE(util/Runnable)
 ADD_FILE(util/Traits)
 ADD_FILE(util/ThreadPool)
@@ -58,6 +55,17 @@
 
 SOURCE_GROUP(${TARGET_OS}_${TARGET_ARCH} FILES  ${arch_source_group})
 
+SET(ENABLE_LOGGING 1 CACHE BOOL "Enable Capu Logging")
+IF(${ENABLE_LOGGING})
+  ADD_DEFINITIONS(-DCAPU_LOGGING_ENABLED=1)
+  ADD_FILE(util/Logger)
+  ADD_FILE(util/Appender)
+  ADD_FILE(util/ConsoleAppender)
+ELSE()
+  ADD_DEFINITIONS(-DCAPU_LOGGING_ENABLED=0)
+  MESSAGE (FATAL_ERROR "Disabling Logger is not supported yet")
+ENDIF()
+
 IF("${TARGET_OS}" STREQUAL "Integrity")
 	ADD_FILE(os/Integrity/global_table)
 	ADD_LINKER_FLAG("${CMAKE_SOURCE_DIR}/modules/capu/res/kernel_default.ld")
diff --git a/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/List.h b/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/List.h
index 127d33c..8a9552a 100644
--- a/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/List.h
+++ b/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/List.h
@@ -192,7 +192,7 @@
      * returns an iterator pointing to the beginning of list
      * @return iterator
      */
-    Iterator begin();
+    Iterator begin() const;
 
     /**
      * finds the index of given element in the link list
@@ -533,7 +533,7 @@
   }
 
   template <class T, class C>
-  typename List<T, C>::Iterator List<T, C>::begin() {
+  typename List<T, C>::Iterator List<T, C>::begin() const {
     return ListIterator(mHead);
   }
 
diff --git a/binding-cpp/runtime/lib/capu/modules/capu/include/capu/os/arch/File.inc b/binding-cpp/runtime/lib/capu/modules/capu/include/capu/os/arch/File.inc
index 31ff7e3..04f6898 100644
--- a/binding-cpp/runtime/lib/capu/modules/capu/include/capu/os/arch/File.inc
+++ b/binding-cpp/runtime/lib/capu/modules/capu/include/capu/os/arch/File.inc
@@ -21,7 +21,7 @@
 #elif OS_WINDOWS
     #include "Windows/File.inc"
 #elif defined(OS_INTEGRITY)
-    #include "Linux/Memory.inc"
+    #include "Linux/File.inc"
 #elif defined(OS_QNX)
-    #include "Linux/Memory.inc"
+    #include "Linux/File.inc"
 #endif
diff --git a/binding-cpp/runtime/lib/capu/modules/capu/include/capu/util/Logger.h b/binding-cpp/runtime/lib/capu/modules/capu/include/capu/util/Logger.h
index cb84a51..1ec551e 100644
--- a/binding-cpp/runtime/lib/capu/modules/capu/include/capu/util/Logger.h
+++ b/binding-cpp/runtime/lib/capu/modules/capu/include/capu/util/Logger.h
@@ -24,12 +24,21 @@
 #include "capu/os/StringUtils.h"
 #include <stdarg.h>
 
-#define CAPU_LOG(logger, level, tag, format, ...) logger->log(level, tag, __FILE__, __LINE__, format, ##__VA_ARGS__)
-#define CAPU_LOG_TRACE(logger, tag, format, ...) logger->log(capu::CLL_TRACE, tag, __FILE__, __LINE__, format, ##__VA_ARGS__)
-#define CAPU_LOG_DEBUG(logger, tag, format, ...) logger->log(capu::CLL_DEBUG, tag, __FILE__, __LINE__, format, ##__VA_ARGS__)
-#define CAPU_LOG_INFO(logger, tag, format, ...) logger->log(capu::CLL_INFO, tag, __FILE__, __LINE__, format, ##__VA_ARGS__)
-#define CAPU_LOG_WARN(logger, tag, format, ...) logger->log(capu::CLL_WARN, tag, __FILE__, __LINE__, format, ##__VA_ARGS__)
-#define CAPU_LOG_ERROR(logger, tag, format, ...) logger->log(capu::CLL_ERROR, tag, __FILE__, __LINE__, format, ##__VA_ARGS__)
+#if CAPU_LOGGING_ENABLED
+#define CAPU_LOG(logger, level, tag, format, ...) if(logger != NULL) logger->log(level, tag, __FILE__, __LINE__, format, ##__VA_ARGS__)
+#define CAPU_LOG_TRACE(logger, tag, format, ...) if(logger != NULL) logger->log(capu::CLL_TRACE, tag, __FILE__, __LINE__, format, ##__VA_ARGS__)
+#define CAPU_LOG_DEBUG(logger, tag, format, ...) if(logger != NULL) logger->log(capu::CLL_DEBUG, tag, __FILE__, __LINE__, format, ##__VA_ARGS__)
+#define CAPU_LOG_INFO(logger, tag, format, ...) if(logger != NULL) logger->log(capu::CLL_INFO, tag, __FILE__, __LINE__, format, ##__VA_ARGS__)
+#define CAPU_LOG_WARN(logger, tag, format, ...) if(logger != NULL) logger->log(capu::CLL_WARN, tag, __FILE__, __LINE__, format, ##__VA_ARGS__)
+#define CAPU_LOG_ERROR(logger, tag, format, ...) if(logger != NULL) logger->log(capu::CLL_ERROR, tag, __FILE__, __LINE__, format, ##__VA_ARGS__)
+#else
+#define CAPU_LOG(logger, level, tag, format, ...)
+#define CAPU_LOG_TRACE(logger, tag, format, ...)
+#define CAPU_LOG_DEBUG(logger, tag, format, ...)
+#define CAPU_LOG_INFO(logger, tag, format, ...)
+#define CAPU_LOG_WARN(logger, tag, format, ...)
+#define CAPU_LOG_ERROR(logger, tag, format, ...)
+#endif
 
 namespace capu {
 
diff --git a/binding-cpp/runtime/lib/capu/modules/capu/src/util/Logger.cpp b/binding-cpp/runtime/lib/capu/modules/capu/src/util/Logger.cpp
index 07585cc..d481f9c 100644
--- a/binding-cpp/runtime/lib/capu/modules/capu/src/util/Logger.cpp
+++ b/binding-cpp/runtime/lib/capu/modules/capu/src/util/Logger.cpp
@@ -42,13 +42,13 @@
       delete mThreadId;
     }
     if(mTag != NULL) {
-      delete mTag;
+      delete [] mTag;
     }
     if(mFile != NULL) {
-      delete mFile;
+      delete [] mFile;
     }
     if(mMessage != NULL) {
-      delete mMessage;
+      delete [] mMessage;
     }
   }
 
@@ -98,7 +98,7 @@
     return CAPU_OK;
   }
 
-  status_t Logger::vlog(LoggerLevel level, const char *tag, const char *file, int32_t line,const char *msgFormat, va_list args) {
+  status_t Logger::vlog(LoggerLevel level, const char *tag, const char *file, int32_t line, const char *msgFormat, va_list args) {
 
     LoggerMessage *msg = new LoggerMessage();
     msg->setId(mId);
@@ -113,7 +113,7 @@
     char* buffer = new char[size + 1];
     StringUtils::Vsprintf(buffer, size + 1, msgFormat, args);
     msg->setMessage(buffer);
-    delete buffer;
+    delete [] buffer;
 
     // log message
     for(int i = 0; i < LOGGER_APPENDER_MAX; i++) {
diff --git a/binding-cpp/runtime/lib/capu/modules/capu/test/os/FileTest.cpp b/binding-cpp/runtime/lib/capu/modules/capu/test/os/FileTest.cpp
index d8a6ecf..18a7f40 100644
--- a/binding-cpp/runtime/lib/capu/modules/capu/test/os/FileTest.cpp
+++ b/binding-cpp/runtime/lib/capu/modules/capu/test/os/FileTest.cpp
@@ -25,9 +25,9 @@
   EXPECT_FALSE(f1->isOpen());
   delete f1;
 
-  capu::File* f2 = new capu::File("test.txt", "w");
-  EXPECT_TRUE(f1 != NULL);
-  EXPECT_TRUE(f1->isOpen());
+  capu::File* f2 = new capu::File("test.txt", "w+");
+  EXPECT_TRUE(f2 != NULL);
+  EXPECT_TRUE(f2->isOpen());
   delete f2;
 }
 
@@ -37,7 +37,7 @@
   EXPECT_FALSE(f1->isOpen());
   delete f1;
 
-  capu::File* f2 = new capu::File("test.txt", "w");
+  capu::File* f2 = new capu::File("test.txt", "w+");
   EXPECT_TRUE(f2 != NULL);
   EXPECT_TRUE(f2->isOpen());
   delete f2;
@@ -47,7 +47,7 @@
   char buf1[15] = "This is a test";
   capu::status_t status;
 
-  capu::File* f1 = new capu::File("test.txt", "w");
+  capu::File* f1 = new capu::File("test.txt", "w+");
   EXPECT_TRUE(f1 != NULL);
   EXPECT_TRUE(f1->isOpen());
 
@@ -81,7 +81,7 @@
   delete f1;
 
   // write data
-  capu::File* f2 = new capu::File("test.txt", "w");
+  capu::File* f2 = new capu::File("test.txt", "w+");
   EXPECT_TRUE(f2 != NULL);
   EXPECT_TRUE(f2->isOpen());
 
diff --git a/binding-cpp/runtime/src/main/common/EtchObject.cpp b/binding-cpp/runtime/src/main/common/EtchObject.cpp
index f5c1732..73c3713 100644
--- a/binding-cpp/runtime/src/main/common/EtchObject.cpp
+++ b/binding-cpp/runtime/src/main/common/EtchObject.cpp
@@ -17,32 +17,56 @@
  */

 

 #include "common/EtchObject.h"

-#include "common/EtchObjectType.h"
-
-const EtchObjectType* EtchObject::TYPE() {
-  const static EtchObjectType TYPE(EOTID_OBJECT, NULL);
-  return &TYPE;
-}
-
-EtchObject::EtchObject() {
-}
+#include "common/EtchObjectType.h"

 

-EtchObject::EtchObject(const EtchObjectType* type){
-  mType = type;
+const EtchObjectType* EtchObject::TYPE() {

+  const static EtchObjectType TYPE(EOTID_OBJECT, NULL);

+  return &TYPE;

 }

 

-const EtchObjectType* EtchObject::getObjectType() const{
-  return mType;
+EtchObject::EtchObject()

+  : mType(TYPE()) {

+  addObjectType(TYPE());

 }

 

-EtchObject::~EtchObject() {
+EtchObject::EtchObject(const EtchObjectType* type){

+  mType = type;

 }

 

-capu::uint32_t EtchObject::getHashCode() const{
-  return (capu::uint32_t) this;
+EtchObject::~EtchObject() {

 }

 

-capu::bool_t EtchObject::equals(const EtchObject* other) const{
+const EtchObjectType* EtchObject::getObjectType() const{

+  return mType;

+}

+

+capu::bool_t EtchObject::isInstanceOf(const EtchObjectType* type) const {

+  capu::List<const EtchObjectType*>::Iterator iter = mTypes.begin();

+  while(iter.hasNext()) {

+    const EtchObjectType* t = NULL;

+    iter.next(&t);

+    if(t->equals(type)) {

+      return true;

+    }

+  }

+  return false;

+}

+

+capu::uint32_t EtchObject::getHashCode() const{

+  return (capu::uint32_t) this;

+}

+

+capu::bool_t EtchObject::equals(const EtchObject* other) const{

   return (other == this);

 }

 

+status_t EtchObject::addObjectType(const EtchObjectType* type) {

+  mTypes.add(type);

+  return ETCH_OK;

+}

+

+status_t EtchObject::setObjectType(const EtchObjectType* type) {

+  mType = type;

+  return ETCH_OK;

+}

+

diff --git a/binding-cpp/runtime/src/main/serialization/EtchAuthenticationExceptionSerializer.cpp b/binding-cpp/runtime/src/main/serialization/EtchAuthenticationExceptionSerializer.cpp
index 9b8e92d..9b53243 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchAuthenticationExceptionSerializer.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchAuthenticationExceptionSerializer.cpp
@@ -17,6 +17,9 @@
  */
 
 #include "serialization/EtchAuthenticationExceptionSerializer.h"
+#include "support/EtchRuntime.h"
+
+static const char* TAG = "EtchAuthenticationExceptionSerializer";
 
 const EtchString& EtchAuthenticationExceptionSerializer::FIELD_NAME() {
   static const EtchString name("msg");
@@ -25,11 +28,11 @@
 
 EtchAuthenticationExceptionSerializer::EtchAuthenticationExceptionSerializer(EtchType* type, EtchField* field)
 : mField(*field), mType(type) {
-
+  // TODO refactor
+  mRuntime = EtchRuntime::getRuntime();
 }
 
 EtchAuthenticationExceptionSerializer::~EtchAuthenticationExceptionSerializer() {
-
 }
 
 status_t EtchAuthenticationExceptionSerializer::importValue(EtchStructValue* value, capu::SmartPointer<EtchObject> &result) {
@@ -40,11 +43,13 @@
   }
 
   capu::SmartPointer<EtchObject> tmp;
-  if (value->get(mField, &tmp) != ETCH_OK)
+  if (value->get(mField, &tmp) != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Msg Field could not be found");
     return ETCH_ERROR;
-
+  }
   EtchString str = *((EtchString*) tmp.get());
   result = new EtchAuthenticationException(str);
+  CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Exception has been deserialized");
   return ETCH_OK;
 }
 
@@ -57,11 +62,14 @@
   EtchString *str = new EtchString(((EtchAuthenticationException*) value.get())->getErrorMessage());
   if (result->put(mField, str) != ETCH_OK)
     return ETCH_ERROR;
-
+  CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Exception has been serialized");
   return ETCH_OK;
 }
 
 status_t EtchAuthenticationExceptionSerializer::Init(EtchType* type, EtchClass2TypeMap* class2type) {
+  // TODO refactor this
+  EtchRuntime* runtime = EtchRuntime::getRuntime();
+
   status_t result;
   EtchField field_ptr;
   result = type->getField(FIELD_NAME(), &field_ptr);
@@ -79,5 +87,6 @@
   if (result != ETCH_OK)
     return result;
   type->lock();
+  CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchAuthenticationExceptionSerializer has been initialized");
   return ETCH_OK;
 }
diff --git a/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataInput.cpp b/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataInput.cpp
index a3e7fe1..c0a3289 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataInput.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataInput.cpp
@@ -17,9 +17,15 @@
  */
 
 #include "serialization/EtchBinaryTaggedDataInput.h"
+#include "support/EtchRuntime.h"
+
+static const char* TAG = "EtchBinaryTaggedDataInput";
 
 EtchBinaryTaggedDataInput::EtchBinaryTaggedDataInput(EtchValueFactory* vf)
 : EtchBinaryTaggedData(vf), mBuffer(NULL), mLengthBudget(0) {
+  // TODO refacotring
+  mRuntime = EtchRuntime::getRuntime();
+
   //get int validator
   EtchValidatorInt::Get(0, mIntValidator);
 
@@ -54,6 +60,7 @@
   if (ret != ETCH_OK) {
     mBuffer = NULL;
     mLengthBudget = 0;
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Deserialization of Message header has failed");
     return ret;
   }
 
@@ -61,6 +68,7 @@
   if (ret != ETCH_OK) {
     mBuffer = NULL;
     mLengthBudget = 0;
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Deserialization of Message body has failed");
     return ret;
   }
 
@@ -68,6 +76,7 @@
   if (ret != ETCH_OK) {
     mBuffer = NULL;
     mLengthBudget = 0;
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Deserialization of Message end has failed");
     return ret;
   }
 
@@ -79,16 +88,19 @@
 
   ret = startStruct(result);
   if (ret != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Reading header of struct has failed");
     return ret;
   }
 
   ret = readKeysAndValues(result);
   if (ret != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Reading body of struct has failed");
     return ret;
   }
 
   ret = endStruct(result);
   if (ret != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Reading end of struct has failed");
     return ret;
   }
 
@@ -100,16 +112,19 @@
 
   ret = startArray(result);
   if (ret != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Reading header of array has failed");
     return ret;
   }
 
   ret = readValues(result, v);
   if (ret != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Reading body of array has failed");
     return ret;
   }
 
   ret = endArray(result);
   if (ret != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Reading end of array has failed");
     return ret;
   }
   return ETCH_OK;
@@ -149,7 +164,7 @@
   while (true) {
     capu::SmartPointer<EtchObject> value;
     readValue(validator, true, value);
-    if(value == NONE()) {
+    if (value == NONE()) {
       break;
     }
     av->add(value);
@@ -162,16 +177,21 @@
   mBuffer->getByte(version);
 
   if (version != VERSION()) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Incorrect serializer version");
     return ETCH_EIO;
   }
 
   EtchType *type = NULL;
-  if (readType(type) != ETCH_OK)
+  if (readType(type) != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Type information is not read correctly");
     return ETCH_EIO;
+  }
 
   capu::int32_t length = 0;
-  if (readLength(length) != ETCH_OK)
+  if (readLength(length) != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Length of message is not read correctly");
     return ETCH_EIO;
+  }
 
   result = new EtchMessage(type, mVf, length);
   return ETCH_OK;
@@ -184,11 +204,13 @@
 status_t EtchBinaryTaggedDataInput::startStruct(capu::SmartPointer<EtchStructValue> &result) {
   EtchType* t = NULL;
   if (readType(t) != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "type of struct is not read correctly");
     return ETCH_ERROR;
   }
 
   capu::int32_t length;
   if (readLength(length) != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Length of struct is not read correctly");
     return ETCH_ERROR;
   }
 
@@ -206,28 +228,34 @@
 
   EtchType* customStructType = NULL;
   if (type == EtchTypeCode::CUSTOM || type == EtchTypeCode::STRUCT) {
-    if (readType(customStructType) != ETCH_OK)
+    if (readType(customStructType) != ETCH_OK) {
+      CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "type of array is not read correctly");
       return ETCH_ERROR;
+    }
   } else {
     customStructType = NULL;
   }
 
   capu::int32_t dim;
   if (readIntegerValue(dim) != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "dimension of array is not read correctly");
     return ETCH_EINVAL;
   }
 
   if (dim <= 0 || dim > (capu::int32_t)EtchValidator::MAX_NDIMS) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "dimension of array is not within predefined limits");
     return ETCH_EINVAL;
   }
 
   capu::int32_t length;
   if (readLength(length) != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "length of array is not read correctly");
     return ETCH_ERROR;
   }
 
   capu::SmartPointer<EtchNativeArrayBase> array;
   if (allocNativeArray(type, customStructType, dim, length, array) != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Allocation of array with specified type has failed");
     return ETCH_ERROR;
   }
 
@@ -309,6 +337,7 @@
 status_t EtchBinaryTaggedDataInput::readLength(capu::int32_t& result) {
   capu::int32_t length = 0;
   if (readIntegerValue(length) != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "length information is not read correctly");
     return ETCH_ERROR;
   }
 
@@ -375,8 +404,6 @@
   }
 }
 
-
-
 status_t EtchBinaryTaggedDataInput::readValue(capu::SmartPointer<EtchValidator> v, capu::SmartPointer<EtchObject>& result) {
   return readValue(v, false, result);
 }
@@ -396,10 +423,12 @@
 
     case EtchTypeCode::BOOLEAN_FALSE:
     {
+
       capu::SmartPointer<EtchBool> boolean = new EtchBool(false);
       if (validateValue(v, boolean, result) != ETCH_OK) {
         return ETCH_ERROR;
       } else {
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Boolean false value has been received");
         return ETCH_OK;
       }
     }
@@ -410,6 +439,8 @@
       if (validateValue(v, boolean, result) != ETCH_OK) {
         return ETCH_ERROR;
       } else {
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Boolean false value has been received");
+
         return ETCH_OK;
       }
     }
@@ -423,6 +454,7 @@
       if (validateValue(v, byte, result) != ETCH_OK) {
         return ETCH_ERROR;
       } else {
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Byte value has been received");
         return ETCH_OK;
       }
     }
@@ -436,6 +468,7 @@
       if (validateValue(v, shortNum, result) != ETCH_OK) {
         return ETCH_ERROR;
       } else {
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Short value has been received");
         return ETCH_OK;
       }
     }
@@ -449,6 +482,7 @@
       if (validateValue(v, intNum, result) != ETCH_OK) {
         return ETCH_ERROR;
       } else {
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Int value has been received");
         return ETCH_OK;
       }
     }
@@ -462,6 +496,7 @@
       if (validateValue(v, longNum, result) != ETCH_OK) {
         return ETCH_ERROR;
       } else {
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Long value has been received");
         return ETCH_OK;
       }
     }
@@ -475,6 +510,7 @@
       if (validateValue(v, floatNum, result) != ETCH_OK) {
         return ETCH_ERROR;
       } else {
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Float value has been received");
         return ETCH_OK;
       }
     }
@@ -488,6 +524,7 @@
       if (validateValue(v, doubleNum, result) != ETCH_OK) {
         return ETCH_ERROR;
       } else {
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Double value has been received");
         return ETCH_OK;
       }
     }
@@ -496,11 +533,11 @@
     {
       status_t ret;
 
-      capu::int8_t  *buffer = NULL;
+      capu::int8_t *buffer = NULL;
       capu::uint32_t bufferSize = 0;
 
       ret = readBytes(buffer, bufferSize);
-      if(ret != ETCH_OK) {
+      if (ret != ETCH_OK) {
         return ETCH_ERROR;
       }
 
@@ -510,6 +547,8 @@
 
       ret = validateValue(v, narray, result);
 
+      CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Byte Array has been received");
+
       return ret;
     }
 
@@ -534,7 +573,7 @@
 
       capu::SmartPointer<EtchObject> array;
       ret = fromArrayValue(arrayval, array);
-      if (ret  != ETCH_OK) {
+      if (ret != ETCH_OK) {
         delete arrayval;
         return ETCH_ERROR;
       }
@@ -544,6 +583,7 @@
         return ETCH_ERROR;
       } else {
         result = array;
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Array hhas been received");
         return ETCH_OK;
       }
     }
@@ -555,6 +595,7 @@
         return ETCH_ERROR;
       } else {
         result = str;
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Empty String value has been received");
         return ETCH_OK;
       }
     }
@@ -562,7 +603,7 @@
     case EtchTypeCode::STRING:
     {
       status_t ret;
-      capu::int8_t  *buffer = NULL;
+      capu::int8_t *buffer = NULL;
       capu::uint32_t bufferSize;
 
       ret = readBytes(buffer, bufferSize);
@@ -576,6 +617,7 @@
         return ETCH_ERROR;
       } else {
         result = str;
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "String value has been received");
         return ETCH_OK;
       }
     }
@@ -595,6 +637,7 @@
       if (validateValue(v, obj, result) != ETCH_OK) {
         return ETCH_ERROR;
       } else {
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Custom value has been received");
         return ETCH_OK;
       }
     }
@@ -606,6 +649,7 @@
         if (validateValue(v, tmp, result) != ETCH_OK) {
           return ETCH_ERROR;
         } else {
+          CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Tiny Int value has been received");
           return ETCH_OK;
         }
       }
diff --git a/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataOutput.cpp b/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataOutput.cpp
index e883109..81b7c06 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataOutput.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataOutput.cpp
@@ -16,6 +16,9 @@
  * limitations under the License.
  */
 #include "serialization/EtchBinaryTaggedDataOutput.h"
+#include "support/EtchRuntime.h"
+
+static char* TAG = "EtchBinaryTaggedDataOutput";
 
 const EtchString& EtchBinaryTaggedDataOutput::STRING_TYPE_AND_FIELD() {
   static const EtchString name("BinaryTaggedDataOutput.stringTypeAndField");
@@ -24,6 +27,9 @@
 
 EtchBinaryTaggedDataOutput::EtchBinaryTaggedDataOutput(EtchValueFactory *vf, EtchURL* uri)
 : EtchBinaryTaggedData(vf), mLevel(vf->getLevel()), mBuffer(NULL) {
+  // TODO refactoring
+  mRuntime = EtchRuntime::getRuntime();
+
   EtchString tmp;
   if (uri->getTerms().get(STRING_TYPE_AND_FIELD(), &tmp) == ETCH_OK) {
     mStringTypeAndField = atoi(tmp.c_str()) > 0;
@@ -37,7 +43,6 @@
 }
 
 EtchBinaryTaggedDataOutput::~EtchBinaryTaggedDataOutput() {
-
 }
 
 status_t EtchBinaryTaggedDataOutput::writeMessage(capu::SmartPointer<EtchMessage> msg, capu::SmartPointer<EtchFlexBuffer> buf) {
@@ -50,16 +55,19 @@
 
   ret = startMessage(msg);
   if (ret != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of Message header has failed");
     return ETCH_ERROR;
   }
 
   ret = writeKeysAndValues(msg);
   if (ret != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of Message body has failed");
     return ETCH_ERROR;
   }
 
   ret = endMessage(msg);
   if (ret != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of Message end has failed");
     return ETCH_ERROR;
   }
 
@@ -71,16 +79,19 @@
 
   ret = startStruct(sv);
   if (ret != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of struct header has failed");
     return ETCH_ERROR;
   }
 
   ret = writeKeysAndValues(sv);
   if (ret != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of struct body has failed");
     return ETCH_ERROR;
   }
 
   ret = endStruct(sv);
   if (ret != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of struct end has failed");
     return ETCH_ERROR;
   }
 
@@ -92,16 +103,19 @@
 
   ret = startArray(av);
   if (ret != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of array header has failed");
     return ETCH_ERROR;
   }
 
   ret = writeValues(av, v);
   if (ret != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of array body has failed");
     return ETCH_ERROR;
   }
 
   ret = endArray(av);
   if (ret != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of array end has failed");
     return ETCH_ERROR;
   }
 
@@ -157,7 +171,7 @@
   capu::int32_t size = av->getIndex();
   for (capu::int32_t i = 0; i < size; i++) {
     capu::SmartPointer<EtchObject> tmp;
-    av->get(i,tmp);
+    av->get(i, tmp);
     if (writeValue(validatorElement, tmp) != ETCH_OK)
       return ETCH_ERROR;
   }
@@ -180,10 +194,13 @@
 status_t EtchBinaryTaggedDataOutput::startStruct(capu::SmartPointer<EtchStructValue> _struct) {
   // the caller has already written a type code to indicate a
   // struct is starting. this code is shared by startMessage().
-  if (writeType(_struct->getType()) != ETCH_OK)
+  if (writeType(_struct->getType()) != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of struct type information has failed");
     return ETCH_ERROR;
-  else if (writeIntValue(_struct->count()) != ETCH_OK)
+  } else if (writeIntValue(_struct->count()) != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of field number on struct has failed");
     return ETCH_ERROR;
+  }
   return ETCH_OK;
 }
 
@@ -207,17 +224,20 @@
   if (type == EtchTypeCode::CUSTOM) {
     ret = writeType(array->getCustomStructType());
     if (ret != ETCH_OK) {
-        return ETCH_ERROR;
+      CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of array type information has failed");
+      return ETCH_ERROR;
     }
   }
 
   ret = writeIntValue(array->getDim());
   if (ret != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of array dimension information has failed");
     return ETCH_ERROR;
   }
 
   ret = writeIntValue(array->getSize());
   if (ret != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of array size information has failed");
     return ETCH_ERROR;
   }
 
@@ -283,33 +303,41 @@
       return ETCH_OK;
 
     case EtchTypeCode::BYTE:
+      CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Byte has been serialized");
       return mBuffer->putByte(((EtchByte*) value.get())->get());
 
     case EtchTypeCode::SHORT:
+      CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Short has been serialized");
       return mBuffer->putShort(((EtchShort*) value.get())->get());
 
     case EtchTypeCode::INT:
+      CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Int has been serialized");
       return mBuffer->putInt(((EtchInt32*) value.get())->get());
 
     case EtchTypeCode::LONG:
+      CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Long has been serialized");
       return mBuffer->putLong(((EtchLong*) value.get())->get());
 
     case EtchTypeCode::FLOAT:
+      CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Float has been serialized");
+
       return mBuffer->putFloat(((EtchFloat*) value.get())->get());
 
     case EtchTypeCode::DOUBLE:
+      CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Double has been serialized");
       return mBuffer->putDouble(((EtchDouble*) value.get())->get());
 
 
     case EtchTypeCode::BYTES:
-      {
+    {
       EtchNativeArray<capu::int8_t> *na = (EtchNativeArray<capu::int8_t> *)value.get();
       capu::int8_t *data = new capu::int8_t[na->getLength()];
-      na->get(Pos(0),data,na->getLength(),0,na->getLength());
+      na->get(Pos(0), data, na->getLength(), 0, na->getLength());
       status_t ret = writeBytes(data, na->getLength());
       delete[] data;
+      CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Byte Array has been serialized");
       return ret;
-      }
+    }
 
 
       //			reserved for future use:
@@ -324,31 +352,37 @@
     {
       EtchArrayValue *val = NULL;
       if (toArrayValue(value, v.get(), val) != ETCH_OK) {
+        CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Array couldn't be serialized");
         return ETCH_ERROR;
       }
+      CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Array has been serialized");
       return writeArray(val, v.get());
     }
     case EtchTypeCode::STRING:
     {
       capu::SmartPointer<EtchString> str = capu::smartpointer_cast<EtchString > (value);
+      CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "String has been serialized");
       return writeBytes((capu::int8_t*)str->c_str(), str->getNumBytes());
     }
     case EtchTypeCode::CUSTOM:
     {
       EtchStructValue* _struct;
       if (mVf->exportCustomValue(value, _struct) != ETCH_OK) {
+        CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Custom Data Type couldn't be serialized");
         return ETCH_ERROR;
       }
-
+      CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Custom Data Type has been serialized");
       return writeStruct(_struct);
     }
 
     default:
       // type is either "tiny" integer or unused
       if (typeCode >= EtchTypeCode::MIN_TINY_INT && typeCode <= EtchTypeCode::MAX_TINY_INT) {
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Tiny Int has been serialized");
         return ETCH_OK;
       }
       //invalid type
+      CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Attempted serialization of an invalid Data Type");
       return ETCH_EINVAL;
   }
   return ETCH_ERROR;
diff --git a/binding-cpp/runtime/src/main/serialization/EtchDateSerializer.cpp b/binding-cpp/runtime/src/main/serialization/EtchDateSerializer.cpp
index 3ac0118..fc26c71 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchDateSerializer.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchDateSerializer.cpp
@@ -17,6 +17,9 @@
  */
 
 #include "serialization/EtchDateSerializer.h"
+#include "support/EtchRuntime.h"
+
+static char* TAG = "EtchDateSerializer";
 
 const EtchString& EtchDateSerializer::FIELD_NAME() {
   static const EtchString name("dateTime");
@@ -25,11 +28,11 @@
 
 EtchDateSerializer::EtchDateSerializer(EtchType* type, EtchField* field)
 : mField(*field), mType(type) {
-
+  //TODO refactor this
+  mRuntime = EtchRuntime::getRuntime();
 }
 
 EtchDateSerializer::~EtchDateSerializer() {
-
 }
 
 status_t EtchDateSerializer::importValue(EtchStructValue* value, capu::SmartPointer<EtchObject> &result) {
@@ -40,11 +43,14 @@
   }
 
   capu::SmartPointer<EtchObject> tmp;
-  if (value->get(mField, &tmp) != ETCH_OK)
+  if (value->get(mField, &tmp) != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "DateTime Field could not be found");
     return ETCH_ERROR;
+  }
 
   EtchLong date = *((EtchLong*) tmp.get());
   result = new EtchDate((capu::time_t)date.get());
+  CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Date has been deserialized");
   return ETCH_OK;
 }
 
@@ -57,11 +63,14 @@
   EtchLong *date = new EtchLong(((EtchDate*) value.get())->get());
   if (result->put(mField, date) != ETCH_OK)
     return ETCH_ERROR;
-
+  CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Date has been serialized");
   return ETCH_OK;
 }
 
 status_t EtchDateSerializer::Init(EtchType* type, EtchClass2TypeMap* class2type) {
+  //TODO refactoring
+  EtchRuntime* runtime = EtchRuntime::getRuntime();
+  
   status_t result;
   EtchField field_ptr;
   result = type->getField(FIELD_NAME(), &field_ptr);
@@ -80,5 +89,6 @@
   if (result != ETCH_OK)
     return result;
   type->lock();
+  CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchDateSerializer has been initialized");
   return ETCH_OK;
 }
diff --git a/binding-cpp/runtime/src/main/serialization/EtchHashTableSerializer.cpp b/binding-cpp/runtime/src/main/serialization/EtchHashTableSerializer.cpp
index fcbcc65..fa4ef68 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchHashTableSerializer.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchHashTableSerializer.cpp
@@ -18,7 +18,9 @@
 
 
 #include "serialization/EtchHashTableSerializer.h"
+#include "support/EtchRuntime.h"
 
+static char* TAG = "EtchHashTableSerializer";
 
 const EtchString& EtchHashTableSerializer::FIELD_NAME() {
   static const EtchString name("keysAndValues");
@@ -27,11 +29,11 @@
 
 EtchHashTableSerializer::EtchHashTableSerializer(EtchType* type, EtchField* field)
 : mField(*field), mType(type) {
-
+  //TODO refactoring
+  mRuntime = EtchRuntime::getRuntime();
 }
 
 EtchHashTableSerializer::~EtchHashTableSerializer() {
-
 }
 
 status_t EtchHashTableSerializer::exportValue(EtchValueFactory* vf, capu::SmartPointer<EtchObject> value, EtchStructValue*& result) {
@@ -42,10 +44,10 @@
 
   capu::SmartPointer<EtchHashTable<capu::SmartPointer<EtchObject>, capu::SmartPointer<EtchObject> > > table = capu::smartpointer_cast<EtchHashTable<capu::SmartPointer<EtchObject>, capu::SmartPointer<EtchObject> > > (value);
 
-  EtchHashTable<capu::SmartPointer<EtchObject> , capu::SmartPointer<EtchObject> >::Iterator it = table->begin();
+  EtchHashTable<capu::SmartPointer<EtchObject>, capu::SmartPointer<EtchObject> >::Iterator it = table->begin();
   capu::SmartPointer<EtchNativeArray<capu::SmartPointer<EtchObject> > > keysAndValuesArray = new EtchNativeArray<capu::SmartPointer<EtchObject> > (table->count()*2);
   capu::int32_t i = 0;
-  EtchHashTable<capu::SmartPointer<EtchObject> , capu::SmartPointer<EtchObject> >::Pair ptr;
+  EtchHashTable<capu::SmartPointer<EtchObject>, capu::SmartPointer<EtchObject> >::Pair ptr;
 
   while (it.hasNext()) {
     it.next(&ptr);
@@ -59,7 +61,7 @@
   if (result->put(mField, keysAndValuesArray) != ETCH_OK) {
     return ETCH_ERROR;
   }
-
+  CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "HashTable has been serialized");
   return ETCH_OK;
 }
 
@@ -70,10 +72,12 @@
     return ETCH_EINVAL;
   }
   capu::SmartPointer<EtchObject> tmp;
-  if (value->get(mField, &tmp) != ETCH_OK)
+  if (value->get(mField, &tmp) != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "KeysAndValues Field could not be found");
     return ETCH_ERROR;
+  }
 
-  EtchHashTable<capu::SmartPointer<EtchObject> , capu::SmartPointer<EtchObject> >* table = new EtchHashTable<capu::SmartPointer<EtchObject> , capu::SmartPointer<EtchObject> >();
+  EtchHashTable<capu::SmartPointer<EtchObject>, capu::SmartPointer<EtchObject> >* table = new EtchHashTable<capu::SmartPointer<EtchObject>, capu::SmartPointer<EtchObject> >();
 
   capu::SmartPointer<EtchNativeArray<capu::SmartPointer<EtchObject> > > keysAndValuesArray = capu::smartpointer_cast<EtchNativeArray<capu::SmartPointer<EtchObject> > > (tmp);
 
@@ -90,10 +94,14 @@
       return res;
   }
   result = (EtchObject*) table;
+  CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "HashTable has been deserialized");
   return ETCH_OK;
 }
 
 status_t EtchHashTableSerializer::Init(EtchType* type, EtchClass2TypeMap* class2type) {
+  //TODO rafactor this

+  EtchRuntime* runtime = EtchRuntime::getRuntime();
+
   status_t result;
   EtchField field_ptr;
   result = type->getField(FIELD_NAME(), &field_ptr);
@@ -111,5 +119,6 @@
   if (result != ETCH_OK)
     return result;
   type->lock();
+  CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchHashTableSerializer has been initialized");
   return ETCH_OK;
 }
diff --git a/binding-cpp/runtime/src/main/serialization/EtchListSerializer.cpp b/binding-cpp/runtime/src/main/serialization/EtchListSerializer.cpp
index 1f9b2c5..fdfd292 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchListSerializer.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchListSerializer.cpp
@@ -17,6 +17,9 @@
  */
 
 #include "serialization/EtchListSerializer.h"
+#include "support/EtchRuntime.h"
+
+static char* TAG = "EtchListSerializer";
 
 const EtchString& EtchListSerializer::FIELD_NAME() {
   static const EtchString name("values");
@@ -27,6 +30,8 @@
 
 EtchListSerializer::EtchListSerializer(EtchType* type, EtchField* field)
 : mField(*field), mType(type) {
+  //TODO refactor this
+  mRuntime = EtchRuntime::getRuntime();
 }
 
 EtchListSerializer::~EtchListSerializer() {
@@ -53,6 +58,7 @@
   result = new EtchStructValue(mType, vf);
   if (result->put(mField, values) != ETCH_OK)
     return ETCH_ERROR;
+  CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "List has been serialized");
   return ETCH_OK;
 }
 
@@ -65,8 +71,10 @@
   }
 
   capu::SmartPointer<EtchObject> tmp = NULL;
-  if (value->get(mField, &tmp) != ETCH_OK)
+  if (value->get(mField, &tmp) != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Values Field could not be found");
     return ETCH_ERROR;
+  }
 
   capu::SmartPointer<EtchNativeArray<capu::SmartPointer<EtchObject> > > values = capu::smartpointer_cast<EtchNativeArray<capu::SmartPointer<EtchObject> > >(tmp);
 
@@ -80,10 +88,14 @@
       return res;
   }
   result = (EtchObject*) list;
+  CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "List has been deserialized");
   return ETCH_OK;
 }
 
 status_t EtchListSerializer::Init(EtchType* type, EtchClass2TypeMap * class2type) {
+  //TODO rafactor this
+  EtchRuntime* runtime = EtchRuntime::getRuntime();
+  
   status_t result;
 
   EtchField field;
@@ -108,5 +120,6 @@
   }
   type->lock();
 
+  CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchListSerializer has been initialized");
   return ETCH_OK;
 }
diff --git a/binding-cpp/runtime/src/main/serialization/EtchRuntimeExceptionSerializer.cpp b/binding-cpp/runtime/src/main/serialization/EtchRuntimeExceptionSerializer.cpp
index 8c91c98..8104adf 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchRuntimeExceptionSerializer.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchRuntimeExceptionSerializer.cpp
@@ -17,6 +17,9 @@
  */
 
 #include "serialization/EtchRuntimeExceptionSerializer.h"
+#include "support/EtchRuntime.h"
+
+static char* TAG = "EtchRuntimeExceptionSerializer";
 
 const EtchString& EtchRuntimeExceptionSerializer::FIELD_NAME() {
   static const EtchString name("msg");
@@ -24,9 +27,11 @@
 }
 
 // TODO: check signature regarding by value copy
+
 EtchRuntimeExceptionSerializer::EtchRuntimeExceptionSerializer(EtchType* type, EtchField* field)
 : mField(*field), mType(type) {
-
+  //TODO refactor this
+  mRuntime = EtchRuntime::getRuntime();
 }
 
 EtchRuntimeExceptionSerializer::~EtchRuntimeExceptionSerializer() {
@@ -41,11 +46,14 @@
   }
 
   capu::SmartPointer<EtchObject> tmp;
-  if (value->get(mField, &tmp) != ETCH_OK)
+  if (value->get(mField, &tmp) != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Msg Field could not be found");
     return ETCH_ERROR;
+  }
 
   EtchString str = *((EtchString*) tmp.get());
   result = new EtchRuntimeException(str, ETCH_ERROR);
+  CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Exception has been deserialized");
   return ETCH_OK;
 }
 
@@ -59,11 +67,13 @@
 
   if (result->put(mField, str) != ETCH_OK)
     return ETCH_ERROR;
-
+  CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Exception has been serialized");
   return ETCH_OK;
 }
 
 status_t EtchRuntimeExceptionSerializer::Init(EtchType* type, EtchClass2TypeMap* class2type) {
+  //TODO rafactor this
+  EtchRuntime* runtime = EtchRuntime::getRuntime();
 
   status_t result;
   EtchField field_ptr;
@@ -82,5 +92,6 @@
   if (result != ETCH_OK)
     return result;
   type->lock();
+  CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchRuntimeExceptionSerializer has been initialized");
   return ETCH_OK;
 }
diff --git a/binding-cpp/runtime/src/main/serialization/EtchSetSerializer.cpp b/binding-cpp/runtime/src/main/serialization/EtchSetSerializer.cpp
index 38adb27..f3f46f4 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchSetSerializer.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchSetSerializer.cpp
@@ -17,6 +17,9 @@
  */
 
 #include "serialization/EtchSetSerializer.h"
+#include "support/EtchRuntime.h"
+
+static const char* TAG = "EtchSetSerializer";
 
 const EtchString& EtchSetSerializer::FIELD_NAME() {
   static const EtchString name("keys");
@@ -25,11 +28,11 @@
 
 EtchSetSerializer::EtchSetSerializer(EtchType* type, EtchField* field)
 : mField(*field), mType(type) {
-
+  // TODO refactoring
+  mRuntime = EtchRuntime::getRuntime();
 }
 
 EtchSetSerializer::~EtchSetSerializer() {
-
 }
 
 status_t EtchSetSerializer::exportValue(EtchValueFactory* vf, capu::SmartPointer<EtchObject> value, EtchStructValue*& result) {
@@ -54,7 +57,7 @@
   result = new EtchStructValue(mType, vf);
   if (result->put(mField, array) != ETCH_OK)
     return ETCH_ERROR;
-
+  CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Set has been serialized");
   return ETCH_OK;
 }
 
@@ -65,8 +68,10 @@
     return ETCH_EINVAL;
   }
   capu::SmartPointer<EtchObject> tmp;
-  if (value->get(mField, &tmp) != ETCH_OK)
+  if (value->get(mField, &tmp) != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Keys Field could not be found");
     return ETCH_ERROR;
+  }
 
   EtchHashSet<capu::SmartPointer<EtchObject> >* set = new EtchHashSet<capu::SmartPointer<EtchObject> >();
 
@@ -80,10 +85,14 @@
       return res;
   }
   result = (capu::SmartPointer<EtchObject>) set;
+  CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Set has been deserialized");
   return ETCH_OK;
 }
 
 status_t EtchSetSerializer::Init(EtchType* type, EtchClass2TypeMap* class2type) {
+  //TODO refactoring
+  EtchRuntime* runtime = EtchRuntime::getRuntime();
+
   status_t result;
   EtchField field_ptr;
   result = type->getField(FIELD_NAME(), &field_ptr);
@@ -101,5 +110,6 @@
   if (result != ETCH_OK)
     return result;
   type->lock();
+  CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchSetSerializer has been initialized");
   return ETCH_OK;
 }
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorBoolean.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorBoolean.cpp
index 4a68969..af3dbb9 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorBoolean.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorBoolean.cpp
@@ -17,11 +17,13 @@
  */
 
 #include "serialization/EtchValidatorBoolean.h"
+#include "support/EtchRuntime.h"
 
-capu::SmartPointer<EtchValidator>* EtchValidatorBoolean::Validators()
-{
-  static capu::SmartPointer<EtchValidator> ret[MAX_CACHED];
-  return &(ret[0]);
+static const char* TAG = "EtchValidatorBoolean";

+
+capu::SmartPointer<EtchValidator>* EtchValidatorBoolean::Validators(EtchRuntime* runtime) {
+  static EtchValidatorCaches validators;
+  return validators.get(runtime);
 }
 
 const EtchObjectType* EtchValidatorBoolean::TYPE() {
@@ -31,7 +33,8 @@
 
 EtchValidatorBoolean::EtchValidatorBoolean(capu::uint32_t ndim)
 : EtchTypeValidator(EtchValidatorBoolean::TYPE(), EtchBool::TYPE(), EtchBool::TYPE(), ndim) {
-
+  //TODO rafactor this

+  mRuntime = EtchRuntime::getRuntime();
 }
 
 EtchValidatorBoolean::~EtchValidatorBoolean() {
@@ -63,14 +66,19 @@
 
 status_t EtchValidatorBoolean::validateValue(capu::SmartPointer<EtchObject> value, capu::SmartPointer<EtchObject>& result) {
   if (validate(value)) {
+    CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Object has been validated");
     result = value;
     return ETCH_OK;
   } else {
+    CAPU_LOG_WARN(mRuntime->getLogger(), TAG, "Object has not been validated");
     return ETCH_ERROR;
   }
 }
 
 status_t EtchValidatorBoolean::Get(capu::uint32_t ndim, capu::SmartPointer<EtchValidator> &val) {
+  //TODO rafactor this

+  EtchRuntime* runtime = EtchRuntime::getRuntime();

+
   if (ndim > MAX_NDIMS) {
     return ETCH_EINVAL;
   }
@@ -78,10 +86,11 @@
     val = new EtchValidatorBoolean(ndim);
     return ETCH_OK;
   }
-  if (Validators()[ndim].get() == NULL) {
-    Validators()[ndim] = new EtchValidatorBoolean(ndim);
+  if (Validators(runtime)[ndim].get() == NULL) {
+    Validators(runtime)[ndim] = new EtchValidatorBoolean(ndim);
+    CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchValidatorBoolean has been created");
   }
-  val = Validators()[ndim];
+  val = Validators(runtime)[ndim];
   return ETCH_OK;
 }
 
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorByte.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorByte.cpp
index 97e1964..80090d3 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorByte.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorByte.cpp
@@ -17,11 +17,13 @@
  */
 
 #include "serialization/EtchValidatorByte.h"
+#include "support/EtchRuntime.h"
 
-capu::SmartPointer<EtchValidator>* EtchValidatorByte::Validators()
-{
-  static capu::SmartPointer<EtchValidator> ret[MAX_CACHED];
-  return &(ret[0]);
+static const char* TAG = "EtchValidatorByte";
+
+capu::SmartPointer<EtchValidator>* EtchValidatorByte::Validators(EtchRuntime* runtime) {
+  static EtchValidatorCaches validators;
+  return validators.get(runtime);
 }
 
 const EtchObjectType* EtchValidatorByte::TYPE() {
@@ -31,7 +33,8 @@
 
 EtchValidatorByte::EtchValidatorByte(capu::uint32_t ndim)
 : EtchTypeValidator(EtchValidatorByte::TYPE(), EtchByte::TYPE(), EtchByte::TYPE(), ndim) {
-
+  //TODO rafactor this

+  mRuntime = EtchRuntime::getRuntime();
 }
 
 EtchValidatorByte::~EtchValidatorByte() {
@@ -49,17 +52,17 @@
 
   if (value->getObjectType()->equals(EtchShort::TYPE())) {
     EtchShort *v = (EtchShort *) value.get();
-    return ((v->get() >= capu::NumericLimitMin<capu::int8_t> ()) && (v->get() <= capu::NumericLimitMax<capu::int8_t> ()));
+    return ((v->get() >= capu::NumericLimitMin<capu::int8_t > ()) && (v->get() <= capu::NumericLimitMax<capu::int8_t > ()));
   }
 
   if (value->getObjectType()->equals(EtchInt32::TYPE())) {
     EtchInt32 *v = (EtchInt32 *) value.get();
-    return ((v->get() >= capu::NumericLimitMin<capu::int8_t> ()) && (v->get() <= capu::NumericLimitMax<capu::int8_t> ()));
+    return ((v->get() >= capu::NumericLimitMin<capu::int8_t > ()) && (v->get() <= capu::NumericLimitMax<capu::int8_t > ()));
   }
 
   if (value->getObjectType()->equals(EtchLong::TYPE())) {
     EtchLong *v = (EtchLong *) value.get();
-    return ((v->get() >= capu::NumericLimitMin<capu::int8_t> ()) && (v->get() <= capu::NumericLimitMax<capu::int8_t> ()));
+    return ((v->get() >= capu::NumericLimitMin<capu::int8_t > ()) && (v->get() <= capu::NumericLimitMax<capu::int8_t > ()));
   }
   //array handling
   if ((value->getObjectType()->isArray()) && (mExpectedType->isArray())) {
@@ -81,33 +84,44 @@
   if (validate(value)) {
     if ((value->getObjectType()->equals(EtchByte::TYPE())) || (mNDims > 0)) {
       result = value;
+      CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorByte", "Object has been validated");
       return ETCH_OK;
     } else {
       if (value->getObjectType()->equals(EtchShort::TYPE())) {
         EtchShort *v = (EtchShort *) value.get();
         result = new EtchByte((capu::int8_t)v->get());
+        CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorByte", "Short has been validated by EtchValidatorByte and converted to EtchByte");
+
         return ETCH_OK;
       }
 
       if (value->getObjectType()->equals(EtchLong::TYPE())) {
         EtchLong *v = (EtchLong *) value.get();
         result = new EtchByte((capu::int8_t)v->get());
+        CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorByte", "EtchLong has been validated by EtchValidatorByte and converted to EtchByte");
+
         return ETCH_OK;
       }
 
       if (value->getObjectType()->equals(EtchInt32::TYPE())) {
         EtchInt32 *v = (EtchInt32 *) value.get();
         result = new EtchByte((capu::int8_t)v->get());
+        CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorByte", "EtchInt32 has been validated by EtchValidatorByte and converted to EtchByte");
         return ETCH_OK;
       }
+      CAPU_LOG_WARN(mRuntime->getLogger(), "EtchValidatorByte", "Object has not been validated");
       return ETCH_ERROR;
     }
   } else {
+    CAPU_LOG_WARN(mRuntime->getLogger(), "EtchValidatorByte", "Object has not been validated");
     return ETCH_ERROR;
   }
 }
 
 status_t EtchValidatorByte::Get(capu::uint32_t ndim, capu::SmartPointer<EtchValidator> &val) {
+  //TODO rafactor this

+  EtchRuntime* runtime = EtchRuntime::getRuntime();
+
   if (ndim > MAX_NDIMS) {
     return ETCH_EINVAL;
   }
@@ -115,10 +129,12 @@
     val = new EtchValidatorByte(ndim);
     return ETCH_OK;
   }
-  if (Validators()[ndim].get() == NULL) {
-    Validators()[ndim] = new EtchValidatorByte(ndim);
+  if (Validators(runtime)[ndim].get() == NULL) {
+    Validators(runtime)[ndim] = new EtchValidatorByte(ndim);
+    CAPU_LOG_TRACE(runtime->getLogger(), "EtchValidatorByte", "EtchValidatorByte has been created");
+
   }
-  val = Validators()[ndim];
+  val = Validators(runtime)[ndim];
   return ETCH_OK;
 }
 
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorCustom.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorCustom.cpp
index 401828e..91351c5 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorCustom.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorCustom.cpp
@@ -18,6 +18,63 @@
 
 #include "serialization/EtchValidatorCustom.h"
 
+/**
+ * Etch validator chaches for each runtime
+ */
+class EtchValidatorCustomCaches : public EtchRuntimeListener {
+public:
+  /**
+   * Validator cache
+   */
+  struct ValidatorCache {
+    capu::uint64_t id;
+    EtchHashTable<EtchValidatorCustomKey, capu::SmartPointer<EtchValidator> > validators;
+  };
+
+  /**
+   * Construct a new instance from the Validators class.
+   */
+  EtchValidatorCustomCaches() {
+  }
+
+  /**
+   * Destructor
+   */
+  virtual ~EtchValidatorCustomCaches() {
+    capu::List<ValidatorCache*>::Iterator iter = mValidatorsCache.begin();
+    while(iter.hasNext()) {
+      ValidatorCache* entry = NULL;
+      iter.next(&entry);
+      delete entry;
+    }
+    mValidatorsCache.clear();
+  }
+
+  status_t onRuntimeChanged(EtchRuntime* runtime) {
+    return ETCH_OK;
+  }
+
+  EtchHashTable<EtchValidatorCustomKey, capu::SmartPointer<EtchValidator> >& get(EtchRuntime* runtime) {
+    capu::List<ValidatorCache*>::Iterator iter = mValidatorsCache.begin();
+    while(iter.hasNext()) {
+      ValidatorCache* entry = NULL;
+      iter.next(&entry);
+      if(entry->id == runtime->getId()) {
+        return entry->validators;
+      }
+    }
+    ValidatorCache* entry = new ValidatorCache();
+    entry->id = runtime->getId();
+    mValidatorsCache.add(entry);
+    return entry->validators;
+  }
+
+private:
+  capu::List<ValidatorCache*> mValidatorsCache;
+};
+
+
+
 
 const EtchObjectType* EtchValidatorCustomKey::TYPE() {
   const static EtchObjectType TYPE(EOTID_VALIDATOR_CUSTOM_KEY, NULL);
@@ -94,14 +151,17 @@
 }
 
 status_t EtchValidatorCustom::Get(capu::uint32_t ndim, const EtchObjectType *type, capu::bool_t sub, capu::SmartPointer<EtchValidator> &val) {
+  //TODO rafactor this

+  EtchRuntime* runtime = EtchRuntime::getRuntime();
+
   if (ndim > MAX_NDIMS) {
     return ETCH_EINVAL;
   }
 
   EtchValidatorCustomKey key(type, ndim, sub);
-  if (Validators().get(key, &val) == ETCH_ENOT_EXIST) {
+  if (Validators(runtime).get(key, &val) == ETCH_ENOT_EXIST) {
     val = new EtchValidatorCustom(type, ndim, sub);
-    Validators().put(key, val);
+    Validators(runtime).put(key, val);
   }
   return ETCH_OK;
 }
@@ -110,7 +170,7 @@
   return EtchValidatorCustom::Get(mNDims - 1, mExpectedType->getObjectComponentType(), mSubclass, val);
 }
 
-EtchHashTable<EtchValidatorCustomKey, capu::SmartPointer<EtchValidator> >& EtchValidatorCustom::Validators() {
-  static EtchHashTable<EtchValidatorCustomKey, capu::SmartPointer<EtchValidator> > ret;
-  return ret;
+EtchHashTable<EtchValidatorCustomKey, capu::SmartPointer<EtchValidator> >& EtchValidatorCustom::Validators(EtchRuntime* runtime) {
+  static EtchValidatorCustomCaches validators;
+  return validators.get(runtime);
 }
\ No newline at end of file
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorDouble.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorDouble.cpp
index 334dfd7..239489c 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorDouble.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorDouble.cpp
@@ -17,11 +17,13 @@
  */
 
 #include "serialization/EtchValidatorDouble.h"
+#include "support/EtchRuntime.h"
 
-capu::SmartPointer<EtchValidator>* EtchValidatorDouble::Validators()
-{
-  static capu::SmartPointer<EtchValidator> ret[MAX_CACHED];
-  return &(ret[0]);
+static const char* TAG = "EtchValidatorDouble";
+
+capu::SmartPointer<EtchValidator>* EtchValidatorDouble::Validators(EtchRuntime* runtime) {
+  static EtchValidatorCaches validators;
+  return validators.get(runtime);
 }
 const EtchObjectType* EtchValidatorDouble::TYPE() {
   const static EtchObjectType TYPE(EOTID_VALIDATOR_DOUBLE, NULL);
@@ -30,11 +32,11 @@
 
 EtchValidatorDouble::EtchValidatorDouble(capu::uint32_t ndim)
 : EtchTypeValidator(EtchValidatorDouble::TYPE(), EtchDouble::TYPE(), EtchDouble::TYPE(), ndim) {
-
+  //TODO rafactor this

+  mRuntime = EtchRuntime::getRuntime();
 }
 
 EtchValidatorDouble::~EtchValidatorDouble() {
-
 }
 
 capu::bool_t EtchValidatorDouble::validate(capu::SmartPointer<EtchObject> value) {
@@ -63,13 +65,18 @@
 status_t EtchValidatorDouble::validateValue(capu::SmartPointer<EtchObject> value, capu::SmartPointer<EtchObject>& result) {
   if (validate(value)) {
     result = value;
+    CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Object has been validated");
     return ETCH_OK;
   } else {
+    CAPU_LOG_WARN(mRuntime->getLogger(), TAG, "Object has not been validated");
     return ETCH_ERROR;
   }
 }
 
 status_t EtchValidatorDouble::Get(capu::uint32_t ndim, capu::SmartPointer<EtchValidator> &val) {
+    //TODO rafactor this

+  EtchRuntime* runtime = EtchRuntime::getRuntime();
+
   if (ndim > MAX_NDIMS) {
     return ETCH_EINVAL;
   }
@@ -77,10 +84,11 @@
     val = new EtchValidatorDouble(ndim);
     return ETCH_OK;
   }
-  if (Validators()[ndim].get() == NULL) {
-    Validators()[ndim] = new EtchValidatorDouble(ndim);
+  if (Validators(runtime)[ndim].get() == NULL) {
+    Validators(runtime)[ndim] = new EtchValidatorDouble(ndim);
+    CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchValidatorDouble has been created");
   }
-  val = Validators()[ndim];
+  val = Validators(runtime)[ndim];
   return ETCH_OK;
 }
 
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorFloat.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorFloat.cpp
index 3de2b62..86ef9bc 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorFloat.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorFloat.cpp
@@ -17,11 +17,13 @@
  */
 
 #include "serialization/EtchValidatorFloat.h"
+#include "support/EtchRuntime.h"
 
-capu::SmartPointer<EtchValidator>* EtchValidatorFloat::Validators()
-{
-  static capu::SmartPointer<EtchValidator> ret[MAX_CACHED];
-  return &(ret[0]);
+static const char* TAG = "EtchValidatorFloat";
+
+capu::SmartPointer<EtchValidator>* EtchValidatorFloat::Validators(EtchRuntime* runtime) {
+  static EtchValidatorCaches validators;
+  return validators.get(runtime);
 }
 
 const EtchObjectType* EtchValidatorFloat::TYPE() {
@@ -31,11 +33,11 @@
 
 EtchValidatorFloat::EtchValidatorFloat(capu::uint32_t ndim)
 : EtchTypeValidator(EtchValidatorFloat::TYPE(), EtchFloat::TYPE(), EtchFloat::TYPE(), ndim) {
-
+  //TODO rafactor this

+  mRuntime = EtchRuntime::getRuntime();
 }
 
 EtchValidatorFloat::~EtchValidatorFloat() {
-
 }
 
 capu::bool_t EtchValidatorFloat::validate(capu::SmartPointer<EtchObject> value) {
@@ -63,13 +65,18 @@
 status_t EtchValidatorFloat::validateValue(capu::SmartPointer<EtchObject> value, capu::SmartPointer<EtchObject>& result) {
   if (validate(value)) {
     result = value;
+    CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Object has been validated");
     return ETCH_OK;
   } else {
+    CAPU_LOG_WARN(mRuntime->getLogger(), TAG, "Object has not been validated");
     return ETCH_ERROR;
   }
 }
 
 status_t EtchValidatorFloat::Get(capu::uint32_t ndim, capu::SmartPointer<EtchValidator> &val) {
+  //TODO rafactor this

+  EtchRuntime* runtime = EtchRuntime::getRuntime();
+
   if (ndim > MAX_NDIMS) {
     return ETCH_EINVAL;
   }
@@ -77,10 +84,11 @@
     val = new EtchValidatorFloat(ndim);
     return ETCH_OK;
   }
-  if (Validators()[ndim].get() == NULL) {
-    Validators()[ndim] = new EtchValidatorFloat(ndim);
+  if (Validators(runtime)[ndim].get() == NULL) {
+    Validators(runtime)[ndim] = new EtchValidatorFloat(ndim);
+    CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchValidatorFloat has been created");
   }
-  val = Validators()[ndim];
+  val = Validators(runtime)[ndim];
   return ETCH_OK;
 }
 
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorInt.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorInt.cpp
index 9e45168..bfeef41 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorInt.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorInt.cpp
@@ -17,11 +17,13 @@
  */
 
 #include "serialization/EtchValidatorInt.h"
+#include "support/EtchRuntime.h"
 
-capu::SmartPointer<EtchValidator>* EtchValidatorInt::Validators()
-{
-  static capu::SmartPointer<EtchValidator> ret[MAX_CACHED];
-  return &(ret[0]);
+static const char* TAG = "EtchValidatorInt";
+
+capu::SmartPointer<EtchValidator>* EtchValidatorInt::Validators(EtchRuntime* runtime) {
+  static EtchValidatorCaches validators;
+  return validators.get(runtime);
 }
 
 const EtchObjectType* EtchValidatorInt::TYPE() {
@@ -31,7 +33,8 @@
 
 EtchValidatorInt::EtchValidatorInt(capu::uint32_t ndim)
 : EtchTypeValidator(EtchValidatorInt::TYPE(), EtchInt32::TYPE(), EtchInt32::TYPE(), ndim) {
-
+  //TODO rafactor this

+  mRuntime = EtchRuntime::getRuntime();
 }
 
 EtchValidatorInt::~EtchValidatorInt() {
@@ -75,33 +78,42 @@
   if (validate(value)) {
     if ((value->getObjectType()->equals(EtchInt32::TYPE())) || (mNDims > 0)) {
       result = value;
+      CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Object has been validated");
       return ETCH_OK;
     } else {
       if (value->getObjectType()->equals(EtchShort::TYPE())) {
         EtchShort *v = (EtchShort *) value.get();
         result = new EtchInt32((capu::int32_t)v->get());
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "EtchShort has been validated by EtchValidatorInt and converted to EtchInt32");
         return ETCH_OK;
       }
 
       if (value->getObjectType()->equals(EtchByte::TYPE())) {
         EtchByte *v = (EtchByte *) value.get();
         result = new EtchInt32((capu::int32_t)v->get());
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "EtchByte has been validated by EtchValidatorInt and converted to EtchInt32");
         return ETCH_OK;
       }
 
       if (value->getObjectType()->equals(EtchLong::TYPE())) {
         EtchLong *v = (EtchLong *) value.get();
         result = new EtchInt32((capu::int32_t)v->get());
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "EtchLong has been validated by EtchValidatorInt and converted to EtchInt32");
         return ETCH_OK;
       }
+      CAPU_LOG_WARN(mRuntime->getLogger(), TAG, "Object has not been validated");
       return ETCH_ERROR;
     }
   } else {
+    CAPU_LOG_WARN(mRuntime->getLogger(), TAG, "Object has not been validated");
     return ETCH_ERROR;
   }
 }
 
 status_t EtchValidatorInt::Get(capu::uint32_t ndim, capu::SmartPointer<EtchValidator> &val) {
+  //TODO rafactor this

+  EtchRuntime* runtime = EtchRuntime::getRuntime();
+
   if (ndim > MAX_NDIMS) {
     return ETCH_EINVAL;
   }
@@ -109,10 +121,11 @@
     val = new EtchValidatorInt(ndim);
     return ETCH_OK;
   }
-  if (Validators()[ndim].get() == NULL) {
-    Validators()[ndim] = new EtchValidatorInt(ndim);
+  if (Validators(runtime)[ndim].get() == NULL) {
+    Validators(runtime)[ndim] = new EtchValidatorInt(ndim);
+    CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchValidatorInt has been created");
   }
-  val = Validators()[ndim];
+  val = Validators(runtime)[ndim];
   return ETCH_OK;
 }
 
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorLong.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorLong.cpp
index 9698692..75cd466 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorLong.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorLong.cpp
@@ -17,11 +17,13 @@
  */
 
 #include "serialization/EtchValidatorLong.h"
+#include "support/EtchRuntime.h"
 
-capu::SmartPointer<EtchValidator>* EtchValidatorLong::Validators()
-{
-  static capu::SmartPointer<EtchValidator> ret[MAX_CACHED];
-  return &(ret[0]);
+static const char* TAG = "EtchValidatorLong";
+
+capu::SmartPointer<EtchValidator>* EtchValidatorLong::Validators(EtchRuntime* runtime) {
+  static EtchValidatorCaches validators;
+  return validators.get(runtime);
 }
 
 const EtchObjectType* EtchValidatorLong::TYPE() {
@@ -31,11 +33,11 @@
 
 EtchValidatorLong::EtchValidatorLong(capu::uint32_t ndim)
 : EtchTypeValidator(EtchValidatorLong::TYPE(), EtchLong::TYPE(), EtchLong::TYPE(), ndim) {
-
+  //TODO rafactor this

+  mRuntime = EtchRuntime::getRuntime();
 }
 
 EtchValidatorLong::~EtchValidatorLong() {
-
 }
 
 capu::bool_t EtchValidatorLong::validate(capu::SmartPointer<EtchObject> value) {
@@ -70,33 +72,42 @@
   if (validate(value)) {
     if ((value->getObjectType()->equals(EtchLong::TYPE())) || (mNDims > 0)) {
       result = value;
+      CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Object has been validated");
       return ETCH_OK;
     } else {
       if (value->getObjectType()->equals(EtchShort::TYPE())) {
         EtchShort *v = (EtchShort *) value.get();
         result = new EtchLong((capu::int64_t)v->get());
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "EtchShort has been validated by EtchValidatorInt and converted to EtchLong");
         return ETCH_OK;
       }
 
       if (value->getObjectType()->equals(EtchByte::TYPE())) {
         EtchByte *v = (EtchByte *) value.get();
         result = new EtchLong((capu::int64_t)v->get());
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "EtchByte has been validated by EtchValidatorInt and converted to EtchLong");
         return ETCH_OK;
       }
 
       if (value->getObjectType()->equals(EtchInt32::TYPE())) {
         EtchInt32 *v = (EtchInt32 *) value.get();
         result = new EtchLong((capu::int64_t)v->get());
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "EtchInt32 has been validated by EtchValidatorInt and converted to EtchLong");
         return ETCH_OK;
       }
+      CAPU_LOG_WARN(mRuntime->getLogger(), TAG, "Object has not been validated");
       return ETCH_ERROR;
     }
   } else {
+    CAPU_LOG_WARN(mRuntime->getLogger(), TAG, "Object has not been validated");
     return ETCH_ERROR;
   }
 }
 
 status_t EtchValidatorLong::Get(capu::uint32_t ndim, capu::SmartPointer<EtchValidator> &val) {
+  //TODO rafactor this

+  EtchRuntime* runtime = EtchRuntime::getRuntime();
+
   if (ndim > MAX_NDIMS) {
     return ETCH_EINVAL;
   }
@@ -104,10 +115,11 @@
     val = new EtchValidatorLong(ndim);
     return ETCH_OK;
   }
-  if (Validators()[ndim].get() == NULL) {
-    Validators()[ndim] = new EtchValidatorLong(ndim);
+  if (Validators(runtime)[ndim].get() == NULL) {
+    Validators(runtime)[ndim] = new EtchValidatorLong(ndim);
+    CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchValidatorLong has been created");
   }
-  val = Validators()[ndim];
+  val = Validators(runtime)[ndim];
   return ETCH_OK;
 }
 
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorNone.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorNone.cpp
index 2aee0ac..736d882 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorNone.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorNone.cpp
@@ -17,10 +17,11 @@
  */
 
 #include "serialization/EtchValidatorNone.h"
+#include "support/EtchRuntime.h"
 
-capu::SmartPointer<EtchValidator>& EtchValidatorNone::Validators() {
-  static capu::SmartPointer<EtchValidator> ret = NULL;
-  return ret;
+capu::SmartPointer<EtchValidator>* EtchValidatorNone::Validators(EtchRuntime* runtime) {
+  static EtchValidatorCaches validators;
+  return validators.get(runtime);
 }
 
 const EtchObjectType* EtchValidatorNone::TYPE() {
@@ -30,10 +31,11 @@
 
 EtchValidatorNone::EtchValidatorNone()
 : EtchValidator(EtchValidatorNone::TYPE()) {
+  //TODO rafactor this

+  mRuntime = EtchRuntime::getRuntime();
 }
 
 EtchValidatorNone::~EtchValidatorNone() {
-
 }
 
 capu::bool_t EtchValidatorNone::validate(capu::SmartPointer<EtchObject> value) {
@@ -43,17 +45,23 @@
 status_t EtchValidatorNone::validateValue(capu::SmartPointer<EtchObject> value, capu::SmartPointer<EtchObject>& result) {
   if (validate(value)) {
     result = value;
+    CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorNone", "NONE has been validated");
     return ETCH_OK;
   } else {
+    CAPU_LOG_WARN(mRuntime->getLogger(), "EtchValidatorNone", "NONE has not been validated");
     return ETCH_ERROR;
   }
 }
 
 status_t EtchValidatorNone::Get(capu::SmartPointer<EtchValidator> &val) {
-  if (Validators().get() == NULL) {
-    Validators() = new EtchValidatorNone();
+  //TODO rafactor this

+  EtchRuntime* runtime = EtchRuntime::getRuntime();
+
+  if (Validators(runtime)[0].get() == NULL) {
+    Validators(runtime)[0] = new EtchValidatorNone();
+    CAPU_LOG_TRACE(runtime->getLogger(), "EtchValidatorNone", "EtchValidatorNone has been created");
   }
-  val = Validators();
+  val = Validators(runtime)[0];
   return ETCH_OK;
 }
 
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorObject.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorObject.cpp
index b714ddd..f6f7e4c 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorObject.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorObject.cpp
@@ -17,12 +17,11 @@
  */
 
 #include "serialization/EtchValidatorObject.h"
+#include "support/EtchRuntime.h"
 
-
-capu::SmartPointer<EtchValidator>* EtchValidatorObject::Validators()
-{
-  static capu::SmartPointer<EtchValidator> ret[MAX_CACHED];
-  return &(ret[0]);
+capu::SmartPointer<EtchValidator>* EtchValidatorObject::Validators(EtchRuntime* runtime) {
+  static EtchValidatorCaches validators;
+  return validators.get(runtime);
 }
 
 const EtchObjectType* EtchValidatorObject::TYPE() {
@@ -32,11 +31,12 @@
 
 EtchValidatorObject::EtchValidatorObject(capu::uint32_t ndim)
 : EtchTypeValidator(EtchValidatorObject::TYPE(), EtchObject::TYPE(), EtchObject::TYPE(), ndim) {
+  //TODO rafactor this

+  mRuntime = EtchRuntime::getRuntime();
   mSubclass = true;
 }
 
 EtchValidatorObject::~EtchValidatorObject() {
-
 }
 
 capu::bool_t EtchValidatorObject::validate(capu::SmartPointer<EtchObject> value) {
@@ -52,23 +52,30 @@
 status_t EtchValidatorObject::validateValue(capu::SmartPointer<EtchObject> value, capu::SmartPointer<EtchObject>& result) {
   if (validate(value)) {
     result = value;
+    CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorObject", "Object has been validated");
     return ETCH_OK;
   } else {
+    CAPU_LOG_WARN(mRuntime->getLogger(), "EtchValidatorObject", "Object has not been validated");
     return ETCH_ERROR;
   }
 }
 
 status_t EtchValidatorObject::Get(capu::uint32_t ndim, capu::SmartPointer<EtchValidator> &val) {
+  //TODO rafactor this

+  EtchRuntime* runtime = EtchRuntime::getRuntime();

+  
   if (ndim > MAX_NDIMS)
     return ETCH_EINVAL;
   if (ndim >= MAX_CACHED) {
     val = new EtchValidatorObject(ndim);
     return ETCH_OK;
   }
-  if (Validators()[ndim].get() == NULL) {
-    Validators()[ndim] = new EtchValidatorObject(ndim);
+  //TODO thread safety
+  if (Validators(runtime)[ndim].get() == NULL) {
+    CAPU_LOG_TRACE(runtime->getLogger(), "EtchValidatorObject", "EtchValidatorObject has been created");
+    Validators(runtime)[ndim] = new EtchValidatorObject(ndim);
   }
-  val = Validators()[ndim];
+  val = Validators(runtime)[ndim];
   return ETCH_OK;
 }
 
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorRuntimeException.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorRuntimeException.cpp
index 3b73d5a..4ce7de5 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorRuntimeException.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorRuntimeException.cpp
@@ -17,13 +17,15 @@
  */
 
 #include "serialization/EtchValidatorRuntimeException.h"
+#include "support/EtchRuntime.h"
 
-capu::SmartPointer<EtchValidator>& EtchValidatorRuntimeException::Validators() {
-  static capu::SmartPointer<EtchValidator> ret;
-  return ret;
+static const char* TAG = "EtchValidatorRuntimeException";
+
+capu::SmartPointer<EtchValidator>* EtchValidatorRuntimeException::Validators(EtchRuntime* runtime) {
+  static EtchValidatorCaches validators;
+  return validators.get(runtime);
 }
 
-
 const EtchObjectType* EtchValidatorRuntimeException::TYPE() {
   const static EtchObjectType TYPE(EOTID_VALIDATOR_RUNTIME_EXCEPTION, NULL);
   return &TYPE;
@@ -31,11 +33,11 @@
 
 EtchValidatorRuntimeException::EtchValidatorRuntimeException()
 : EtchValidator(EtchValidatorRuntimeException::TYPE()) {
-
+  //TODO rafactor this

+  mRuntime = EtchRuntime::getRuntime();
 }
 
 EtchValidatorRuntimeException::~EtchValidatorRuntimeException() {
-
 }
 
 capu::bool_t EtchValidatorRuntimeException::validate(capu::SmartPointer<EtchObject> value) {
@@ -47,16 +49,23 @@
 status_t EtchValidatorRuntimeException::validateValue(capu::SmartPointer<EtchObject> value, capu::SmartPointer<EtchObject>& result) {
   if (validate(value)) {
     result = value;
+    CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorRuntimeException", "EtchRuntimeException has been validated");
     return ETCH_OK;
   } else {
+    CAPU_LOG_WARN(mRuntime->getLogger(), "EtchValidatorRuntimeException", "EtchRuntimeException has not been validated");
     return ETCH_ERROR;
   }
 }
 
 status_t EtchValidatorRuntimeException::Get(capu::SmartPointer<EtchValidator> &val) {
-  if (Validators().get() == NULL)
-    Validators() = new EtchValidatorRuntimeException();
-  val = Validators();
+  //TODO rafactor this

+  EtchRuntime* runtime = EtchRuntime::getRuntime();
+
+  if (Validators(runtime)[0].get() == NULL) {
+    Validators(runtime)[0] = new EtchValidatorRuntimeException();
+    CAPU_LOG_TRACE(runtime->getLogger(), "EtchValidatorRuntimeException", "EtchValidatorRuntimeException has been created");
+  }
+  val = Validators(runtime)[0];
   return ETCH_OK;
 }
 
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorShort.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorShort.cpp
index dbd4897..a6e56b8 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorShort.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorShort.cpp
@@ -17,14 +17,15 @@
  */
 
 #include "serialization/EtchValidatorShort.h"
+#include "support/EtchRuntime.h"
 
-capu::SmartPointer<EtchValidator>* EtchValidatorShort::Validators()
-{
-  static capu::SmartPointer<EtchValidator> ret[MAX_CACHED];
-  return &(ret[0]);
+static const char* TAG = "EtchValidatorShort";
+
+capu::SmartPointer<EtchValidator>* EtchValidatorShort::Validators(EtchRuntime* runtime) {
+  static EtchValidatorCaches validators;
+  return validators.get(runtime);
 }
 
-
 const EtchObjectType* EtchValidatorShort::TYPE() {
   const static EtchObjectType TYPE(EOTID_VALIDATOR_SHORT, NULL);
   return &TYPE;
@@ -32,11 +33,11 @@
 
 EtchValidatorShort::EtchValidatorShort(capu::uint32_t ndim)
 : EtchTypeValidator(EtchValidatorShort::TYPE(), EtchShort::TYPE(), EtchShort::TYPE(), ndim) {
-
+  //TODO rafactor this

+  mRuntime = EtchRuntime::getRuntime();
 }
 
 EtchValidatorShort::~EtchValidatorShort() {
-
 }
 
 capu::bool_t EtchValidatorShort::validate(capu::SmartPointer<EtchObject> value) {
@@ -79,33 +80,43 @@
   if (validate(value)) {
     if ((value->getObjectType()->equals(EtchShort::TYPE())) || (mNDims > 0)) {
       result = value;
+      CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorShort", "Object has been validated");
       return ETCH_OK;
     } else {
       if (value->getObjectType()->equals(EtchInt32::TYPE())) {
         EtchInt32 *v = (EtchInt32 *) value.get();
         result = new EtchShort((capu::int16_t)v->get());
+        CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorShort", "EtchInt32 has been validated by EtchValidatorInt and converted to EtchShort");
         return ETCH_OK;
       }
 
       if (value->getObjectType()->equals(EtchByte::TYPE())) {
         EtchByte *v = (EtchByte *) value.get();
         result = new EtchShort((capu::int16_t)v->get());
+        CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorShort", "EtchByte has been validated by EtchValidatorInt and converted to EtchShort");
         return ETCH_OK;
       }
 
       if (value->getObjectType()->equals(EtchLong::TYPE())) {
         EtchLong *v = (EtchLong *) value.get();
         result = new EtchShort((capu::int16_t)v->get());
+        CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchValidatorShort", "EtchLong has been validated by EtchValidatorInt and converted to EtchShort");
         return ETCH_OK;
       }
+
+      CAPU_LOG_WARN(mRuntime->getLogger(), "EtchValidatorShort", "Object has not been validated");
       return ETCH_ERROR;
     }
   } else {
+    CAPU_LOG_WARN(mRuntime->getLogger(), "EtchValidatorShort", "Object has not been validated");
     return ETCH_ERROR;
   }
 }
 
 status_t EtchValidatorShort::Get(capu::uint32_t ndim, capu::SmartPointer<EtchValidator> &val) {
+  //TODO rafactor this

+  EtchRuntime* runtime = EtchRuntime::getRuntime();

+
   if (ndim > MAX_NDIMS) {
     return ETCH_EINVAL;
   }
@@ -113,10 +124,11 @@
     val = new EtchValidatorShort(ndim);
     return ETCH_OK;
   }
-  if (Validators()[ndim].get() == NULL) {
-    Validators()[ndim] = new EtchValidatorShort(ndim);
+  if (Validators(runtime)[ndim].get() == NULL) {
+    CAPU_LOG_TRACE(runtime->getLogger(), "EtchValidatorShort", "EtchValidatorShort has been created");
+    Validators(runtime)[ndim] = new EtchValidatorShort(ndim);
   }
-  val = Validators()[ndim];
+  val = Validators(runtime)[ndim];
   return ETCH_OK;
 }
 
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorString.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorString.cpp
index 2404205..a9f7b53 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorString.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorString.cpp
@@ -17,11 +17,13 @@
  */
 
 #include "serialization/EtchValidatorString.h"
+#include "support/EtchRuntime.h"
 
-capu::SmartPointer<EtchValidator>* EtchValidatorString::Validators()
-{
-  static capu::SmartPointer<EtchValidator> ret[MAX_CACHED];
-  return &(ret[0]);
+static const char* TAG = "EtchValidatorString";
+
+capu::SmartPointer<EtchValidator>* EtchValidatorString::Validators(EtchRuntime* runtime) {
+  static EtchValidatorCaches validators;
+  return validators.get(runtime);
 }
 
 const EtchObjectType* EtchValidatorString::TYPE() {
@@ -31,11 +33,11 @@
 
 EtchValidatorString::EtchValidatorString(capu::uint32_t ndim)
 : EtchTypeValidator(EtchValidatorString::TYPE(), EtchString::TYPE(), EtchString::TYPE(), ndim) {
-
+  //TODO rafactor this
+  mRuntime = EtchRuntime::getRuntime();
 }
 
 EtchValidatorString::~EtchValidatorString() {
-
 }
 
 capu::bool_t EtchValidatorString::validate(capu::SmartPointer<EtchObject> value) {
@@ -61,13 +63,18 @@
 status_t EtchValidatorString::validateValue(capu::SmartPointer<EtchObject> value, capu::SmartPointer<EtchObject>& result) {
   if (validate(value)) {
     result = value;
+    CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "String has been validated");
     return ETCH_OK;
   } else {
+    CAPU_LOG_WARN(mRuntime->getLogger(), TAG, "String has not been validated");
     return ETCH_ERROR;
   }
 }
 
 status_t EtchValidatorString::Get(capu::uint32_t ndim, capu::SmartPointer<EtchValidator> &val) {
+  //TODO rafactor this

+  EtchRuntime* runtime = EtchRuntime::getRuntime();
+
   if (ndim > MAX_NDIMS) {
     return ETCH_EINVAL;
   }
@@ -75,10 +82,11 @@
     val = new EtchValidatorString(ndim);
     return ETCH_OK;
   }
-  if (Validators()[ndim].get() == NULL) {
-    Validators()[ndim] = new EtchValidatorString(ndim);
+  if (Validators(runtime)[ndim].get() == NULL) {
+    Validators(runtime)[ndim] = new EtchValidatorString(ndim);
+    CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchValidatorString has been created");
   }
-  val = Validators()[ndim];
+  val = Validators(runtime)[ndim];
   return ETCH_OK;
 }
 
diff --git a/binding-cpp/runtime/src/main/serialization/EtchValidatorStructValue.cpp b/binding-cpp/runtime/src/main/serialization/EtchValidatorStructValue.cpp
index 07c67bc..035bd2e 100644
--- a/binding-cpp/runtime/src/main/serialization/EtchValidatorStructValue.cpp
+++ b/binding-cpp/runtime/src/main/serialization/EtchValidatorStructValue.cpp
@@ -17,27 +17,31 @@
  */
 
 #include "serialization/EtchValidatorStructValue.h"
+#include "support/EtchRuntime.h"
+
+static char* TAG = "EtchValidatorStructValue";
 
 const EtchObjectType* EtchValidatorStructValue::TYPE() {
   const static EtchObjectType TYPE(EOTID_VALIDATOR_STRUCT_VALUE, NULL);
   return &TYPE;
 }
 
-
 EtchValidatorStructValue::EtchValidatorStructValue(EtchType* type, capu::uint32_t ndim)
 : EtchTypeValidator(EtchValidatorStructValue::TYPE(), EtchStructValue::TYPE(), EtchStructValue::TYPE(), ndim), mType(type) {
-
+  //TODO refactor this
+  mRuntime = EtchRuntime::getRuntime();
 }
 
 EtchValidatorStructValue::~EtchValidatorStructValue() {
-
 }
 
 status_t EtchValidatorStructValue::validateValue(capu::SmartPointer<EtchObject> value, capu::SmartPointer<EtchObject>& result) {
   if (validate(value)) {
     result = value;
+    CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Object has been validated");
     return ETCH_OK;
   } else {
+    CAPU_LOG_WARN(mRuntime->getLogger(), TAG, "Object has not been validated");
     return ETCH_ERROR;
   }
 }
@@ -68,8 +72,13 @@
 }
 
 status_t EtchValidatorStructValue::Get(EtchType* type, capu::uint32_t ndim, capu::SmartPointer<EtchValidator> &val) {
-  if (ndim > MAX_NDIMS)
+  //TODO rafactor this
+  EtchRuntime* runtime = EtchRuntime::getRuntime();
+
+  if (ndim > MAX_NDIMS) {
     return ETCH_EINVAL;
+  }
+  CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchValidatorShort has been created");
   val = capu::SmartPointer <EtchValidator > (new EtchValidatorStructValue(type, ndim));
   return ETCH_OK;
 }
diff --git a/binding-cpp/runtime/src/main/support/EtchRemoteBase.cpp b/binding-cpp/runtime/src/main/support/EtchRemoteBase.cpp
index 5a648e0..13d2931 100644
--- a/binding-cpp/runtime/src/main/support/EtchRemoteBase.cpp
+++ b/binding-cpp/runtime/src/main/support/EtchRemoteBase.cpp
@@ -18,9 +18,15 @@
 
 #include "support/EtchRemoteBase.h"
 #include "transport/EtchTransportData.h"
+#include "support/EtchRuntime.h"
+#include "util/EtchLogger.h"
+
+static char* TAG = "EtchRemoteBase";
 
 EtchRemoteBase::EtchRemoteBase(EtchDeliveryService* svc, EtchValueFactory* vf) 
   : mSvc(svc), mVf(vf) {
+  //TODO refactor this
+  mRuntime = EtchRuntime::getRuntime();
 }
 
 EtchRemoteBase::~EtchRemoteBase() {
@@ -39,10 +45,12 @@
 }
 
 status_t EtchRemoteBase::begincall(capu::SmartPointer<EtchMessage> msg, EtchMailbox *&result) {
+  CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "Begin call for the message is initiated");  
   return mSvc->begincall(msg, result);
 }
 
 status_t EtchRemoteBase::endcall(EtchMailbox* mb, EtchType* responseType, capu::SmartPointer<EtchObject> &result) {
+  CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "End call for the message is initiated");
   return mSvc->endcall(mb, responseType, result);
 }
 
diff --git a/binding-cpp/runtime/src/main/support/EtchRuntime.cpp b/binding-cpp/runtime/src/main/support/EtchRuntime.cpp
index 3ea1ac8..f23accf 100644
--- a/binding-cpp/runtime/src/main/support/EtchRuntime.cpp
+++ b/binding-cpp/runtime/src/main/support/EtchRuntime.cpp
@@ -19,12 +19,20 @@
 #include "common/EtchRuntimeException.h"
 #include "support/EtchRuntime.h"
 #include "support/EtchTransportHelper.h"
+#include "util/EtchLogger.h"
 
-EtchRuntime::EtchRuntime() 
-  : mIsClosed(false){
+//TODO remove this after refactoring
+EtchRuntime* EtchRuntime::sRuntime = NULL;
+
+EtchRuntime::EtchRuntime()
+  : mIsClosed(false)
+  , mLogger(NULL) {
   mMutex.lock();
   mId = getNextId();
   mMutex.unlock();
+
+  //TODO remove this after refactoring
+  sRuntime = this;
 }
 
 EtchRuntime::~EtchRuntime() {
@@ -42,7 +50,7 @@
   if(listener == NULL) {
     return ETCH_EINVAL;
   }
-  
+
   mMutex.lock();
   mListeners.add(listener);
   mMutex.unlock();
@@ -92,3 +100,20 @@
   static capu::uint64_t sId = 0;
   return sId++;
 }
+
+status_t EtchRuntime::setLogger(EtchLogger* logger) {
+  if(logger == NULL) {
+    return ETCH_EINVAL;
+  }
+  mLogger = logger;
+  return ETCH_OK;
+}
+
+EtchLogger* EtchRuntime::getLogger() {
+  return mLogger;
+}
+
+EtchRuntime* EtchRuntime::getRuntime() {
+  return sRuntime;
+}
+
diff --git a/binding-cpp/runtime/src/main/support/EtchTransportHelper.cpp b/binding-cpp/runtime/src/main/support/EtchTransportHelper.cpp
index d07c2ed..781f9ca 100644
--- a/binding-cpp/runtime/src/main/support/EtchTransportHelper.cpp
+++ b/binding-cpp/runtime/src/main/support/EtchTransportHelper.cpp
@@ -19,6 +19,9 @@
 #include "support/EtchFreePool.h"
 #include "support/EtchQueuedPool.h"
 #include "support/EtchTransportHelper.h"
+#include "support/EtchRuntime.h"
+#include "util/EtchLogger.h"
+
 
 const EtchString& EtchTransportHelper::QUEUED_POOL() {
   static const EtchString pool("QUEUED_POOL");
@@ -46,6 +49,9 @@
     resources = new EtchResources(*resources);
   }
 
+  //TODO rafactor this
+  EtchRuntime* runtime = EtchRuntime::getRuntime();
+
   EtchObject* obj = NULL;
   EtchObject* objOld = NULL;
   // Queued Pool
@@ -61,6 +67,8 @@
     resources->put( EtchTransportHelper::FREE_POOL(), obj, objOld);
   }
   result = resources;
+  CAPU_LOG_TRACE(runtime->getLogger(), "EtchTransportHelper", "Resources and pools have been allocated initialized");
+
   return ETCH_OK;
 }
 
@@ -69,6 +77,9 @@
   if (resources == NULL) {
     return ETCH_EINVAL;
   } else {
+    //TODO rafactor this
+    EtchRuntime* runtime = EtchRuntime::getRuntime();
+
     EtchObject* returnValue = NULL;
     
     //get queued pool and delete it
@@ -92,7 +103,7 @@
 
     //delete resource
     delete resources;
-
+    CAPU_LOG_TRACE(runtime->getLogger(), "EtchTransportHelper", "Resources and pools have been deallocated");
     return ETCH_OK;
   }
 }
diff --git a/binding-cpp/runtime/src/main/transport/EtchDefaultDeliveryService.cpp b/binding-cpp/runtime/src/main/transport/EtchDefaultDeliveryService.cpp
index ae66358..67c07eb 100644
--- a/binding-cpp/runtime/src/main/transport/EtchDefaultDeliveryService.cpp
+++ b/binding-cpp/runtime/src/main/transport/EtchDefaultDeliveryService.cpp
@@ -19,6 +19,11 @@
  */
 
 #include "transport/EtchDefaultDeliveryService.h"
+#include "support/EtchRuntime.h"
+#include "util/EtchLogger.h"
+
+static char* TAG = "EtchDefaultDeliveryService";
+
 const EtchString& EtchDefaultDeliveryService::DISABLE_TIMEOUT() {
   static const EtchString name("DefaultDeliveryService.disableTimeout");
   return name;
@@ -26,12 +31,18 @@
 
 EtchDefaultDeliveryService::EtchDefaultDeliveryService(EtchMailboxManager* transport, const EtchString& uri)
 : mTransport(transport), mStatus(EtchString("session status"), EtchString("")) {
+  //TODO refactor this
+  mRuntime = EtchRuntime::getRuntime();
+
   EtchURL url(uri);
   init(&url);
 }
 
 EtchDefaultDeliveryService::EtchDefaultDeliveryService(EtchMailboxManager* transport, EtchURL* uri)
 : mTransport(transport), mStatus(EtchString("session status"), EtchString("")) {
+  //TODO refactor this
+  mRuntime = EtchRuntime::getRuntime();
+
   init(uri);
 }
 
@@ -92,10 +103,12 @@
 }
 
 status_t EtchDefaultDeliveryService::sessionMessage(capu::SmartPointer<EtchWho> sender, capu::SmartPointer<EtchMessage> msg) {
+  CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "Message will be passed to StubBase to execute the respective remote call");
   return mSession->sessionMessage(sender, msg);
 }
 
 status_t EtchDefaultDeliveryService::transportMessage(capu::SmartPointer<EtchWho> recipient, capu::SmartPointer<EtchMessage> message) {
+  CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "Result of respective remote call will be passed to Mailbox Manager");
   return mTransport->transportMessage(recipient, message);
 }
 
@@ -139,6 +152,7 @@
 }
 
 status_t EtchDefaultDeliveryService::begincall(capu::SmartPointer<EtchMessage> msg, EtchMailbox*& result) {
+  CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "Begin call for the message has been initiated");  
   return mTransport->transportCall(NULL, msg, result);
 }
 
@@ -149,16 +163,20 @@
 
   //get message from mailbox
   EtchMailbox::EtchElement* mbe = NULL;
+  CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "End call for the message starts");
   status_t res = mb->read(mbe, timeout);
   if (res != ETCH_OK) {
     mb->closeRead();
-    //TODO: Add error handling and logging
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Error on mailbox read, might be caused by timeout"); 
+    //TODO: Add error handling
     return res;
   }
+  CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "We got a message in the mailbox");
 
   //get reply message and responseType
   capu::SmartPointer<EtchMessage> rmsg = mbe->mMsg;
   if (!rmsg->isType(responseType)) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Error on response Type");
     mb->closeRead();
     rmsg->clear();
     delete mbe;
@@ -172,21 +190,22 @@
   if (err == ETCH_ENOT_EXIST) {
     //void return value
     mb->closeRead();
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "End call for the message is completed");
     return ETCH_OK;
   } else if (err != ETCH_OK) {
     mb->closeRead();
     rmsg->clear();
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Error on getting respective field on message structure"); 
     delete mbe;
     return ETCH_ERROR;
   }
   if (r->getObjectType()->equals(EtchRuntimeException::TYPE())) {
     //TODO: handle error
   }
-
   delete mbe;
   result = r;
-
   mb->closeRead();
+  CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "End call for the message is completed");
   return ETCH_OK;
 }
 
diff --git a/binding-cpp/runtime/src/main/transport/EtchMessage.cpp b/binding-cpp/runtime/src/main/transport/EtchMessage.cpp
index d089681..6cb9cae 100644
--- a/binding-cpp/runtime/src/main/transport/EtchMessage.cpp
+++ b/binding-cpp/runtime/src/main/transport/EtchMessage.cpp
@@ -17,6 +17,7 @@
  */
 
 #include "transport/EtchMessage.h"
+#include "support/EtchRuntime.h"
 
 EtchMessage::EtchMessage(EtchType* type, EtchValueFactory* vf)
 : EtchStructValue(type, vf), mVf(vf) {
diff --git a/binding-cpp/runtime/src/main/transport/EtchMessagizer.cpp b/binding-cpp/runtime/src/main/transport/EtchMessagizer.cpp
index ae754fa..deee7f4 100644
--- a/binding-cpp/runtime/src/main/transport/EtchMessagizer.cpp
+++ b/binding-cpp/runtime/src/main/transport/EtchMessagizer.cpp
@@ -16,6 +16,9 @@
  * limitations under the License.
  */
 #include "transport/EtchMessagizer.h"
+#include "support/EtchRuntime.h"
+
+static char* TAG = "EtchMessagizer";
 
 const EtchString& EtchMessagizer::FORMAT(){
   static const EtchString name("Messagizer.format");
@@ -25,6 +28,9 @@
 
 EtchMessagizer::EtchMessagizer(EtchTransportPacket* transport, EtchURL* uri, EtchResources* resources)
 : mTransport(transport) {
+  //TODO refactor this
+  mRuntime = EtchRuntime::getRuntime();
+
   EtchString format;
   EtchObject * val;
   resources->get(EtchTransport<EtchSessionMessage>::VALUE_FACTORY(), val);
@@ -94,8 +100,10 @@
   capu::SmartPointer<EtchMessage> message;
   result = mTdi->readMessage(buf, message);
   if (result != ETCH_OK) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Deserialization of messages has been failed");
     return result;
   }
+  CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "Message has been deserialized and passed to the Mailbox Manager");
   result = mSession->sessionMessage(sender, message);
   if (result != ETCH_OK) {
     EtchString errmsg("Unwanted Message");
@@ -125,10 +133,12 @@
   }
   result = mTdo->writeMessage(message, msgBuf);
   if (result != ETCH_OK){
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Serialization of messages has been failed");
     mutex.unlock();
     return result;
   }
   msgBuf->setIndex(0);
+  CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "Serialized message has been sent to the Packetizer");
   result = mTransport->transportPacket(recipient, msgBuf);
   if (result != ETCH_OK) {
     mutex.unlock();
diff --git a/binding-cpp/runtime/src/main/transport/EtchPacketizer.cpp b/binding-cpp/runtime/src/main/transport/EtchPacketizer.cpp
index 6ade268..7b8155f 100644
--- a/binding-cpp/runtime/src/main/transport/EtchPacketizer.cpp
+++ b/binding-cpp/runtime/src/main/transport/EtchPacketizer.cpp
@@ -17,6 +17,9 @@
  */
 
 #include "transport/EtchPacketizer.h"
+#include "support/EtchRuntime.h"
+
+static const char* TAG = "EtchPacketizer";
 
 const capu::uint32_t& EtchPacketizer::HEADER_SIZE() {
   static const capu::uint32_t headerSize(8);
@@ -40,6 +43,8 @@
 
 EtchPacketizer::EtchPacketizer(EtchTransportData* transport, EtchString& uri)
 : mTransport(transport), mBodyLen(0), mWantHeader(true) {
+  //TODO rafactor this

+  mRuntime = EtchRuntime::getRuntime();

 
   if (mTransport != NULL)
     mTransport->setSession(this);
@@ -60,6 +65,9 @@
 
 EtchPacketizer::EtchPacketizer(EtchTransportData* transport, EtchURL* uri)
 : mTransport(transport), mBodyLen(0), mWantHeader(true) {
+  //TODO rafactor this

+  mRuntime = EtchRuntime::getRuntime();
+
   EtchString value("");
   if (mTransport != NULL)
     transport->setSession(this);
@@ -77,7 +85,7 @@
 }
 
 EtchPacketizer::~EtchPacketizer() {
-  if(mTransport != NULL)
+  if (mTransport != NULL)
     delete mTransport;
 }
 
@@ -130,6 +138,8 @@
   buf->putInt(EtchPacketizer::SIG());
   buf->putInt(pktSize);
   buf->setIndex(index);
+  CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "Header is constructed and raw data has been sent to Transport for transmission");
+
   return mTransport->transportData(recipient, buf);
 }
 
@@ -193,7 +203,7 @@
         capu::uint32_t length = buf->getLength();
         capu::uint32_t index = buf->getIndex();
         buf->setLength(index + mBodyLen);
-
+        CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "Header is parsed and the body of message is sent to Messagizer");
         mSession->sessionPacket(sender, buf);
 
         buf->setLength(length);
@@ -208,6 +218,7 @@
         mSavedBuf->put(*buf, needFromBuf);
         mSavedBuf->setIndex(0);
 
+        CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "Header is parsed and the body of message is sent to Messagizer");
         mSession->sessionPacket(sender, mSavedBuf);
 
         mSavedBuf->reset();
@@ -231,6 +242,7 @@
   buf->getInteger(sig);
 
   if (sig != SIG()) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "SIG is not correct, message will be discarded");
     return ETCH_ERROR;
   }
 
@@ -240,9 +252,9 @@
     buf->reset();
 
   if (pktSize > mMaxPktSize) {
+    CAPU_LOG_ERROR(mRuntime->getLogger(), TAG, "Packet size exceeds the maximum packet size, message will be discarded");
     return ETCH_ERROR;
   }
-
   return ETCH_OK;
 }
 
diff --git a/binding-cpp/runtime/src/main/transport/EtchPlainMailboxManager.cpp b/binding-cpp/runtime/src/main/transport/EtchPlainMailboxManager.cpp
index 639a886..e90a7c4 100644
--- a/binding-cpp/runtime/src/main/transport/EtchPlainMailboxManager.cpp
+++ b/binding-cpp/runtime/src/main/transport/EtchPlainMailboxManager.cpp
@@ -16,9 +16,14 @@
  * limitations under the License.
  */
 #include "transport/EtchPlainMailboxManager.h"
+#include "support/EtchRuntime.h"
+#include "capu/os/Debug.h"
 
 EtchPlainMailboxManager::EtchPlainMailboxManager(EtchTransportMessage* transport, const EtchString& uri, EtchResources* resources)
 : mSession(NULL), mTransport(transport), mUp(false) {
+  //TODO rafactor this

+  mRuntime = EtchRuntime::getRuntime();
+  capu::Debug::Assert(mRuntime != NULL);
   mTransport->setSession(this);
 }
 
@@ -63,6 +68,7 @@
 
   mMailboxes.put(msgid, mb);
   mMutex.unlock();
+  CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchPlainMailboxManager", "A new mailbox is registered");
   return ETCH_OK;
 }
 
@@ -84,12 +90,16 @@
   capu::int64_t msgid;
   if(msg->getInReplyToMessageId(msgid) == ETCH_OK) {
     EtchMailbox* mb = NULL;
-    if (getMailbox(msgid, mb) == ETCH_OK) {
-      return mb->message(sender, msg);
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchPlainMailboxManager", "A message has been received as answer to message identified by %d", msgid);
+    if (getMailbox(msgid, mb) != ETCH_OK) {
+      CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchPlainMailboxManager", "Unable to get Mailbox");
+      return ETCH_ERROR;
     }
-    return ETCH_ERROR;
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchPlainMailboxManager", "Message has been sent to respective mailbox");
+    return mb->message(sender, msg);
   }
   // no msgid - pass off to session
+  CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchPlainMailboxManager", "Message has been sent to upper layer directly");
   return mSession->sessionMessage(sender, msg);
 }
 
@@ -110,12 +120,15 @@
     return ETCH_ERROR;
   }
 
+  CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchPlainMailboxManager", "A mailbox has been created for message id %d", msgid);
   EtchMailbox *mb = new EtchPlainMailbox(this, msgid);
   if (registerMailbox(mb) != ETCH_OK) {
     delete mb;
     return ETCH_ERROR;
+    CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchPlainMailboxManager", "Registration has been failed");
   }
 
+  CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchPlainMailboxManager", "Message has been sent to Messagizer with registering a respective mailbox");
   if (mTransport->transportMessage(recipient, msg) == ETCH_OK) {
     result = mb;
     return ETCH_OK;
@@ -136,6 +149,7 @@
   if(message->setMessageId(mIdGen.next()) != ETCH_OK) {
     return ETCH_ERROR;
   }
+  CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchPlainMailboxManager", "Message has been sent to Messagizer without registering a mailbox");
   return mTransport->transportMessage(recipient, message);
 }
 
@@ -164,6 +178,7 @@
 status_t EtchPlainMailboxManager::sessionNotify(capu::SmartPointer<EtchObject> event) {
   if (event->equals(&EtchSession::UP())) {
     mUp = true;
+    CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchPlainMailboxManager", "Connection is up");
   } else if (event->equals(&EtchSession::DOWN())) {
     mUp = false;
     // TODO check thread safety
@@ -174,6 +189,7 @@
       p.second->closeDelivery();
       delete p.second;
     }
+    CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchPlainMailboxManager", "Connection is down");
   }
   status_t status;
   if(mSession != NULL) {
diff --git a/binding-cpp/runtime/src/main/transport/EtchTcpConnection.cpp b/binding-cpp/runtime/src/main/transport/EtchTcpConnection.cpp
index 18e4cc9..8683177 100644
--- a/binding-cpp/runtime/src/main/transport/EtchTcpConnection.cpp
+++ b/binding-cpp/runtime/src/main/transport/EtchTcpConnection.cpp
@@ -17,9 +17,12 @@
  */
 
 #include "transport/EtchTcpConnection.h"
+#include "capu/os/Debug.h"
 
 EtchTcpConnection::EtchTcpConnection(EtchRuntime* runtime, EtchSocket* socket, EtchURL* uri)
 : mRuntime(runtime), mOptions(uri) {
+  capu::Debug::Assert(mRuntime != NULL);
+
   if ((socket == NULL) && (uri != NULL)) {
     mHost = uri->getHost();
     mPort = uri->getPort();
@@ -48,8 +51,11 @@
 }
 
 status_t EtchTcpConnection::send(capu::int8_t* buf, capu::uint32_t off, capu::uint32_t len) {
-  if (mSocket != NULL)
+  if (mSocket != NULL) {
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%d byte of data has been transmitted", len);
     return mSocket->send((unsigned char *) &buf[off], len);
+  }
+  CAPU_LOG_WARN(mRuntime->getLogger(), "EtchTcpConnection", "%d byte of data has not been transmitted because there is no connection", len);
   return ETCH_ERROR;
 }
 
@@ -59,13 +65,18 @@
   while (mIsStarted) {
     capu::int32_t n;
     status_t result = mSocket->receive((unsigned char *) buf->getBuffer(), buf->getSize(), n);
-    if (result != ETCH_OK)
+    if (result != ETCH_OK) {
+      CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Receive() failed with error code %d", mHost.c_str(), mPort, result);
       return result;
-    if (n <= 0)
+    }
+    if (n <= 0) {
+      CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Connection closed for stack", mHost.c_str(), mPort);
       return ETCH_ERROR;
+    }
 
     buf->setLength(n);
     buf->setIndex(0);
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => %d byte data has been received and passed to Packetizer", mHost.c_str(), mPort, n);
     mSession->sessionData(NULL, buf);
   }
   return ETCH_OK;
@@ -81,7 +92,7 @@
     return ETCH_OK;
   }
   //temporary socket in a listener
-  if ((!reconnect) && (mPort == 0) && (mHost.length() == 0)) {
+  if (reconnect && (mPort == 0) && (mHost.length() == 0)) {
     mMutexConnection.unlock();
     return ETCH_ERROR;
   }
@@ -114,14 +125,14 @@
     mSocket = new EtchSocket();
     if (mSocket->connect((unsigned char *) mHost.c_str(), mPort) == ETCH_OK) {
       mMutexConnection.unlock();
+      CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Connection established", mHost.c_str(), mPort);
       return ETCH_OK;
     } else {
       mSocket->close();
       delete mSocket;
       mSocket = NULL;
     }
-
-    //LOGGER IS NEEDED
+    CAPU_LOG_WARN(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Connection could not be established for stack %d", mHost.c_str(), mPort);
   }
 
   mMutexConnection.unlock();
@@ -147,39 +158,41 @@
     mMutex.lock();
     if (mIsStarted) {
       mMutex.unlock();
+      CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Start command received and EtchTcpConnection Receiving Thread", mHost.c_str(), mPort);
       return ETCH_OK;
     }
     mIsStarted = true;
     mMutex.unlock();
-
     mThread = new capu::Thread(this);
     mThread->start();
-
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Start command received and EtchTcpConnection Receiving Thread has started", mHost.c_str(), mPort);
     return ETCH_OK;
   }
 
   if (control->equals(&EtchTcpConnection::START_AND_WAIT_UP())) {
-    if (mIsStarted)
-      return ETCH_OK;
     mMutex.lock();
     if (mIsStarted) {
       mMutex.unlock();
+      CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Start and wait command received, but already started", mHost.c_str(), mPort);
       return ETCH_OK;
     }
     mIsStarted = true;
     mMutex.unlock();
     mThread = new capu::Thread(this);
     mThread->start();
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Start and wait command received and EtchTcpConnection Receiving Thread has started", mHost.c_str(), mPort);
     return waitUp(((EtchInt32*) value.get())->get());
-
   }
 
   if (control->equals(&EtchTcpConnection::STOP())) {
     mMutex.lock();
     if (!mIsStarted) {
       mMutex.unlock();
+      CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Stop command received, but already stopped", mHost.c_str(), mPort);
+
       return ETCH_OK;
     }
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Stop command received and Stop flag for receiving thread is set", mHost.c_str(), mPort);
     mIsStarted = false;
 
     mMutex.unlock();
@@ -191,9 +204,11 @@
     mMutex.lock();
     if (!mIsStarted) {
       mMutex.unlock();
+      CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Stop and wait command received, but already stopped", mHost.c_str(), mPort);
       return ETCH_OK;
     }
     mIsStarted = false;
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Stop and wait command received and Stop flag for receiving thread is set", mHost.c_str(), mPort);
     mMutex.unlock();
 
     close();
@@ -204,11 +219,13 @@
     mMutex.lock();
     if (!mIsStarted) {
       mMutex.unlock();
+      CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Reset command received, but no connection established yet", mHost.c_str(), mPort);
       return ETCH_OK;
     }
     mIsStarted = false;
     mMutex.unlock();
     close();
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Reset command received and the receiving thread has been restarted", mHost.c_str(), mPort);
     return ETCH_OK;
   }
   return ETCH_ENOT_SUPPORTED;
@@ -224,6 +241,7 @@
 
 status_t EtchTcpConnection::close() {
   if (mSocket != NULL) {
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Socket has been closed", mHost.c_str(), mPort);
     return mSocket->close();
   } else {
     return ETCH_ERROR;
@@ -241,6 +259,7 @@
   while (mIsStarted) {
 
     if (openSocket(!first) != ETCH_OK) {
+      CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Socket has not been successfully opened", mHost.c_str(), mPort);
       break;
     }
     status_t res = setupSocket();
@@ -249,12 +268,17 @@
       close();
       break;
     }
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Socket has been opened and connection has been successfully established and start reading", mHost.c_str(), mPort);
     fireUp();
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => FireUp was send to the Stack", mHost.c_str(), mPort);
     if (readSocket() != ETCH_OK) {
       close();
+      CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Connection closing", mHost.c_str(), mPort);
       break;
     }
+    CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Connection closing", mHost.c_str(), mPort);
     fireDown();
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => FireDown was send to the Stack", mHost.c_str(), mPort);
     close();
     first = false;
   }
@@ -270,5 +294,6 @@
     return ETCH_ERROR;
   if (mSocket->setNoDelay((mOptions.getNoDelay() != 0)) != ETCH_OK)
     return ETCH_ERROR;
+  CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchTcpConnection", "%s : %d => Settings for socket has been successfully configured", mHost.c_str(), mPort);
   return ETCH_OK;
 }
diff --git a/binding-cpp/runtime/src/main/transport/EtchTcpListener.cpp b/binding-cpp/runtime/src/main/transport/EtchTcpListener.cpp
index 5640f1e..ff6d4f5 100644
--- a/binding-cpp/runtime/src/main/transport/EtchTcpListener.cpp
+++ b/binding-cpp/runtime/src/main/transport/EtchTcpListener.cpp
@@ -17,6 +17,9 @@
  */
 
 #include "transport/EtchTcpListener.h"
+#include "support/EtchRuntime.h"
+
+
 
 const EtchString& EtchTcpListener::BACKLOG() {
   static const EtchString name("TcpTransportFactory.socket");
@@ -25,6 +28,9 @@
 
 EtchTcpListener::EtchTcpListener(EtchURL *url)
 : mPort(url->getPort()) {
+  //TODO rafactor this

+  mRuntime = EtchRuntime::getRuntime();
+
   EtchString str;
   if (url->getTerms().get(BACKLOG(), &str) != ETCH_OK) {
     mBackLog = 0;
@@ -51,7 +57,7 @@
     delete mSocket;
     mSocket = NULL;
   }
-  
+
 }
 
 capu::bool_t EtchTcpListener::isStarted() {
@@ -88,7 +94,13 @@
         mSocket->close();
         delete mSocket;
         mSocket = NULL;
+        CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchTcpListener", "Listening on specified port has failed");
       }
+    } else {
+      mSocket->close();
+      delete mSocket;
+      mSocket = NULL;
+      CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchTcpListener", "Binding to specified port has failed");
     }
     //LOGGER IS NEEDED
   }
@@ -103,6 +115,7 @@
     if (s == NULL)
       break;
     if (mSession != NULL) {
+      CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "A connection has been accepted");
       mSession->sessionAccepted(s);
     } else {
       delete s;
@@ -115,31 +128,40 @@
 status_t EtchTcpListener::transportControl(capu::SmartPointer<EtchObject> control, capu::SmartPointer<EtchObject> value) {
 
   if (control->equals(&EtchTcpListener::START())) {
-    if (mIsStarted)
+    if (mIsStarted) {
+      CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Start command received, but already started - port is %d", mPort);
       return ETCH_OK;
+    }
     mMutex.lock();
     mIsStarted = true;
     mMutex.unlock();
     mThread = new capu::Thread(this);
     mThread->start();
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Start command received and EtchTcpListener starts listening on port %d", mPort);
     return ETCH_OK;
   }
 
   if (control->equals(&EtchTcpListener::START_AND_WAIT_UP())) {
-    if (mIsStarted)
+    if (mIsStarted) {
+      CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Start and wait up command received, but already started - port is %d", mPort);
       return ETCH_OK;
+    }
     mMutex.lock();
     mIsStarted = true;
     mMutex.unlock();
     mThread = new capu::Thread(this);
     mThread->start();
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Start and wait up command received and EtchTcpListener starts listening on port %d", mPort);
     return waitUp(((EtchInt32*) value.get())->get());
   }
 
   if (control->equals(&EtchTcpListener::STOP())) {
-    if (!mIsStarted)
+    if (!mIsStarted) {
+      CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Stop command received, but already stopped");
       return ETCH_OK;
+    }
     mMutex.lock();
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Stop command received and EtchTcpListener sets the stop flag");
     mIsStarted = false;
     mMutex.unlock();
     close();
@@ -147,24 +169,32 @@
   }
 
   if (control->equals(&EtchTcpListener::STOP_AND_WAIT_DOWN())) {
-    if (!mIsStarted)
-      return ETCH_OK;
+    if (!mIsStarted) {
+      CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Stop and wait command received and EtchTcpListener, but already stopped");
+    }
     mMutex.lock();
     mIsStarted = false;
     mMutex.unlock();
     status_t ret = waitDown(((EtchInt32*) value.get())->get());
     close();
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Stop and wait command received and EtchTcpListener sets the stop flag");
     //TODO: Wait handling in one of the next releases
     return ret;
   }
 
   if (control->equals(&EtchTcpListener::RESET())) {
-    if (!mIsStarted)
+    if (!mIsStarted) {
+      CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Reset command received - but listener is not started yet.");
       return ETCH_OK;
+    }
     mMutex.lock();
     mIsStarted = false;
     mMutex.unlock();
     close();
+    mThread->join();
+    mIsStarted = true;
+    mThread = new capu::Thread(this);
+    CAPU_LOG_DEBUG(mRuntime->getLogger(), "EtchTcpListener", "Reset command received and EtchTcpListener has been restarted the stop flag");
     return ETCH_OK;
   }
   return ETCH_ENOT_SUPPORTED;
@@ -194,15 +224,18 @@
   while (mIsStarted) {
 
     if (openSocket(!first) != ETCH_OK) {
+      CAPU_LOG_ERROR(mRuntime->getLogger(), "EtchTcpListener", "Socket has not been created");
       break;
     }
+    CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchTcpListener", "Socket has been created");
     fireUp();
+    CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchTcpListener", "FireUp was send to the Stack");
     if (readSocket() != ETCH_OK) {
       close();
       break;
     }
-
     fireDown();
+    CAPU_LOG_TRACE(mRuntime->getLogger(), "EtchTcpListener", "FireDown was send to the Stack");
     close();
     first = false;
   }
diff --git a/binding-cpp/runtime/src/main/transport/EtchTcpTransportFactory.cpp b/binding-cpp/runtime/src/main/transport/EtchTcpTransportFactory.cpp
index 0c85bce..8e377c1 100644
--- a/binding-cpp/runtime/src/main/transport/EtchTcpTransportFactory.cpp
+++ b/binding-cpp/runtime/src/main/transport/EtchTcpTransportFactory.cpp
@@ -17,6 +17,8 @@
  */
 #include "transport/EtchTcpTransportFactory.h"
 
+static const char* TAG = "EtchTcpTransportFactory";
+
 const EtchString& EtchTcpTransportFactory::SOCKET() {
   static const EtchString name("TcpTransportFactory.socket");
   return name;
@@ -199,6 +201,6 @@
     return ETCH_ENOT_EXIST;
   }
   vf->lockDynamicTypes();
-
+  CAPU_LOG_DEBUG(mRuntime->getLogger(), TAG, "New stack for the accepted connection has been created");
   return mSession->newServer(mRuntime, m, mUri, res);
 }
diff --git a/binding-cpp/runtime/src/test/serialization/EtchAuthenticationExceptionSerializerTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchAuthenticationExceptionSerializerTest.cpp
index 5e4c23e..6708d29 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchAuthenticationExceptionSerializerTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchAuthenticationExceptionSerializerTest.cpp
@@ -16,12 +16,11 @@
  * limitations under the License.
  */
 
-
-
 #include "gtest/gtest.h"
 #include "gmock/gmock.h"
 #include "serialization/EtchValueFactory.h"
 #include "serialization/EtchAuthenticationExceptionSerializer.h"
+#include "support/EtchRuntime.h"
 
 class MockValueFactory3 : public virtual EtchValueFactory {
 public:
@@ -67,7 +66,29 @@
 
 };
 
-TEST(EtchAuthenticationExceptionSerializationTest, initTest) {
+class EtchAuthenticationExceptionSerializationTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchAuthenticationExceptionSerializationTest, initTest) {
   EtchClass2TypeMap* c2type = new EtchClass2TypeMap();
   EtchString typeName("type1");
   EtchType* type = new EtchType(10, typeName);
@@ -94,7 +115,7 @@
   delete c2type;
 }
 
-TEST(EtchAuthenticationExceptionSerializationTest, exportTest) {
+TEST_F(EtchAuthenticationExceptionSerializationTest, exportTest) {
   EtchClass2TypeMap* c2type = new EtchClass2TypeMap();
   EtchString typeName("type1");
   EtchString message("message");
@@ -135,7 +156,7 @@
   delete result;
 }
 
-TEST(EtchAuthenticationExceptionSerializationTest, importTest) {
+TEST_F(EtchAuthenticationExceptionSerializationTest, importTest) {
   EtchClass2TypeMap* c2type = new EtchClass2TypeMap();
   EtchString typeName("type1");
   EtchString message("message");
diff --git a/binding-cpp/runtime/src/test/serialization/EtchBinaryTaggedDataInputOutputTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchBinaryTaggedDataInputOutputTest.cpp
index 1000e2b..9463e09 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchBinaryTaggedDataInputOutputTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchBinaryTaggedDataInputOutputTest.cpp
@@ -16,8 +16,6 @@
  * limitations under the License.

  */

 

-

-

 #include "gtest/gtest.h"

 #include "gmock/gmock.h"

 #include "serialization/EtchTypeCodes.h"

@@ -32,6 +30,7 @@
 #include "serialization/EtchValidatorByte.h"

 #include "serialization/EtchValidatorFloat.h"

 #include "serialization/EtchValidatorDouble.h"

+#include "support/EtchRuntime.h"

 

 class MockValueFactory9 : public virtual EtchValueFactory {

 public:

@@ -249,14 +248,36 @@
 

 };

 

-TEST(EtchBinaryTaggedDataInputTest, createTest) {

+class EtchBinaryTaggedDataInputOutputTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};

+

+TEST_F(EtchBinaryTaggedDataInputOutputTest, createTest) {

   MockValueFactory9 *factory = new MockValueFactory9();

   EtchBinaryTaggedDataInput* dataIn = new EtchBinaryTaggedDataInput(factory);

   delete dataIn;

   delete factory;

 }

 

-TEST(EtchBinaryTaggedDataInputTest, checkTest) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, checkTest) {

   MockValueFactory9 *factory = new MockValueFactory9();

   EtchBinaryTaggedDataInput* dataIn = new EtchBinaryTaggedDataInput(factory);

 

@@ -386,7 +407,7 @@
   delete factory;

 }

 

-TEST(EtchBinaryTaggedDataInputTest, boolean_serialization) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, boolean_serialization) {

   capu::SmartPointer<EtchNativeArray<capu::SmartPointer<EtchBool> > > carray1 = new EtchNativeArray<capu::SmartPointer<EtchBool> > (2, 2);

   carray1->createArray(0, 2);

   carray1->createArray(1, 2);

@@ -410,7 +431,7 @@
 }

 //

 

-TEST(EtchBinaryTaggedDataInputTest, int_serialization) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, int_serialization) {

   capu::SmartPointer<EtchNativeArray<capu::SmartPointer<EtchInt32> > > carray1 = new EtchNativeArray<capu::SmartPointer<EtchInt32> > (2, 2);

   carray1->createArray(0, 2);

   carray1->createArray(1, 2);

@@ -433,7 +454,7 @@
   Utility::test(content4, val, false);

 }

 

-TEST(EtchBinaryTaggedDataInputTest, string_serialization) {
+TEST_F(EtchBinaryTaggedDataInputOutputTest, string_serialization) {
   const capu::uint8_t utf8_1 [] = {0xF0, 0xA4, 0xAD, 0xA2, 0xE2, 0x82, 0xAC, 0xC2, 0xA2, 0x24, 0x0};
   const capu::uint8_t utf8_2 [] = {0xF0, 0xA4, 0xAD, 0xA2, 0xE2, 0x82, 0xAC, 0xC2, 0xA2, 0x25, 0x0};
   capu::SmartPointer<EtchNativeArray<capu::SmartPointer<EtchString> > > carray1 = new EtchNativeArray<capu::SmartPointer<EtchString> > (2, 2);
@@ -458,7 +479,7 @@
   Utility::test(content4, val, false);
 }
 
-TEST(EtchBinaryTaggedDataInputTest, long_serialization) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, long_serialization) {

   capu::SmartPointer<EtchNativeArray<capu::SmartPointer<EtchLong> > > carray1 = new EtchNativeArray<capu::SmartPointer<EtchLong> > (2, 2);

   carray1->createArray(0, 2);

   carray1->createArray(1, 2);

@@ -481,7 +502,7 @@
   Utility::test(content4, val, false);

 }

 

-TEST(EtchBinaryTaggedDataInputTest, byte_serialization) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, byte_serialization) {

   //  EtchNativeArray<EtchByte*> carray(2, &EtchByte::TYPE);

   capu::SmartPointer<EtchByte> content1 = new EtchByte(90);

   //array can not be tested because it is optimized as native

@@ -490,7 +511,7 @@
   Utility::test(content1, val, false);

 }

 

-TEST(EtchBinaryTaggedDataInputTest, short_serialization) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, short_serialization) {

   capu::SmartPointer<EtchNativeArray<capu::SmartPointer<EtchShort> > > carray1 = new EtchNativeArray<capu::SmartPointer<EtchShort> > (2, 2);

   carray1->createArray(0, 2);

   carray1->createArray(1, 2);

@@ -513,7 +534,7 @@
   Utility::test(content4, val, false);

 }

 

-TEST(EtchBinaryTaggedDataInputTest, float_serialization) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, float_serialization) {

   capu::SmartPointer<EtchNativeArray<capu::SmartPointer<EtchFloat> > > carray1 = new EtchNativeArray<capu::SmartPointer<EtchFloat> > (2, 2);

   carray1->createArray(0, 2);

   carray1->createArray(1, 2);

@@ -536,7 +557,7 @@
   Utility::test(content4, val, false);

 }

 

-TEST(EtchBinaryTaggedDataInputTest, double_serialization) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, double_serialization) {

   capu::SmartPointer<EtchNativeArray<capu::SmartPointer<EtchDouble> > > carray1 = new EtchNativeArray<capu::SmartPointer<EtchDouble> > (2, 2);

   carray1->createArray(0, 2);

   carray1->createArray(1, 2);

@@ -559,14 +580,14 @@
   Utility::test(content4, val, false);

 }

 

-TEST(EtchBinaryTaggedDataInputTest, empty_string_serialization) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, empty_string_serialization) {

   capu::SmartPointer<EtchString> str = new EtchString(NULL, 0, "utf-8");
   capu::SmartPointer<EtchValidator> val = NULL;

   EtchValidatorString::Get(0, val);

   Utility::test(str, val, false);

 }

 

-TEST(EtchBinaryTaggedDataInputTest, date_serialization) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, date_serialization) {

   capu::SmartPointer<EtchNativeArray<capu::SmartPointer<EtchDate> > > carray1 = new EtchNativeArray<capu::SmartPointer<EtchDate> > (2, 2);

   carray1->createArray(0, 2);

   carray1->createArray(1, 2);

@@ -593,7 +614,7 @@
   Utility::test(content4, val, false);

 }

 

-TEST(EtchBinaryTaggedDataInputTest, btdo_object_serialization) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, btdo_object_serialization) {

   capu::int8_t byte_array[] = {3, 1, 1, 2, -111, -106, 1, 2, 90, -126, -127, -127};

   capu::SmartPointer<EtchNativeArray<capu::SmartPointer<EtchObject> > > carray1 = new EtchNativeArray<capu::SmartPointer<EtchObject> > (2);

 
@@ -607,7 +628,7 @@
   Utility::test_bto_write(carray1, byte_array, val);

 }

 

-TEST(EtchBinaryTaggedDataInputTest, btdo_boolean_write) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, btdo_boolean_write) {

 

   capu::int8_t byte_array[] = {3, 1, 1, 2, -111, -125, 1, 2, -125, -126, -127, -127};

   capu::int8_t byte_false[] = {3, 1, 1, 2, -126, -127};

@@ -626,7 +647,7 @@
 

 }

 

-TEST(EtchBinaryTaggedDataInputTest, btdo_byte_write) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, btdo_byte_write) {

 

   capu::int8_t byte_array[] = {3, 1, 1, 2, -117, 3, 1, 2, 3, -127};

   capu::int8_t byte_pos[] = {3, 1, 1, 2, 1, -127};

@@ -658,7 +679,7 @@
 

 }

 

-TEST(EtchBinaryTaggedDataInputTest, btdo_short_write) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, btdo_short_write) {

 

   capu::int8_t byte_array[] = {3, 1, 1, 2, -111, -123, 1, 3, 1, 2, 3, -127, -127};

   capu::int8_t byte_pos[] = {3, 1, 1, 2, -123, 39, 16, -127};

@@ -683,7 +704,7 @@
 

 }

 

-TEST(EtchBinaryTaggedDataInputTest, btdo_int_write) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, btdo_int_write) {

 

   capu::int8_t byte_array[] = {3, 1, 1, 2, -111, -122, 1, 3, 1, 2, 3, -127, -127};

   capu::int8_t byte_pos[] = {3, 1, 1, 2, -122, 59, -102, -54, 0, -127};

@@ -707,7 +728,7 @@
   Utility::test_bto_write(carray, byte_array, val);

 }

 

-TEST(EtchBinaryTaggedDataInputTest, btdo_long_write) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, btdo_long_write) {

 

   capu::int8_t byte_array[] = {3, 1, 1, 2, -111, -121, 1, 3, 1, 2, 3, -127, -127};

   capu::int8_t byte_pos[] = {3, 1, 1, 2, -121, 13, -32, -74, -77, -89, 100, 0, 0, -127};

@@ -731,7 +752,7 @@
   Utility::test_bto_write(carray, byte_array, val);

 }

 

-TEST(EtchBinaryTaggedDataInputTest, btdo_float_write) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, btdo_float_write) {

   capu::int8_t byte_array[] = {3, 1, 1, 2, -111, -120, 1, 3, -120, 63, -128, 0, 0, -120, 64, 0, 0, 0, -120, 64, 64, 0, 0, -127, -127};

   capu::int8_t byte_pos[] = {3, 1, 1, 2, -120, 70, 64, -28, 0, -127};

   capu::SmartPointer<EtchNativeArray<capu::SmartPointer<EtchFloat> > > carray = new EtchNativeArray<capu::SmartPointer<EtchFloat> > (3);

@@ -751,7 +772,7 @@
   Utility::test_bto_write(carray, byte_array, val);

 }

 

-TEST(EtchBinaryTaggedDataInputTest, btdo_double_write) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, btdo_double_write) {

   capu::int8_t byte_array[] = {3, 1, 1, 2, -111, -119, 1, 3, -119, 63, -16, 0, 0, 0, 0, 0, 0, -119, 64, 0, 0, 0, 0, 0, 0, 0, -119, 64, 8, 0, 0, 0, 0, 0, 0, -127, -127};

   capu::int8_t byte_pos[] = {3, 1, 1, 2, -119, 64, -42, -24, 0, 0, 0, 0, 0, -127};

   capu::SmartPointer<EtchNativeArray<capu::SmartPointer<EtchDouble> > > carray = new EtchNativeArray<capu::SmartPointer<EtchDouble> > (3);

@@ -771,7 +792,7 @@
   Utility::test_bto_write(carray, byte_array, val);

 }

 

-TEST(EtchBinaryTaggedDataInputTest, btdo_empty_string_write) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, btdo_empty_string_write) {

   capu::int8_t byte_pos[] = {3, 1, 1, 2, -110, -127};

   capu::SmartPointer<EtchString> content0 = new EtchString("");

   capu::SmartPointer<EtchValidator> val = NULL;

@@ -779,7 +800,7 @@
   Utility::test_bto_write(content0, byte_pos, val);

 }

 

-TEST(EtchBinaryTaggedDataInputTest, btdo_date_write) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, btdo_date_write) {

   capu::int8_t byte_array[] = {3, 1, 1, 2, -111, -107, -122, 43, 57, 107, -52, 1, 2, -107, -122, 43, 57, 107, -52, 1, -122, 102, 0, 26, 64, -122, 73, -106, 2, -46, -127, -107, -122, 43, 57, 107, -52, 1, -122, 102, 0, 26, 64, -121, 0, 0, 0, 0, -117, -48, 56, 53, -127, -127, -127};

   capu::int8_t byte_pos[] = {3, 1, 1, 2, -107, -122, 43, 57, 107, -52, 1, -122, 102, 0, 26, 64, -122, 73, -106, 2, -46, -127, -127};

   capu::SmartPointer<EtchNativeArray<capu::SmartPointer<EtchDate> > > carray = new EtchNativeArray<capu::SmartPointer<EtchDate> >(2);

@@ -800,14 +821,14 @@
   Utility::test_bto_write(date, byte_pos, val);

 }

 

-TEST(EtchBinaryTaggedDataInputTest, null_write) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, null_write) {

   capu::int8_t byte_pos[] = {3, 1, 0, -127};

   capu::SmartPointer<EtchValidator> val = NULL;

   EtchValidatorObject::Get(0, val);

   Utility::test_bto_write(NULL, byte_pos, val);

 }

 

-TEST(EtchBinaryTaggedDataInputTest, multi_dimension_test) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, multi_dimension_test) {

   capu::int8_t byte_pos[] = {3, 1, 1, 2, -111, -125, 2, 2, -111, -125, 1, 2, -126, -125, -127, -111, -125, 1, 2, -126, -125, -127, -127, -127};

   capu::SmartPointer<EtchNativeArray<capu::SmartPointer<EtchBool> > > carray1 = new EtchNativeArray<capu::SmartPointer<EtchBool> >(2, 2);

   carray1->createArray(0, 2);

@@ -825,7 +846,7 @@
   Utility::test_bto_write(carray1, byte_pos, val);

 }

 

-TEST(EtchBinaryTaggedDataInputTest, btdo_multi_array_write) {

+TEST_F(EtchBinaryTaggedDataInputOutputTest, btdo_multi_array_write) {

   capu::int8_t byte_array[] = {3, 1, 1, 2, -111, -106, 2, 2, -111, -106, 1, 2, -125, -126, -127, -111, -106, 1, 2, -126, -125, -127, -127, -127};

   capu::SmartPointer<EtchNativeArray<capu::SmartPointer<EtchObject> > > carray1 = new EtchNativeArray<capu::SmartPointer<EtchObject> >(2, 2);

   carray1->createArray(0, 2);

diff --git a/binding-cpp/runtime/src/test/serialization/EtchDateSerializerTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchDateSerializerTest.cpp
index a21b5ab..b1ee3e9 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchDateSerializerTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchDateSerializerTest.cpp
@@ -66,7 +66,29 @@
 
 };
 
-TEST(EtchDateSerializationTest, initTest) {
+class EtchDateSerializationTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchDateSerializationTest, initTest) {
   EtchClass2TypeMap* c2type = new EtchClass2TypeMap();
   EtchString typeName("type1");
   EtchType* type = new EtchType(10, typeName);
@@ -93,7 +115,7 @@
   delete c2type;
 }
 
-TEST(EtchDateSerializationTest, exportTest) {
+TEST_F(EtchDateSerializationTest, exportTest) {
   EtchClass2TypeMap* c2type = new EtchClass2TypeMap();
   EtchString typeName("type1");
   EtchValueFactory* factory = new MockValueFactory6();
@@ -136,7 +158,7 @@
   delete result;
 }
 
-TEST(EtchDateSerializationTest, importTest) {
+TEST_F(EtchDateSerializationTest, importTest) {
   EtchClass2TypeMap* c2type = new EtchClass2TypeMap();
   EtchString typeName("type1");
   EtchValueFactory* factory = new MockValueFactory6();
diff --git a/binding-cpp/runtime/src/test/serialization/EtchDefaultValueFactoryTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchDefaultValueFactoryTest.cpp
index 2810f63..7b58694 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchDefaultValueFactoryTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchDefaultValueFactoryTest.cpp
@@ -19,9 +19,31 @@
 
 #include <gtest/gtest.h>
 #include "serialization/EtchDefaultValueFactory.h"
+#include "support/EtchRuntime.h"
 
+class EtchDefaultValueFactoryTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

 
-TEST(EtchDefaultValueFactoryTest, createTest) {
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchDefaultValueFactoryTest, createTest) {
   EtchType *_mt_x;
   EtchType *_mt_y;
   EtchField *_mf_a = new EtchField("a");
@@ -51,7 +73,7 @@
   delete class2type;
 }
 
-TEST(EtchDefaultValueFactoryTest, typeTest) {
+TEST_F(EtchDefaultValueFactoryTest, typeTest) {
   EtchType *_mt_x;
   EtchType *_mt_y;
   EtchField *_mf_a = new EtchField("a");
@@ -134,7 +156,7 @@
   delete class2type;
 }
 
-TEST(EtchDefaultValueFactoryTest, exportCustomValueTest) {
+TEST_F(EtchDefaultValueFactoryTest, exportCustomValueTest) {
   EtchType *_mt_x;
   EtchType *_mt_y;
   EtchField *_mf_a = new EtchField("a");
@@ -186,7 +208,7 @@
   delete class2type;
 }
 
-TEST(EtchDefaultValueFactoryTest, importCustomValueTest) {
+TEST_F(EtchDefaultValueFactoryTest, importCustomValueTest) {
   EtchType *_mt_x;
   EtchType *_mt_y;
   EtchField *_mf_a = new EtchField("a");
@@ -241,7 +263,7 @@
   delete class2type;
 }
 
-TEST(EtchDefaultValueFactoryTest, lockTest) {
+TEST_F(EtchDefaultValueFactoryTest, lockTest) {
   EtchType *_mt_x;
   EtchType *_mt_y;
   EtchField *_mf_a = new EtchField("a");
@@ -284,7 +306,7 @@
   delete class2type;
 }
 
-TEST(EtchDefaultValueFactoryTest, messageIdTest) {
+TEST_F(EtchDefaultValueFactoryTest, messageIdTest) {
   EtchType *_mt_x;
   EtchType *_mt_y;
   EtchField *_mf_a = new EtchField("a");
@@ -334,7 +356,7 @@
   delete mt_foo;
 }
 
-TEST(EtchDefaultValueFactoryTest, inReplyToTest) {
+TEST_F(EtchDefaultValueFactoryTest, inReplyToTest) {
   EtchType *_mt_x;
   EtchType *_mt_y;
   EtchField *_mf_a = new EtchField("a");
diff --git a/binding-cpp/runtime/src/test/serialization/EtchHashTableSerializerTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchHashTableSerializerTest.cpp
index 3715a12..f8c1c7c 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchHashTableSerializerTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchHashTableSerializerTest.cpp
@@ -66,7 +66,29 @@
 
 };
 
-TEST(EtchHashTableSerializerTest, initTest) {
+class EtchHashTableSerializerTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchHashTableSerializerTest, initTest) {
   EtchClass2TypeMap* c2type = new EtchClass2TypeMap();
   EtchString typeName("type1");
   EtchType* type = new EtchType(10, typeName);
@@ -92,7 +114,7 @@
   delete c2type;
 }
 
-TEST(EtchHashTableSerializerTest, exportTest) {
+TEST_F(EtchHashTableSerializerTest, exportTest) {
   EtchClass2TypeMap* c2type = new EtchClass2TypeMap();
   EtchString typeName("type1");
   EtchValueFactory* factory = new MockValueFactory4();
@@ -144,7 +166,7 @@
   delete result;
 }
 
-TEST(EtchHashTableSerializerTest, importTest) {
+TEST_F(EtchHashTableSerializerTest, importTest) {
   EtchClass2TypeMap* c2type = new EtchClass2TypeMap();
   EtchString typeName("type1");
   EtchValueFactory* factory = new MockValueFactory4();
diff --git a/binding-cpp/runtime/src/test/serialization/EtchListSerializerTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchListSerializerTest.cpp
index 7311d9d..9a751ba 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchListSerializerTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchListSerializerTest.cpp
@@ -67,7 +67,29 @@
 
 };
 
-TEST(EtchListSerializerTest, initTest) {
+class EtchListSerializerTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchListSerializerTest, initTest) {
   EtchClass2TypeMap* c2type = new EtchClass2TypeMap();
   EtchString typeName("type1");
   EtchType* type = new EtchType(10, typeName);
@@ -94,7 +116,7 @@
   delete c2type;
 }
 
-TEST(EtchListSerializerTest, exportTest) {
+TEST_F(EtchListSerializerTest, exportTest) {
   EtchClass2TypeMap* c2type = new EtchClass2TypeMap();
   EtchString typeName("type1");
   EtchValueFactory* factory = new MockValueFactory1();
@@ -142,7 +164,7 @@
   delete result;
 }
 
-TEST(EtchListSerializerTest, importTest) {
+TEST_F(EtchListSerializerTest, importTest) {
   EtchClass2TypeMap* c2type = new EtchClass2TypeMap();
   EtchString typeName("type1");
   EtchValueFactory* factory = new MockValueFactory1();
diff --git a/binding-cpp/runtime/src/test/serialization/EtchRuntimeExceptionSerializerTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchRuntimeExceptionSerializerTest.cpp
index c0fd53e..395d93b 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchRuntimeExceptionSerializerTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchRuntimeExceptionSerializerTest.cpp
@@ -68,7 +68,29 @@
 
 };
 
-TEST(EtchRuntimeExceptionSerializationTest, initTest) {
+class EtchRuntimeExceptionSerializationTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchRuntimeExceptionSerializationTest, initTest) {
   EtchClass2TypeMap* c2type = new EtchClass2TypeMap();
   EtchString typeName("type1");
   EtchType* type = new EtchType(10, typeName);
@@ -95,7 +117,7 @@
   delete c2type;
 }
 
-TEST(EtchRuntimeExceptionSerializationTest, exportTest) {
+TEST_F(EtchRuntimeExceptionSerializationTest, exportTest) {
   EtchClass2TypeMap* c2type = new EtchClass2TypeMap();
   EtchString typeName("type1");
   EtchString message("message");
@@ -136,7 +158,7 @@
   delete result;
 }
 
-TEST(EtchRuntimeExceptionSerializationTest, importTest) {
+TEST_F(EtchRuntimeExceptionSerializationTest, importTest) {
   EtchClass2TypeMap* c2type = new EtchClass2TypeMap();
   EtchString typeName("type1");
   EtchString message("message");
diff --git a/binding-cpp/runtime/src/test/serialization/EtchSetSerializerTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchSetSerializerTest.cpp
index ff66970..2922ba9 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchSetSerializerTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchSetSerializerTest.cpp
@@ -66,7 +66,29 @@
 
 };
 
-TEST(EtchSetSerializerTest, initTest) {
+class EtchSetSerializerTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchSetSerializerTest, initTest) {
   EtchClass2TypeMap* c2type = new EtchClass2TypeMap();
   EtchString typeName("type1");
   EtchType* type = new EtchType(10, typeName);
@@ -92,7 +114,7 @@
   delete c2type;
 }
 
-TEST(EtchSetSerializerTest, exportTest) {
+TEST_F(EtchSetSerializerTest, exportTest) {
   EtchClass2TypeMap* c2type = new EtchClass2TypeMap();
   EtchString typeName("type1");
   EtchValueFactory* factory = new MockValueFactory5();
@@ -139,7 +161,7 @@
   delete result;
 }
 
-TEST(EtchSetSerializerTest, importTest) {
+TEST_F(EtchSetSerializerTest, importTest) {
   EtchClass2TypeMap* c2type = new EtchClass2TypeMap();
   EtchString typeName("type1");
   EtchValueFactory* factory = new MockValueFactory5();
diff --git a/binding-cpp/runtime/src/test/serialization/EtchStructValueTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchStructValueTest.cpp
index c979184..25ef623 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchStructValueTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchStructValueTest.cpp
@@ -156,7 +156,29 @@
 
 };
 
-TEST(EtchStructValue, createTest) {
+class EtchStructValueTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchStructValueTest, createTest) {
   EtchString fieldtype1("type1");
   EtchString fieldtype2("type2");
   EtchField field1(fieldtype1);
@@ -183,7 +205,7 @@
   delete comp;
 }
 
-TEST(EtchStructValue, getTypeTest) {
+TEST_F(EtchStructValueTest, getTypeTest) {
   EtchString fieldtype1("type1");
   EtchString fieldtype2("type2");
   EtchField field1(fieldtype1);
@@ -208,7 +230,7 @@
   delete comp;
 }
 
-TEST(EtchStructValue, isType) {
+TEST_F(EtchStructValueTest, isType) {
   //Type 1
   EtchString fieldtype1("type1");
   EtchString fieldtype2("type2");
@@ -240,7 +262,7 @@
   delete comp2;
 }
 
-TEST(EtchStructValue, putTest_FULL) {
+TEST_F(EtchStructValueTest, putTest_FULL) {
   EtchString fieldtype1("type1");
   EtchString fieldtype2("type2");
   EtchString fieldtype3("type3");
@@ -290,7 +312,7 @@
   delete comp;
 }
 
-TEST(EtchStructValue, putTest_MISSING_OK) {
+TEST_F(EtchStructValueTest, putTest_MISSING_OK) {
   EtchString fieldtype1("type1");
   EtchString fieldtype2("type2");
   EtchString fieldtype3("type3");
@@ -340,7 +362,7 @@
   delete comp;
 }
 
-TEST(EtchStructValue, putTest_NONE) {
+TEST_F(EtchStructValueTest, putTest_NONE) {
   EtchString fieldtype1("type1");
   EtchString fieldtype2("type2");
   EtchString fieldtype3("type3");
@@ -390,7 +412,7 @@
   delete comp;
 }
 
-TEST(EtchStructValue, getTest) {
+TEST_F(EtchStructValueTest, getTest) {
   EtchString fieldtype1("type1");
   EtchString fieldtype2("type2");
   EtchField field1(fieldtype1);
@@ -431,7 +453,7 @@
   delete comp;
 }
 
-TEST(EtchStructValue, removeTest) {
+TEST_F(EtchStructValueTest, removeTest) {
   EtchString fieldtype1("type1");
   EtchString typeName("comp");
   EtchField field1(fieldtype1);
diff --git a/binding-cpp/runtime/src/test/serialization/EtchTypeTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchTypeTest.cpp
index 8b12e22..7d0e23d 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchTypeTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchTypeTest.cpp
@@ -22,14 +22,36 @@
 #include "serialization/EtchValidatorLong.h"
 #include "serialization/EtchValidatorByte.h"
 
-TEST(EtchTypeTest, createTest) {
+class EtchTypeTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchTypeTest, createTest) {
   EtchString str("one");
   EtchType *type = new EtchType(1, str);
   EXPECT_TRUE(type != NULL);
   delete type;
 }
 
-TEST(EtchTypeTest, putValidatorTest) {
+TEST_F(EtchTypeTest, putValidatorTest) {
   EtchString str1("one");
   EtchString str2("two");
   EtchString str3("three");
@@ -49,7 +71,7 @@
   EXPECT_EQ(v2, v1);
 }
 
-TEST(EtchTypeTest, getValidatorTest) {
+TEST_F(EtchTypeTest, getValidatorTest) {
   EtchString str1("one");
   EtchString str2("two");
   EtchString str3("three");
@@ -65,7 +87,7 @@
   EXPECT_EQ(t.getValidator(g, result), ETCH_ENOT_EXIST);
 }
 
-TEST(EtchTypeTest, clearTest) {
+TEST_F(EtchTypeTest, clearTest) {
   EtchString str1("one");
   EtchString str2("two");
   EtchString str3("three");
@@ -83,7 +105,7 @@
   EXPECT_EQ(t.clearValidator(g), ETCH_ERANGE);
 }
 
-TEST(EtchTypeTest, setAndGetTest) {
+TEST_F(EtchTypeTest, setAndGetTest) {
   EtchString str1("one");
   EtchString str2("two");
   EtchString str3("three");
@@ -104,7 +126,7 @@
   EXPECT_TRUE(t.getSuperType() == NULL);
 }
 
-TEST(EtchTypeTest, lockTest) {
+TEST_F(EtchTypeTest, lockTest) {
   EtchString str1("one");
   EtchString str2("two");
   EtchString str3("three");
diff --git a/binding-cpp/runtime/src/test/serialization/EtchValidatorBooleanTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchValidatorBooleanTest.cpp
index a1ac715..a0e60e7 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchValidatorBooleanTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchValidatorBooleanTest.cpp
@@ -21,8 +21,31 @@
 #include "capu/util/SmartPointer.h"
 #include "common/EtchInt32.h"
 #include "common/EtchNativeArray.h"
+#include "support/EtchRuntime.h"
 
-TEST(EtchValidatorBooleanTest, createTest) {
+class EtchValidatorBooleanTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchValidatorBooleanTest, createTest) {
   capu::SmartPointer<EtchValidator> val2;
   EXPECT_TRUE(EtchValidatorBoolean::Get(0, val2) == ETCH_OK);
 
@@ -42,7 +65,7 @@
 
 }
 
-TEST(EtchValidatorBooleanTest, validateTest) {
+TEST_F(EtchValidatorBooleanTest, validateTest) {
   capu::SmartPointer<EtchObject> boolean = NULL;
   capu::SmartPointer<EtchObject> integer = new EtchInt32(4);
   capu::SmartPointer<EtchObject> boolean2 = new EtchBool(false);
@@ -55,7 +78,7 @@
 
 }
 
-TEST(EtchValidatorBooleanTest, validateValueTest) {
+TEST_F(EtchValidatorBooleanTest, validateValueTest) {
   capu::SmartPointer<EtchObject> boolean = NULL;
   capu::SmartPointer<EtchObject> result;
   capu::SmartPointer<EtchObject> integer = new EtchInt32(4);
@@ -68,7 +91,7 @@
   EXPECT_TRUE(val->validateValue(boolean2, result) == ETCH_OK);
 }
 
-TEST(EtchValidatorBooleanTest, elementValidatorTest) {
+TEST_F(EtchValidatorBooleanTest, elementValidatorTest) {
   capu::SmartPointer<EtchValidator> val2;
   EXPECT_TRUE(EtchValidatorBoolean::Get(1, val2) == ETCH_OK);
   capu::SmartPointer<EtchValidatorBoolean> val = capu::smartpointer_cast<EtchValidatorBoolean>(val2);
diff --git a/binding-cpp/runtime/src/test/serialization/EtchValidatorByteTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchValidatorByteTest.cpp
index 3c58722..20715bc 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchValidatorByteTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchValidatorByteTest.cpp
@@ -20,8 +20,31 @@
 #include "serialization/EtchValidatorByte.h"
 #include "capu/util/SmartPointer.h"
 #include "common/EtchString.h"
+#include "support/EtchRuntime.h"
 
-TEST(EtchValidatorByteTest, createTest) {
+class EtchValidatorByteTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchValidatorByteTest, createTest) {
   capu::SmartPointer<EtchValidatorByte> ptr = NULL;
 
   capu::SmartPointer<EtchValidator> val;
@@ -38,7 +61,7 @@
   EXPECT_TRUE(ptr->getNDims() == 2);
 }
 
-TEST(EtchValidatorByteTest, validateTest) {
+TEST_F(EtchValidatorByteTest, validateTest) {
   capu::SmartPointer<EtchObject> byte = NULL;
 
   capu::SmartPointer<EtchObject> integer = new EtchInt32(-128);
@@ -79,7 +102,7 @@
 
 }
 
-TEST(EtchValidatorByteTest, validateValueTest) {
+TEST_F(EtchValidatorByteTest, validateValueTest) {
   capu::SmartPointer<EtchObject> byte = NULL;
   capu::SmartPointer<EtchObject> result;
   capu::SmartPointer<EtchObject> integer = new EtchInt32(-128);
@@ -103,7 +126,7 @@
 
 }
 
-TEST(EtchValidatorByteTest, elementValidatorTest) {
+TEST_F(EtchValidatorByteTest, elementValidatorTest) {
   capu::SmartPointer<EtchValidator> ptr = NULL;
   EXPECT_TRUE(EtchValidatorByte::Get(1, ptr) == ETCH_OK);
   capu::SmartPointer<EtchValidator> elementValidator;
diff --git a/binding-cpp/runtime/src/test/serialization/EtchValidatorCustomTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchValidatorCustomTest.cpp
index d4d4cbc..7a27cdf 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchValidatorCustomTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchValidatorCustomTest.cpp
@@ -21,8 +21,7 @@
 #include "serialization/EtchValidatorCustom.h"
 #include "capu/util/SmartPointer.h"
 #include "common/EtchString.h"
-
-
+#include "support/EtchRuntime.h"
 
 class MockGeneratedClass : public EtchObject {
 public:
@@ -45,8 +44,29 @@
   return &TYPE;
 }
 
+class EtchValidatorCustomTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

 
-TEST(EtchValidatorCustomTest, createTest) {
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchValidatorCustomTest, createTest) {
   EtchValidatorCustom *ptr = NULL;
 
   status_t status;
@@ -70,7 +90,7 @@
   EXPECT_TRUE(ptr->getNDims() == 2);
 }
 
-TEST(EtchValidatorCustomTest, validateTest) {
+TEST_F(EtchValidatorCustomTest, validateTest) {
   status_t status;
   capu::SmartPointer<EtchObject> byte = NULL;
 
@@ -116,7 +136,7 @@
   EXPECT_TRUE(val->validate(generatedClass));
 }
 
-TEST(EtchValidatorCustomTest, validateValueTest) {
+TEST_F(EtchValidatorCustomTest, validateValueTest) {
   status_t status;
   capu::SmartPointer<EtchObject> byte = NULL;
   capu::SmartPointer<EtchObject> result;
@@ -142,7 +162,7 @@
 
 
 
-TEST(EtchValidatorCustomTest, elementValidatorTest) {
+TEST_F(EtchValidatorCustomTest, elementValidatorTest) {
   status_t status;
   capu::SmartPointer<EtchValidator> ptr = NULL;
   
diff --git a/binding-cpp/runtime/src/test/serialization/EtchValidatorDoubleTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchValidatorDoubleTest.cpp
index ba55fc7..8645453 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchValidatorDoubleTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchValidatorDoubleTest.cpp
@@ -20,8 +20,31 @@
 #include "serialization/EtchValidatorDouble.h"
 #include "capu/util/SmartPointer.h"
 #include "common/EtchString.h"
+#include "support/EtchRuntime.h"
 
-TEST(EtchValidatorDoubleTest, createTest) {
+class EtchValidatorDoubleTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchValidatorDoubleTest, createTest) {
   capu::SmartPointer<EtchValidatorDouble> ptr = NULL;
 
   capu::SmartPointer<EtchValidator> val;
@@ -40,7 +63,7 @@
   EXPECT_TRUE(ptr->getNDims() == 2);
 }
 
-TEST(EtchValidatorDoubleTest, validateTest) {
+TEST_F(EtchValidatorDoubleTest, validateTest) {
   capu::SmartPointer<EtchObject> byte = NULL;
 
   capu::SmartPointer<EtchObject> doubleTmp = new EtchDouble(capu::NumericLimitMax<capu::float_t>());
@@ -66,7 +89,7 @@
   EXPECT_TRUE(ptr->validate(doubleTmp4_true));
 }
 
-TEST(EtchValidatorDoubleTest, validateValueTest) {
+TEST_F(EtchValidatorDoubleTest, validateValueTest) {
   capu::SmartPointer<EtchObject> byte = NULL;
   capu::SmartPointer<EtchObject> result;
   capu::SmartPointer<EtchObject> doubleTmp = new EtchDouble(-128.12);
@@ -83,7 +106,7 @@
   EXPECT_TRUE(((EtchDouble*) result.get())->get() == ((EtchDouble*) doubleTmp3.get())->get());
 }
 
-TEST(EtchValidatorDoubleTest, elementValidatorTest) {
+TEST_F(EtchValidatorDoubleTest, elementValidatorTest) {
   capu::SmartPointer<EtchValidator> ptr = NULL;
   EXPECT_TRUE(EtchValidatorDouble::Get(1, ptr) == ETCH_OK);
   capu::SmartPointer<EtchValidator> elementValidator;
diff --git a/binding-cpp/runtime/src/test/serialization/EtchValidatorFloatTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchValidatorFloatTest.cpp
index d23581e..d1d7c00 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchValidatorFloatTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchValidatorFloatTest.cpp
@@ -17,12 +17,35 @@
  */
 
 #include <gtest/gtest.h>
-#include "serialization/EtchValidatorFloat.h"
-#include "capu/util/SmartPointer.h"
-#include "common/EtchString.h"
 #include "capu/os/NumericLimits.h"
+#include "capu/util/SmartPointer.h"
+#include "serialization/EtchValidatorFloat.h"
+#include "common/EtchString.h"
+#include "support/EtchRuntime.h"
 
-TEST(EtchValidatorFloatTest, createTest) {
+class EtchValidatorFloatTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchValidatorFloatTest, createTest) {
   capu::SmartPointer<EtchValidatorFloat> ptr = NULL;
 
   capu::SmartPointer<EtchValidator> val;
@@ -41,7 +64,7 @@
   EXPECT_TRUE(ptr->getNDims() == 2);
 }
 
-TEST(EtchValidatorFloatTest, validateTest) {
+TEST_F(EtchValidatorFloatTest, validateTest) {
   capu::SmartPointer<EtchObject> byte = NULL;
 
   capu::SmartPointer<EtchObject> floatTmp = new EtchFloat(capu::NumericLimitMin<capu::float_t>());
@@ -65,7 +88,7 @@
   EXPECT_TRUE(ptr->validate(floatTmp3));
 }
 
-TEST(EtchValidatorFloatTest, validateValueTest) {
+TEST_F(EtchValidatorFloatTest, validateValueTest) {
   capu::SmartPointer<EtchObject> byte = NULL;
   capu::SmartPointer<EtchObject> result;
   capu::SmartPointer<EtchObject> floatTmp = new EtchFloat(static_cast<capu::float_t>(-128.12));
@@ -82,7 +105,7 @@
   EXPECT_TRUE(((EtchFloat*) result.get())->get() == ((EtchFloat*) floatTmp3.get())->get());
 }
 
-TEST(EtchValidatorFloatTest, elementValidatorTest) {
+TEST_F(EtchValidatorFloatTest, elementValidatorTest) {
   capu::SmartPointer<EtchValidator> ptr = NULL;
   EXPECT_TRUE(EtchValidatorFloat::Get(1, ptr) == ETCH_OK);
   capu::SmartPointer<EtchValidator> elementValidator;
diff --git a/binding-cpp/runtime/src/test/serialization/EtchValidatorIntTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchValidatorIntTest.cpp
index 220b1b7..b95c47d 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchValidatorIntTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchValidatorIntTest.cpp
@@ -20,8 +20,31 @@
 #include "serialization/EtchValidatorInt.h"
 #include "capu/util/SmartPointer.h"
 #include "common/EtchString.h"
+#include "support/EtchRuntime.h"
 
-TEST(EtchValidatorIntTest, createTest) {
+class EtchValidatorIntTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchValidatorIntTest, createTest) {
   capu::SmartPointer<EtchValidatorInt> ptr = NULL;
   capu::SmartPointer<EtchValidator> val;
   EXPECT_TRUE(EtchValidatorInt::Get(0, val) == ETCH_OK);
@@ -38,7 +61,7 @@
 
 }
 
-TEST(EtchValidatorIntTest, validateTest) {
+TEST_F(EtchValidatorIntTest, validateTest) {
   capu::SmartPointer<EtchObject> byte = NULL;
 
   capu::SmartPointer<EtchObject> integer = new EtchInt32(capu::NumericLimitMin<capu::int32_t>());
@@ -90,7 +113,7 @@
   EXPECT_TRUE(ptr->validate(shortInteger4));
 }
 
-TEST(EtchValidatorIntTest, validateValueTest) {
+TEST_F(EtchValidatorIntTest, validateValueTest) {
   capu::SmartPointer<EtchObject> byte = NULL;
   capu::SmartPointer<EtchObject> result;
   capu::SmartPointer<EtchObject> integer = new EtchInt32(-128);
@@ -113,7 +136,7 @@
   EXPECT_TRUE(((EtchInt32*) result.get())->get() == ((EtchByte*) byte2.get())->get());
 }
 
-TEST(EtchValidatorIntTest, elementValidatorTest) {
+TEST_F(EtchValidatorIntTest, elementValidatorTest) {
   capu::SmartPointer<EtchValidator> ptr = NULL;
   EXPECT_TRUE(EtchValidatorInt::Get(1, ptr) == ETCH_OK);
   capu::SmartPointer<EtchValidator> elementValidator;
diff --git a/binding-cpp/runtime/src/test/serialization/EtchValidatorLongTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchValidatorLongTest.cpp
index 1e162a6..3b1a4cc 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchValidatorLongTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchValidatorLongTest.cpp
@@ -20,8 +20,31 @@
 #include "serialization/EtchValidatorLong.h"
 #include "capu/util/SmartPointer.h"
 #include "common/EtchString.h"
+#include "support/EtchRuntime.h"
 
-TEST(EtchValidatorLongTest, createTest) {
+class EtchValidatorLongTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchValidatorLongTest, createTest) {
   capu::SmartPointer<EtchValidatorLong> ptr = NULL;
 
   capu::SmartPointer<EtchValidator> val;
@@ -40,7 +63,7 @@
 
 }
 
-TEST(EtchValidatorLongTest, validateTest) {
+TEST_F(EtchValidatorLongTest, validateTest) {
   capu::SmartPointer<EtchObject> byte = NULL;
 
   capu::SmartPointer<EtchObject> integer = new EtchInt32(capu::NumericLimitMin<capu::int32_t>());
@@ -91,7 +114,7 @@
   EXPECT_TRUE(ptr->validate(shortInteger4));
 }
 
-TEST(EtchValidatorLongTest, validateValueTest) {
+TEST_F(EtchValidatorLongTest, validateValueTest) {
   capu::SmartPointer<EtchObject> byte = NULL;
   capu::SmartPointer<EtchObject> result;
   capu::SmartPointer<EtchObject> integer = new EtchInt32(-128);
@@ -111,7 +134,7 @@
   EXPECT_TRUE(((EtchLong*) result.get())->get() == ((EtchByte*) byte2.get())->get());
 }
 
-TEST(EtchValidatorLongTest, elementValidatorTest) {
+TEST_F(EtchValidatorLongTest, elementValidatorTest) {
   capu::SmartPointer<EtchValidator> ptr = NULL;
   EXPECT_TRUE(EtchValidatorLong::Get(1, ptr) == ETCH_OK);
   capu::SmartPointer<EtchValidator> elementValidator;
diff --git a/binding-cpp/runtime/src/test/serialization/EtchValidatorObjectTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchValidatorObjectTest.cpp
index 18f4f65..8ab586d 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchValidatorObjectTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchValidatorObjectTest.cpp
@@ -28,8 +28,31 @@
 #include "common/EtchString.h"
 #include "serialization/EtchTypeCodes.h"
 #include "capu/os/NumericLimits.h"
+#include "support/EtchRuntime.h"
 
-TEST(EtchValidatorObjectTest, createTest) {
+class EtchValidatorObjectTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchValidatorObjectTest, createTest) {
   capu::SmartPointer<EtchValidatorObject> ptr = NULL;
   capu::SmartPointer<EtchValidator> val;
   EXPECT_TRUE(EtchValidatorObject::Get(0, val) == ETCH_OK);
@@ -41,7 +64,7 @@
   EXPECT_TRUE(ptr->getNDims() == 2);
 }
 
-TEST(EtchValidatorObjectTest, validateTest) {
+TEST_F(EtchValidatorObjectTest, validateTest) {
   capu::SmartPointer<EtchObject> boolean = NULL;
   capu::SmartPointer<EtchObject> integer = new EtchInt32(4);
   capu::SmartPointer<EtchObject> boolean2 = new EtchBool(false);
@@ -53,7 +76,7 @@
   EXPECT_TRUE(ptr->validate(boolean2));
 }
 
-TEST(EtchValidatorObjectTest, validateValueTest) {
+TEST_F(EtchValidatorObjectTest, validateValueTest) {
   capu::SmartPointer<EtchObject> byte = NULL;
   capu::SmartPointer<EtchObject> result = NULL;
   capu::SmartPointer<EtchObject> integer = new EtchInt32(capu::NumericLimitMin<capu::int16_t > ());
@@ -108,7 +131,7 @@
   EXPECT_TRUE(ptr->validateValue(shortInteger4, result) == ETCH_OK);
 }
 
-TEST(EtchValidatorObjectTest, elementValidatorTest) {
+TEST_F(EtchValidatorObjectTest, elementValidatorTest) {
   capu::SmartPointer<EtchValidator> ptr = NULL;
   EXPECT_TRUE(EtchValidatorObject::Get(1, ptr) == ETCH_OK);
   capu::SmartPointer<EtchValidator> elementValidator;
diff --git a/binding-cpp/runtime/src/test/serialization/EtchValidatorRuntimeExceptionTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchValidatorRuntimeExceptionTest.cpp
index 45c31d8..ed250fd 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchValidatorRuntimeExceptionTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchValidatorRuntimeExceptionTest.cpp
@@ -21,15 +21,38 @@
 #include "capu/util/SmartPointer.h"
 #include "common/EtchInt32.h"
 #include "common/EtchRuntimeException.h"
+#include "support/EtchRuntime.h"
 
-TEST(EtchValidatorRuntimeExceptionTest, createTest) {
+class EtchValidatorRuntimeExceptionTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchValidatorRuntimeExceptionTest, createTest) {
   capu::SmartPointer<EtchValidatorRuntimeException> ptr = NULL;
   capu::SmartPointer<EtchValidator> val;
   EXPECT_TRUE(EtchValidatorRuntimeException::Get(val) == ETCH_OK);
   ptr = capu::smartpointer_cast<EtchValidatorRuntimeException>(val);
 }
 
-TEST(EtchValidatorRuntimeExceptionTest, validateTest) {
+TEST_F(EtchValidatorRuntimeExceptionTest, validateTest) {
   EtchString excepmess("test");
   capu::SmartPointer<EtchObject> boolean = NULL;
   capu::SmartPointer<EtchObject> integer = new EtchInt32(4);
@@ -42,7 +65,7 @@
 
 }
 
-TEST(EtchValidatorRuntimeExceptionTest, validateValueTest) {
+TEST_F(EtchValidatorRuntimeExceptionTest, validateValueTest) {
   EtchString excepmess("test");
 
   capu::SmartPointer<EtchObject> boolean = NULL;
diff --git a/binding-cpp/runtime/src/test/serialization/EtchValidatorShortTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchValidatorShortTest.cpp
index 60668e4..a8da752 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchValidatorShortTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchValidatorShortTest.cpp
@@ -20,8 +20,31 @@
 #include "serialization/EtchValidatorShort.h"
 #include "capu/util/SmartPointer.h"
 #include "common/EtchString.h"
+#include "support/EtchRuntime.h"
 
-TEST(EtchValidatorShortTest, createTest) {
+class EtchValidatorShortTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchValidatorShortTest, createTest) {
   capu::SmartPointer<EtchValidatorShort> ptr = NULL;
   capu::SmartPointer<EtchValidator> val;
   EXPECT_TRUE(EtchValidatorShort::Get(0, val) == ETCH_OK);
@@ -37,7 +60,7 @@
   EXPECT_TRUE(ptr->getNDims() == 2);
 }
 
-TEST(EtchValidatorShortTest, validateTest) {
+TEST_F(EtchValidatorShortTest, validateTest) {
   capu::SmartPointer<EtchObject> byte = NULL;
 
   capu::SmartPointer<EtchObject> integer = new EtchInt32(capu::NumericLimitMin<capu::int16_t>());
@@ -92,7 +115,7 @@
   EXPECT_TRUE(ptr->validate(shortInteger4));
 }
 
-TEST(EtchValidatorShortTest, validateValueTest) {
+TEST_F(EtchValidatorShortTest, validateValueTest) {
   capu::SmartPointer<EtchObject> byte = NULL;
   capu::SmartPointer<EtchObject> result;
   capu::SmartPointer<EtchObject> integer = new EtchInt32(-128);
@@ -112,7 +135,7 @@
   EXPECT_TRUE(((EtchShort*) result.get())->get() == ((EtchByte*) byte2.get())->get());
 }
 
-TEST(EtchValidatorShortTest, elementValidatorTest) {
+TEST_F(EtchValidatorShortTest, elementValidatorTest) {
   capu::SmartPointer<EtchValidator> ptr = NULL;
   EXPECT_TRUE(EtchValidatorShort::Get(1, ptr) == ETCH_OK);
   capu::SmartPointer<EtchValidator> elementValidator;
diff --git a/binding-cpp/runtime/src/test/serialization/EtchValidatorStringTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchValidatorStringTest.cpp
index 2083f6c..5317030 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchValidatorStringTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchValidatorStringTest.cpp
@@ -20,8 +20,31 @@
 #include "serialization/EtchValidatorString.h"
 #include "capu/util/SmartPointer.h"
 #include "common/EtchInt32.h"
+#include "support/EtchRuntime.h"
 
-TEST(EtchValidatorStringTest, createTest) {
+class EtchValidatorStringTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchValidatorStringTest, createTest) {
   capu::SmartPointer<EtchValidatorString> ptr = NULL;
 
   capu::SmartPointer<EtchValidator> val;
@@ -40,7 +63,7 @@
 
 }
 
-TEST(EtchValidatorStringTest, validateTest) {
+TEST_F(EtchValidatorStringTest, validateTest) {
   capu::SmartPointer<EtchObject> str = NULL;
   capu::SmartPointer<EtchObject> integer = new EtchInt32(4);
   capu::SmartPointer<EtchObject> str2 = new EtchString("hello");
@@ -52,7 +75,7 @@
   EXPECT_TRUE(ptr->validate(str2));
 }
 
-TEST(EtchValidatorStringTest, validateValueTest) {
+TEST_F(EtchValidatorStringTest, validateValueTest) {
   capu::SmartPointer<EtchObject> str = NULL;
   capu::SmartPointer<EtchObject> result;
   capu::SmartPointer<EtchObject> integer = new EtchInt32(4);
@@ -65,7 +88,7 @@
   EXPECT_TRUE(((EtchString*) result.get())->equals((EtchString*) str2.get()));
 }
 
-TEST(EtchValidatorStringTest, elementValidatorTest) {
+TEST_F(EtchValidatorStringTest, elementValidatorTest) {
   capu::SmartPointer<EtchValidator> ptr = NULL;
   EXPECT_TRUE(EtchValidatorString::Get(1, ptr) == ETCH_OK);
   capu::SmartPointer<EtchValidator> elementValidator;
diff --git a/binding-cpp/runtime/src/test/serialization/EtchValidatorStructValueTest.cpp b/binding-cpp/runtime/src/test/serialization/EtchValidatorStructValueTest.cpp
index c889f95..305fd3e 100644
--- a/binding-cpp/runtime/src/test/serialization/EtchValidatorStructValueTest.cpp
+++ b/binding-cpp/runtime/src/test/serialization/EtchValidatorStructValueTest.cpp
@@ -28,6 +28,7 @@
 #include "serialization/EtchTypeCodes.h"
 #include "serialization/EtchStructValue.h"
 #include "capu/os/NumericLimits.h"
+#include "support/EtchRuntime.h"
 
 class MockValueFactory8 : public virtual EtchValueFactory {
 public:
@@ -73,7 +74,29 @@
 
 };
 
-TEST(EtchValidatorStructValueTest, createTest) {
+class EtchValidatorStructValueTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchValidatorStructValueTest, createTest) {
   EtchString str("typename");
   EtchType *type = new EtchType(str);
   capu::SmartPointer<EtchValidatorStructValue> ptr = NULL;
@@ -97,7 +120,7 @@
   delete type;
 }
 
-TEST(EtchValidatorStructValueTest, elementValidator) {
+TEST_F(EtchValidatorStructValueTest, elementValidator) {
   EtchString str("typename");
   EtchType *type = new EtchType(str);
   capu::SmartPointer<EtchValidator> elementValidator;
@@ -167,7 +190,7 @@
   delete type;
 }
 
-TEST(EtchValidatorStructValueTest, validateTest) {
+TEST_F(EtchValidatorStructValueTest, validateTest) {
 
   EtchString str("typename");
   EtchType *type = new EtchType(str);
@@ -235,7 +258,7 @@
   delete type;
 }
 
-TEST(EtchValidatorStructValueTest, validateValueTest) {
+TEST_F(EtchValidatorStructValueTest, validateValueTest) {
   EtchString str("typename");
   EtchType *type = new EtchType(str);
   capu::SmartPointer<EtchValidator> ptr = NULL;
diff --git a/binding-cpp/runtime/src/test/support/EtchRemoteBaseTest.cpp b/binding-cpp/runtime/src/test/support/EtchRemoteBaseTest.cpp
index cc868d7..fc1d8ab 100644
--- a/binding-cpp/runtime/src/test/support/EtchRemoteBaseTest.cpp
+++ b/binding-cpp/runtime/src/test/support/EtchRemoteBaseTest.cpp
@@ -23,6 +23,7 @@
 #include "serialization/EtchDefaultValueFactory.h"
 #include "support/EtchPlainMailbox.h"
 #include "transport/EtchPlainMailboxManager.h"
+#include "support/EtchRuntime.h"
 
 class MockSession2 : public EtchSessionMessage {
 public:
@@ -93,7 +94,29 @@
   }
 };
 
-TEST(EtchRemoteBaseTest, constructorTest) {
+class EtchRemoteBaseTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchRemoteBaseTest, constructorTest) {
   MockSession2 session;
   MockTransport2 *transport = new MockTransport2();
   MockDefaultValueFactory2 *factory;
@@ -117,7 +140,7 @@
   delete factory;
 }
 
-TEST(EtchRemoteBaseTest, newMessageTest) {
+TEST_F(EtchRemoteBaseTest, newMessageTest) {
   MockSession2 session;
   MockTransport2 *transport = new MockTransport2();
   MockDefaultValueFactory2 *factory;
@@ -155,7 +178,7 @@
   delete factory;
 }
 
-TEST(EtchRemoteBaseTest, sendTest) {
+TEST_F(EtchRemoteBaseTest, sendTest) {
   MockSession2 session;
   MockTransport2 *transport = new MockTransport2();
   MockDefaultValueFactory2 *factory;
@@ -197,7 +220,7 @@
   delete factory;
 }
 
-TEST(EtchRemoteBaseTest, beginCallTest) {
+TEST_F(EtchRemoteBaseTest, beginCallTest) {
   MockSession2 session;
   MockTransport2 *transport = new MockTransport2();
   MockDefaultValueFactory2 *factory;
@@ -244,7 +267,7 @@
   delete factory;
 }
 
-TEST(EtchRemoteBaseTest, endCallTest) {
+TEST_F(EtchRemoteBaseTest, endCallTest) {
   MockSession2 session;
   MockTransport2 *transport = new MockTransport2();
   MockDefaultValueFactory2 *factory;
diff --git a/binding-cpp/runtime/src/test/transport/EtchDefaultDeliveryServiceTest.cpp b/binding-cpp/runtime/src/test/transport/EtchDefaultDeliveryServiceTest.cpp
index 347bd4d..514e970 100644
--- a/binding-cpp/runtime/src/test/transport/EtchDefaultDeliveryServiceTest.cpp
+++ b/binding-cpp/runtime/src/test/transport/EtchDefaultDeliveryServiceTest.cpp
@@ -107,7 +107,29 @@
   }
 };
 
-TEST(EtchDeliveryServiceTest, constructorTest) {
+class EtchDefaultDeliveryServiceTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};
+
+TEST_F(EtchDefaultDeliveryServiceTest, constructorTest) {
 
   EtchString uri("tcp://127.0.0.1:4001");
 
@@ -123,7 +145,7 @@
   delete session;
 }
 
-TEST(EtchDeliveryServiceTest, beginCallTest) {
+TEST_F(EtchDefaultDeliveryServiceTest, beginCallTest) {
   EtchString uri("tcp://127.0.0.1:4001");
 
   // create value factory
@@ -172,7 +194,7 @@
   delete factory;
 }
 
-TEST(EtchDeliveryServiceTest, endCallTest) {
+TEST_F(EtchDefaultDeliveryServiceTest, endCallTest) {
   status_t status;
   EtchString uri("tcp://127.0.0.1:4001");
 
diff --git a/binding-cpp/runtime/src/test/transport/EtchMessageTest.cpp b/binding-cpp/runtime/src/test/transport/EtchMessageTest.cpp
index f705b8c..327b2a6 100644
--- a/binding-cpp/runtime/src/test/transport/EtchMessageTest.cpp
+++ b/binding-cpp/runtime/src/test/transport/EtchMessageTest.cpp
@@ -20,6 +20,7 @@
 #include <gmock/gmock.h>
 #include "transport/EtchMessage.h"
 #include "serialization/EtchValidatorBoolean.h"
+#include "support/EtchRuntime.h"
 
 class MockValueFactory7 : public virtual EtchValueFactory {
 public:
@@ -71,7 +72,31 @@
   capu::int64_t tmp;
 };
 
-TEST(EtchMessageTest, createTest) {
+class EtchMessageTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+

+  }

+private:
+  EtchRuntime* mRuntime;
+};
+
+
+TEST_F(EtchMessageTest, createTest) {
   EtchType *type = new EtchType("test");
   EtchValueFactory *factory = new MockValueFactory7();
   EtchMessage *message = new EtchMessage(type, factory);
@@ -81,7 +106,7 @@
   delete factory;
 }
 
-TEST(EtchMessageTest, getMessageIdTests) {
+TEST_F(EtchMessageTest, getMessageIdTests) {
   EtchType *type = new EtchType("test");
   EtchValueFactory *factory = new MockValueFactory7();
   EtchMessage *message = new EtchMessage(type, factory);
@@ -94,7 +119,7 @@
   delete factory;
 }
 
-TEST(EtchMessage, getTypeTest) {
+TEST_F(EtchMessageTest, getTypeTest) {
   EtchField field1("type1");
   EtchField field2("type2");
 
@@ -120,7 +145,7 @@
   delete comp;
 }
 
-TEST(EtchMessageTest, isType) {
+TEST_F(EtchMessageTest, isType) {
   //Type 1
   EtchField field1("type1");
   EtchField field2("type2");
@@ -149,7 +174,7 @@
   delete comp2;
 }
 
-TEST(EtchMessageTest, putTest) {
+TEST_F(EtchMessageTest, putTest) {
   EtchString fieldtype1("type1");
   EtchString fieldtype2("type2");
   EtchString typeName("comp");
@@ -192,7 +217,7 @@
   delete comp;
 }
 
-TEST(EtchMessageTest, getTest) {
+TEST_F(EtchMessageTest, getTest) {
   EtchString fieldtype1("type1");
   EtchString fieldtype2("type2");
   EtchField field1(fieldtype1);
@@ -231,7 +256,7 @@
   delete comp;
 }
 
-TEST(EtchMessageTest, removeTest) {
+TEST_F(EtchMessageTest, removeTest) {
   EtchString fieldtype1("type1");
   EtchString typeName("comp");
   EtchField field1(fieldtype1);
@@ -275,4 +300,3 @@
   delete comp;
   delete factory;
 }
-
diff --git a/binding-cpp/runtime/src/test/transport/EtchMessagizerTest.cpp b/binding-cpp/runtime/src/test/transport/EtchMessagizerTest.cpp
index 7289165..2ff65b1 100644
--- a/binding-cpp/runtime/src/test/transport/EtchMessagizerTest.cpp
+++ b/binding-cpp/runtime/src/test/transport/EtchMessagizerTest.cpp
@@ -79,7 +79,29 @@
   }
 };

 

-TEST(EtchMessagizerTest, constructorTest) {

+class EtchMessagizerTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+

+  EtchRuntime* mRuntime;

+};

+

+TEST_F(EtchMessagizerTest, constructorTest) {

   EtchTypeMap types;

   EtchClass2TypeMap class2type;

   EtchDefaultValueFactory * factory;

@@ -91,7 +113,7 @@
   EtchResources r;

   EtchObject *out;

   r.put(EtchTransport<EtchSessionMessage>::VALUE_FACTORY(), factory, out);
-  EtchTransportData* conn = new EtchTcpConnection(NULL, NULL, &u);
+  EtchTransportData* conn = new EtchTcpConnection(mRuntime, NULL, &u);

   EtchTransportPacket* pac = new EtchPacketizer(conn, &u);

   EtchSessionPacket* mes = new EtchMessagizer(pac, &u, &r);

   //Created stack

@@ -100,7 +122,7 @@
   types.clear();

 }

 

-TEST(EtchMessagizerTest, TransportControlTest) {

+TEST_F(EtchMessagizerTest, TransportControlTest) {

   EtchTypeMap types;

   EtchClass2TypeMap class2type;

   EtchDefaultValueFactory * factory;

@@ -113,7 +135,7 @@
   EtchResources r;

   EtchObject *out;

   r.put(EtchTransport<EtchSessionMessage>::VALUE_FACTORY(), factory, out);
-  EtchTransportData* conn = new EtchTcpConnection(NULL, NULL, &u);
+  EtchTransportData* conn = new EtchTcpConnection(mRuntime, NULL, &u);

   EtchPacketizer* pac = new EtchPacketizer(conn, &u);

   EtchMessagizer* mess = new EtchMessagizer(pac, &u, &r);

   mess->setSession(&manager);
@@ -135,7 +157,7 @@
   types.clear();

 }

 

-TEST(EtchMessagizerTest, TransportMessageTest) {

+TEST_F(EtchMessagizerTest, TransportMessageTest) {

   EtchTypeMap types;

   EtchClass2TypeMap class2type;

   EtchDefaultValueFactory * factory;

@@ -149,7 +171,7 @@
   EtchObject *out;

   //add to the resource

   r.put(EtchTransport<EtchSessionMessage>::VALUE_FACTORY(), factory, out);
-  EtchTransportData* conn = new EtchTcpConnection(NULL, NULL, &u);
+  EtchTransportData* conn = new EtchTcpConnection(mRuntime, NULL, &u);

   EtchPacketizer* pac = new EtchPacketizer(conn, &u);

   EtchMessagizer* mess = new EtchMessagizer(pac, &u, &r);

   mess->setSession(&manager);
@@ -172,7 +194,7 @@
   types.clear();

 }

 

-TEST(EtchMessagizerTest, SessionDataTest) {

+TEST_F(EtchMessagizerTest, SessionDataTest) {

   //creation of an example message to compare the deserialized messageMyValueFactory vf("tcp:");

   EtchTypeMap types;

   EtchClass2TypeMap class2type;

@@ -202,7 +224,7 @@
   //add the value factory to the resources

   r.put(EtchTransport<EtchSessionMessage>::VALUE_FACTORY(), factory, out);
   //create stack

-  EtchTransportData* conn = new EtchTcpConnection(NULL, NULL, &u);
+  EtchTransportData* conn = new EtchTcpConnection(mRuntime, NULL, &u);

   EtchPacketizer* pac = new EtchPacketizer(conn, &u);

   EtchMessagizer* mess = new EtchMessagizer(pac, &u, &r);

   capu::SmartPointer<EtchFlexBuffer> buffer = new EtchFlexBuffer();

@@ -230,7 +252,3 @@
   delete mess;

   delete factory;

 }

-

-

-

-

diff --git a/binding-cpp/runtime/src/test/transport/EtchPacketizerTest.cpp b/binding-cpp/runtime/src/test/transport/EtchPacketizerTest.cpp
index 8b76368..70afd25 100644
--- a/binding-cpp/runtime/src/test/transport/EtchPacketizerTest.cpp
+++ b/binding-cpp/runtime/src/test/transport/EtchPacketizerTest.cpp
@@ -76,16 +76,38 @@
   }
 };

 

-TEST(EtchPacketizer, constructorTest) {

+class EtchPacketizerTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};

+

+TEST_F(EtchPacketizerTest, constructorTest) {

   EtchURL u("tcp://127.0.0.1:4001");

-  EtchTransportData* conn = new EtchTcpConnection(NULL, NULL, &u);
+  EtchTransportData* conn = new EtchTcpConnection(mRuntime, NULL, &u);
   EtchSessionData* packetizer = new EtchPacketizer(conn, &u);

   delete packetizer;

 }

 

-TEST(EtchPacketizer, TransportControlTest) {

+TEST_F(EtchPacketizerTest, TransportControlTest) {

   EtchURL u("tcp://127.0.0.1:4001");

-  EtchTransportData* conn = new EtchTcpConnection(NULL, NULL, &u);
+  EtchTransportData* conn = new EtchTcpConnection(mRuntime, NULL, &u);
   EtchPacketizer* packetizer = new EtchPacketizer(conn, &u);
   MockMessagizer mes;
   packetizer->setSession(&mes);
@@ -106,9 +128,9 @@
   delete listener;

 }

 

-TEST(EtchPacketizer, TransportPacketTest) {

+TEST_F(EtchPacketizerTest, TransportPacketTest) {

   EtchURL u("tcp://127.0.0.1:4001");

-  EtchTransportData* conn = new EtchTcpConnection(NULL, NULL, &u);
+  EtchTransportData* conn = new EtchTcpConnection(mRuntime, NULL, &u);
   EtchPacketizer* packetizer = new EtchPacketizer(conn, &u);

   MockMessagizer mes;
   packetizer->setSession(&mes);
@@ -123,9 +145,9 @@
   delete packetizer;

 }

 

-TEST(EtchPacketizer, SessionDataTest) {

+TEST_F(EtchPacketizerTest, SessionDataTest) {

   EtchURL u("tcp://127.0.0.1:4001");

-  EtchTransportData* conn = new EtchTcpConnection(NULL, NULL, &u);
+  EtchTransportData* conn = new EtchTcpConnection(mRuntime, NULL, &u);
   EtchPacketizer* packetizer = new EtchPacketizer(conn, &u);

   capu::SmartPointer<EtchFlexBuffer> buffer = new EtchFlexBuffer();

   //A packet is created

diff --git a/binding-cpp/runtime/src/test/transport/EtchPlainMailboxManagerTest.cpp b/binding-cpp/runtime/src/test/transport/EtchPlainMailboxManagerTest.cpp
index cb5924d..bf5866d 100644
--- a/binding-cpp/runtime/src/test/transport/EtchPlainMailboxManagerTest.cpp
+++ b/binding-cpp/runtime/src/test/transport/EtchPlainMailboxManagerTest.cpp
@@ -90,7 +90,29 @@
   }
 };
 
-TEST(EtchPlainMailboxManager, constructorTest) {
+class EtchPlainMailboxManagerTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};

+
+TEST_F(EtchPlainMailboxManagerTest, constructorTest) {
   MockTransport *transport = new MockTransport();
   MockSession session;
   MockDefaultValueFactory *factory;
@@ -108,7 +130,7 @@
   delete factory;
 }
 
-TEST(EtchPlainMailboxManager, transportMessageTest) {
+TEST_F(EtchPlainMailboxManagerTest, transportMessageTest) {
   EtchString uri("tcp://127.0.0.1:4001");
   MockDefaultValueFactory *factory;
   factory = new MockDefaultValueFactory(uri);
@@ -147,7 +169,7 @@
   delete factory;
 }
 
-TEST(EtchPlainMailboxManager, transportResultMessageTest) {
+TEST_F(EtchPlainMailboxManagerTest, transportResultMessageTest) {
   EtchString uri("tcp://127.0.0.1:4001");
   MockDefaultValueFactory *factory;
   factory = new MockDefaultValueFactory(uri);
@@ -189,7 +211,7 @@
   delete factory;
 }
 
-TEST(EtchPlainMailboxManager, transportCallTest) {
+TEST_F(EtchPlainMailboxManagerTest, transportCallTest) {
   EtchString uri("tcp://127.0.0.1:4001");
   MockDefaultValueFactory *factory;
   factory = new MockDefaultValueFactory(uri);
@@ -230,7 +252,7 @@
   delete factory;
 }
 
-TEST(EtchPlainMailboxManager, replicatedTransportCallTest) {
+TEST_F(EtchPlainMailboxManagerTest, replicatedTransportCallTest) {
   EtchString uri("tcp://127.0.0.1:4001");
   MockDefaultValueFactory *factory;
   factory = new MockDefaultValueFactory(uri);
@@ -275,7 +297,7 @@
   delete factory;
 }
 
-TEST(EtchPlainMailboxManager, sessionMessageTest) {
+TEST_F(EtchPlainMailboxManagerTest, sessionMessageTest) {
   EtchString uri("tcp://127.0.0.1:4001");
   MockDefaultValueFactory *factory;
   factory = new MockDefaultValueFactory(uri);
diff --git a/binding-cpp/runtime/src/test/transport/EtchTcpConnectionTest.cpp b/binding-cpp/runtime/src/test/transport/EtchTcpConnectionTest.cpp
index d509d9c..79a2927 100644
--- a/binding-cpp/runtime/src/test/transport/EtchTcpConnectionTest.cpp
+++ b/binding-cpp/runtime/src/test/transport/EtchTcpConnectionTest.cpp
@@ -75,16 +75,38 @@
 

 };

 

-TEST(EtchTcpConnection, constructorTest) {

+class EtchTcpConnectionTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};

+

+TEST_F(EtchTcpConnectionTest, constructorTest) {

   EtchURL url("tcp://127.0.0.1:4001");

-  EtchTcpConnection * conn = new EtchTcpConnection(NULL, NULL, &url);
+  EtchTcpConnection * conn = new EtchTcpConnection(mRuntime, NULL, &url);
   EXPECT_TRUE(conn != NULL);

   delete conn;

 }

 

-TEST(EtchTcpConnection, isStartedTest) {

+TEST_F(EtchTcpConnectionTest, isStartedTest) {

   EtchURL url("tcp://127.0.0.1:4001");

-  EtchTcpConnection * conn = new EtchTcpConnection(NULL, NULL, &url);
+  EtchTcpConnection * conn = new EtchTcpConnection(mRuntime, NULL, &url);
   EtchTcpListener *listener = new EtchTcpListener(&url);

   EXPECT_FALSE(conn->isStarted());

   EtchSessionListener<EtchSocket>* mSessionListener = new MockListener();

@@ -107,11 +129,12 @@
   delete conn;

   delete mSessionListener;
   delete mPacketizer;
-}

+}
 

-TEST(EtchTcpConnectionAndListener, SessionAcceptTest) {

+

+TEST_F(EtchTcpConnectionTest, SessionAcceptTest) {

   EtchURL url("tcp://127.0.0.1:4001");

-  EtchTcpConnection * conn = new EtchTcpConnection(NULL, NULL, &url);
+  EtchTcpConnection * conn = new EtchTcpConnection(mRuntime, NULL, &url);
   EtchSessionListener<EtchSocket>* mSessionListener = new MockListener();

   EtchSessionData* mPacketizer = new MockPacketizer();

   EtchTcpListener *listener = new EtchTcpListener(&url);
diff --git a/binding-cpp/runtime/src/test/transport/EtchTcpListenerTest.cpp b/binding-cpp/runtime/src/test/transport/EtchTcpListenerTest.cpp
index 33d1111..0a1577f 100644
--- a/binding-cpp/runtime/src/test/transport/EtchTcpListenerTest.cpp
+++ b/binding-cpp/runtime/src/test/transport/EtchTcpListenerTest.cpp
@@ -69,14 +69,36 @@
 

 };

 

-TEST(EtchTcpListener, constructorTest) {

+class EtchTcpListenerTest

+  : public ::testing::Test {

+protected:

+  virtual void SetUp() {

+    mRuntime = new EtchRuntime();

+    mRuntime->setLogger(new EtchLogger());

+    mRuntime->start();

+  }

+

+  virtual void TearDown() {

+    mRuntime->shutdown();

+    EtchLogger* logger = mRuntime->getLogger();

+    if(logger != NULL) {

+      delete logger;

+    }

+    delete mRuntime;

+    mRuntime = NULL;

+  }

+
+  EtchRuntime* mRuntime;
+};

+

+TEST_F(EtchTcpListenerTest, constructorTest) {

   EtchURL url("tcp://127.0.0.1:4001");

   EtchTcpListener * tcpListener = new EtchTcpListener(&url);

   EXPECT_TRUE(tcpListener != NULL);

   delete tcpListener;

 }

 

-TEST(EtchTcpListener, transportControlTest) {

+TEST_F(EtchTcpListenerTest, transportControlTest) {

   MockListener2 mock;
   EtchURL url("tcp://127.0.0.1:4001");

   EtchTcpListener * tcpListener = new EtchTcpListener(&url);

@@ -87,11 +109,11 @@
   delete tcpListener;

 }

 

-TEST(EtchTcpListener, isStartedTest) {

+TEST_F(EtchTcpListenerTest, isStartedTest) {

   // TODO refactor this test
   
   EtchURL url("tcp://127.0.0.1:4001");

-  EtchTcpConnection * conn = new EtchTcpConnection(NULL, NULL, &url);
+  EtchTcpConnection * conn = new EtchTcpConnection(mRuntime, NULL, &url);
   EtchTcpListener *listener = new EtchTcpListener(&url);

   EtchSessionListener<EtchSocket>* mSessionListener = new MockListener2();

   EtchSessionData* mPacketizer = new MockPacketizer2();