You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@etch.apache.org by fi...@apache.org on 2012/08/23 18:42:49 UTC

svn commit: r1376584 [1/3] - in /incubator/etch/trunk/binding-cpp/runtime: include/common/ include/serialization/ include/support/ include/transport/ include/util/ lib/capu/modules/capu/ lib/capu/modules/capu/include/capu/container/ lib/capu/modules/ca...

Author: fitzner
Date: Thu Aug 23 16:42:45 2012
New Revision: 1376584

URL: http://svn.apache.org/viewvc?rev=1376584&view=rev
Log:
ETCH-243 Added log messages to the binding-cpp

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

Change-Id: I68715800f8d6dab3cf65262debb0b7249b7c9724

Added:
    incubator/etch/trunk/binding-cpp/runtime/include/util/EtchLogger.h
      - copied, changed from r1376511, incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/os/arch/File.inc
Modified:
    incubator/etch/trunk/binding-cpp/runtime/include/common/EtchObject.h
    incubator/etch/trunk/binding-cpp/runtime/include/common/EtchSocket.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchAuthenticationExceptionSerializer.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchBinaryTaggedDataInput.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchBinaryTaggedDataOutput.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchDateSerializer.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchHashTableSerializer.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchListSerializer.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchRuntimeExceptionSerializer.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchSetSerializer.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidator.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorBoolean.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorByte.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorCustom.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorDouble.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorFloat.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorInt.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorLong.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorNone.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorObject.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorRuntimeException.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorShort.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorString.h
    incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorStructValue.h
    incubator/etch/trunk/binding-cpp/runtime/include/support/EtchDefaultServerFactory.h
    incubator/etch/trunk/binding-cpp/runtime/include/support/EtchRemoteBase.h
    incubator/etch/trunk/binding-cpp/runtime/include/support/EtchRuntime.h
    incubator/etch/trunk/binding-cpp/runtime/include/support/EtchStubBase.h
    incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchConnection.h
    incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchDefaultDeliveryService.h
    incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchMessagizer.h
    incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchPacketizer.h
    incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchPlainMailboxManager.h
    incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchTcpConnection.h
    incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchTcpListener.h
    incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/CMakeLists.txt
    incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/List.h
    incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/os/arch/File.inc
    incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/util/Logger.h
    incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/src/util/Logger.cpp
    incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/test/os/FileTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchObject.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchAuthenticationExceptionSerializer.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataInput.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataOutput.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchDateSerializer.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchHashTableSerializer.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchListSerializer.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchRuntimeExceptionSerializer.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchSetSerializer.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorBoolean.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorByte.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorCustom.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorDouble.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorFloat.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorInt.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorLong.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorNone.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorObject.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorRuntimeException.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorShort.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorString.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchValidatorStructValue.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/support/EtchRemoteBase.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/support/EtchRuntime.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/support/EtchTransportHelper.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/transport/EtchDefaultDeliveryService.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/transport/EtchMessage.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/transport/EtchMessagizer.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/transport/EtchPacketizer.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/transport/EtchPlainMailboxManager.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/transport/EtchTcpConnection.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/transport/EtchTcpListener.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/main/transport/EtchTcpTransportFactory.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchAuthenticationExceptionSerializerTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchBinaryTaggedDataInputOutputTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchDateSerializerTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchDefaultValueFactoryTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchHashTableSerializerTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchListSerializerTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchRuntimeExceptionSerializerTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchSetSerializerTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchStructValueTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchTypeTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorBooleanTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorByteTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorCustomTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorDoubleTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorFloatTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorIntTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorLongTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorObjectTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorRuntimeExceptionTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorShortTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorStringTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/serialization/EtchValidatorStructValueTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/support/EtchRemoteBaseTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/transport/EtchDefaultDeliveryServiceTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/transport/EtchMessageTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/transport/EtchMessagizerTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/transport/EtchPacketizerTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/transport/EtchPlainMailboxManagerTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/transport/EtchTcpConnectionTest.cpp
    incubator/etch/trunk/binding-cpp/runtime/src/test/transport/EtchTcpListenerTest.cpp

Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchObject.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchObject.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchObject.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchObject.h Thu Aug 23 16:42:45 2012
@@ -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 @@ public:
    */
   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 @@ public:
    */
   virtual capu::bool_t equals(const EtchObject * other) const;
 
-private:
-
-  const EtchObjectType* mType;
-
+  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);
+
+    // 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;

Modified: incubator/etch/trunk/binding-cpp/runtime/include/common/EtchSocket.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/common/EtchSocket.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/common/EtchSocket.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/common/EtchSocket.h Thu Aug 23 16:42:45 2012
@@ -29,7 +29,7 @@ public:
   /**
    * EtchObjectType for EtchSocket.
    */
-  static const EtchObjectType* TYPE();;
+  static const EtchObjectType* TYPE();
 
   /**
    * Default Constructor

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchAuthenticationExceptionSerializer.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchAuthenticationExceptionSerializer.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchAuthenticationExceptionSerializer.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchAuthenticationExceptionSerializer.h Thu Aug 23 16:42:45 2012
@@ -28,6 +28,7 @@
 #include "serialization/EtchClass2TypeMap.h"
 #include "serialization/EtchValidatorString.h"
 
+class EtchRuntime;
 
 class EtchAuthenticationExceptionSerializer : public EtchImportExportHelper {
 public:
@@ -55,7 +56,7 @@ public:
   static status_t Init(EtchType* type, EtchClass2TypeMap* class2type);
 
 private:
-
+  EtchRuntime* mRuntime;
   EtchField mField;
   EtchType* mType;
   const static EtchString& FIELD_NAME();

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchBinaryTaggedDataInput.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchBinaryTaggedDataInput.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchBinaryTaggedDataInput.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchBinaryTaggedDataInput.h Thu Aug 23 16:42:45 2012
@@ -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 @@ public:
   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 @@ private:
   status_t readBytes(capu::int8_t*& array, capu::uint32_t &length);
 };
 
-
 #endif
-

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchBinaryTaggedDataOutput.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchBinaryTaggedDataOutput.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchBinaryTaggedDataOutput.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchBinaryTaggedDataOutput.h Thu Aug 23 16:42:45 2012
@@ -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 @@ public:
    */
   static const EtchString& STRING_TYPE_AND_FIELD();
 
-
   /**
    * Constructs the BinaryTaggedDataInput with a null buffer.
    *
@@ -56,6 +57,7 @@ public:
   status_t writeMessage(capu::SmartPointer<EtchMessage> msg, capu::SmartPointer<EtchFlexBuffer> buf);
 
 private:
+  EtchRuntime* mRuntime;
   capu::SmartPointer<EtchFlexBuffer> mBuffer;
   EtchLevel mLevel;
   capu::bool_t mStringTypeAndField;

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchDateSerializer.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchDateSerializer.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchDateSerializer.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchDateSerializer.h Thu Aug 23 16:42:45 2012
@@ -27,6 +27,8 @@
 #include "serialization/EtchClass2TypeMap.h"
 #include "serialization/EtchValidatorLong.h"
 
+class EtchRuntime;
+
 class EtchDateSerializer : public EtchImportExportHelper {
 public:
 
@@ -59,7 +61,7 @@ public:
   static status_t Init(EtchType* type, EtchClass2TypeMap* class2type);
 
 private:
-
+  EtchRuntime* mRuntime;
   EtchField mField;
   EtchType* mType;
   const static EtchString& FIELD_NAME();

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchHashTableSerializer.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchHashTableSerializer.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchHashTableSerializer.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchHashTableSerializer.h Thu Aug 23 16:42:45 2012
@@ -29,6 +29,8 @@
 #include "serialization/EtchValidatorObject.h"
 #include "serialization/EtchValidatorObject.h"
 
+class EtchRuntime;
+
 class EtchHashTableSerializer : public EtchImportExportHelper {
 public:
 
@@ -60,7 +62,7 @@ public:
   static status_t Init(EtchType* type, EtchClass2TypeMap* class2type);
 
 private:
-
+  EtchRuntime* mRuntime;
   EtchField mField;
   EtchType* mType;
   const static EtchString& FIELD_NAME();

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchListSerializer.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchListSerializer.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchListSerializer.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchListSerializer.h Thu Aug 23 16:42:45 2012
@@ -28,6 +28,8 @@
 #include "serialization/EtchClass2TypeMap.h"
 #include "serialization/EtchValidatorObject.h"
 
+class EtchRuntime;
+
 class EtchListSerializer : public EtchImportExportHelper {
 public:
 
@@ -59,7 +61,7 @@ public:
   static status_t Init(EtchType* type, EtchClass2TypeMap* class2type);
 
 private:
-
+  EtchRuntime* mRuntime;
   EtchType* mType;
   EtchField mField;
   const static EtchString& FIELD_NAME();

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchRuntimeExceptionSerializer.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchRuntimeExceptionSerializer.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchRuntimeExceptionSerializer.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchRuntimeExceptionSerializer.h Thu Aug 23 16:42:45 2012
@@ -29,6 +29,8 @@
 #include "serialization/EtchClass2TypeMap.h"
 #include "serialization/EtchValidatorString.h"
 
+class EtchRuntime;
+
 class EtchRuntimeExceptionSerializer : public EtchImportExportHelper {
 public:
 
@@ -60,7 +62,7 @@ public:
   static status_t Init(EtchType* type, EtchClass2TypeMap* class2type);
 
 private:
-
+  EtchRuntime* mRuntime;
   EtchType* mType;
   EtchField mField;
   const static EtchString& FIELD_NAME();

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchSetSerializer.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchSetSerializer.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchSetSerializer.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchSetSerializer.h Thu Aug 23 16:42:45 2012
@@ -29,6 +29,7 @@
 #include "serialization/EtchClass2TypeMap.h"
 #include "serialization/EtchValidatorObject.h"
 
+class EtchRuntime;
 
 class EtchSetSerializer : public EtchImportExportHelper {
 public:
@@ -55,7 +56,7 @@ public:
   static status_t Init(EtchType* type, EtchClass2TypeMap* class2type);
 
 private:
-
+  EtchRuntime* mRuntime;
   EtchField mField;
   EtchType* mType;
   const static EtchString& FIELD_NAME();

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidator.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidator.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidator.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidator.h Thu Aug 23 16:42:45 2012
@@ -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 @@ public:
 
 };
 
+/**
+ * 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 */
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorBoolean.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorBoolean.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorBoolean.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorBoolean.h Thu Aug 23 16:42:45 2012
@@ -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 @@ protected:
   EtchValidatorBoolean(capu::uint32_t ndim);
 
 private:
-  static capu::SmartPointer<EtchValidator>* Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 };
 
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorByte.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorByte.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorByte.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorByte.h Thu Aug 23 16:42:45 2012
@@ -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 @@ protected:
   EtchValidatorByte(capu::uint32_t ndim);
 
 private:
-  static capu::SmartPointer<EtchValidator>* Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 
 };
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorCustom.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorCustom.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorCustom.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorCustom.h Thu Aug 23 16:42:45 2012
@@ -116,8 +116,7 @@ protected:
   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 */

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorDouble.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorDouble.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorDouble.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorDouble.h Thu Aug 23 16:42:45 2012
@@ -25,6 +25,8 @@
 #include "capu/os/NumericLimits.h"
 #include "common/EtchNativeArray.h"
 
+class EtchRuntime;
+
 class EtchValidatorDouble : public EtchTypeValidator {
 public:
 
@@ -59,10 +61,9 @@ protected:
   EtchValidatorDouble(capu::uint32_t ndim);
 
 private:
-  static capu::SmartPointer<EtchValidator>* Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 
 };
 
-
 #endif /* __ETCHVALIDATORDOUBLE_H__ */
-

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorFloat.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorFloat.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorFloat.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorFloat.h Thu Aug 23 16:42:45 2012
@@ -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 @@ protected:
   EtchValidatorFloat(capu::uint32_t ndim);
 
 private:
-  static capu::SmartPointer<EtchValidator>* Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 
 };
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorInt.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorInt.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorInt.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorInt.h Thu Aug 23 16:42:45 2012
@@ -28,6 +28,8 @@
 #include "common/EtchNativeArray.h"
 #include "capu/os/NumericLimits.h"
 
+class EtchRuntime;
+
 class EtchValidatorInt : public EtchTypeValidator {
 public:
 
@@ -62,7 +64,8 @@ protected:
   EtchValidatorInt(capu::uint32_t ndim);
 
 private:
-  static capu::SmartPointer<EtchValidator>* Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 
 };
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorLong.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorLong.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorLong.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorLong.h Thu Aug 23 16:42:45 2012
@@ -27,6 +27,8 @@
 #include "common/EtchNativeArray.h"
 #include "capu/os/NumericLimits.h"
 
+class EtchRuntime;
+
 class EtchValidatorLong : public EtchTypeValidator {
 public:
 
@@ -62,7 +64,8 @@ protected:
   EtchValidatorLong(capu::uint32_t ndim);
 
 private:
-  static capu::SmartPointer<EtchValidator>* Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 
 };
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorNone.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorNone.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorNone.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorNone.h Thu Aug 23 16:42:45 2012
@@ -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 @@ protected:
   EtchValidatorNone();
 
 private:
-  static capu::SmartPointer<EtchValidator>& Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 
 };
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorObject.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorObject.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorObject.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorObject.h Thu Aug 23 16:42:45 2012
@@ -22,6 +22,8 @@
 
 #include "serialization/EtchTypeValidator.h"
 
+class EtchRuntime;
+
 class EtchValidatorObject : public EtchTypeValidator {
 public:
 
@@ -56,7 +58,8 @@ protected:
   EtchValidatorObject(capu::uint32_t ndim);
 
 private:
-  static capu::SmartPointer<EtchValidator>* Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 
 };
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorRuntimeException.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorRuntimeException.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorRuntimeException.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorRuntimeException.h Thu Aug 23 16:42:45 2012
@@ -21,6 +21,8 @@
 #include "serialization/EtchValidator.h"
 #include "common/EtchRuntimeException.h"
 
+class EtchRuntime;
+
 class EtchValidatorRuntimeException : public EtchValidator {
 public:
 
@@ -55,7 +57,8 @@ protected:
   EtchValidatorRuntimeException();
 
 private:
-  static capu::SmartPointer<EtchValidator>& Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 };
 
 #endif

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorShort.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorShort.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorShort.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorShort.h Thu Aug 23 16:42:45 2012
@@ -28,6 +28,8 @@
 #include "common/EtchNativeArray.h"
 #include "capu/os/NumericLimits.h"
 
+class EtchRuntime;
+
 class EtchValidatorShort : public EtchTypeValidator {
 public:
 
@@ -63,8 +65,8 @@ protected:
   EtchValidatorShort(capu::uint32_t ndim);
 
 private:
-
-  static capu::SmartPointer<EtchValidator>* Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 
 };
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorString.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorString.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorString.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorString.h Thu Aug 23 16:42:45 2012
@@ -23,6 +23,8 @@
 #include "common/EtchString.h"
 #include "common/EtchNativeArray.h"
 
+class EtchRuntime;
+
 class EtchValidatorString : public EtchTypeValidator {
 public:
 
@@ -57,7 +59,8 @@ protected:
   EtchValidatorString(capu::uint32_t ndim);
 
 private:
-  static capu::SmartPointer<EtchValidator>* Validators();
+  EtchRuntime* mRuntime;
+  static capu::SmartPointer<EtchValidator>* Validators(EtchRuntime* runtime);
 
 };
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorStructValue.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorStructValue.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorStructValue.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/serialization/EtchValidatorStructValue.h Thu Aug 23 16:42:45 2012
@@ -24,6 +24,7 @@
 #include "serialization/EtchType.h"
 #include "serialization/EtchStructValue.h"
 
+class EtchRuntime;
 
 class EtchValidatorStructValue : public EtchTypeValidator {
 public:
@@ -62,7 +63,7 @@ protected:
   EtchValidatorStructValue(EtchType* type, capu::uint32_t ndim);
 
 private:
-
+  EtchRuntime* mRuntime;
   EtchType* mType;
 
 };

Modified: incubator/etch/trunk/binding-cpp/runtime/include/support/EtchDefaultServerFactory.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/support/EtchDefaultServerFactory.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/support/EtchDefaultServerFactory.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/support/EtchDefaultServerFactory.h Thu Aug 23 16:42:45 2012
@@ -1,4 +1,3 @@
-
 /* $Id$
  *
  * Licensed to the Apache Software Foundation (ASF) under one

Modified: incubator/etch/trunk/binding-cpp/runtime/include/support/EtchRemoteBase.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/support/EtchRemoteBase.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/support/EtchRemoteBase.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/support/EtchRemoteBase.h Thu Aug 23 16:42:45 2012
@@ -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 @@ public:
   status_t stopAndWaitDown(capu::int32_t maxDelay);
 
 private:
+  EtchRuntime* mRuntime;
   EtchDeliveryService * mSvc;
   EtchValueFactory* mVf;
 };

Modified: incubator/etch/trunk/binding-cpp/runtime/include/support/EtchRuntime.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/support/EtchRuntime.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/support/EtchRuntime.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/support/EtchRuntime.h Thu Aug 23 16:42:45 2012
@@ -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 @@ public:
    */
   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 @@ private:
    * Fire onRuntimeChanged callback
    */
   status_t fireOnRuntimeChanged();
+
 };
 #endif /* ETCHRUNTIME_H */

Modified: incubator/etch/trunk/binding-cpp/runtime/include/support/EtchStubBase.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/support/EtchStubBase.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/support/EtchStubBase.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/support/EtchStubBase.h Thu Aug 23 16:42:45 2012
@@ -88,6 +88,8 @@ template<typename T>
 class EtchStubPoolRunnable : public EtchPoolRunnable {
 public:
 
+  virtual ~EtchStubPoolRunnable() {}
+
   /**
    * Constructs the StubPoolRunnable.
    * @param stub the stub of this service

Modified: incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchConnection.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchConnection.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchConnection.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchConnection.h Thu Aug 23 16:42:45 2012
@@ -40,6 +40,11 @@ public:
    */
   EtchConnection();
 
+  /**
+   * Destructor
+   */
+  virtual ~EtchConnection() {}
+
   /** Source query to get the local address. */
   static const EtchString LOCAL_ADDRESS;
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchDefaultDeliveryService.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchDefaultDeliveryService.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchDefaultDeliveryService.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchDefaultDeliveryService.h Thu Aug 23 16:42:45 2012
@@ -31,6 +31,8 @@
 #include "util/EtchURL.h"
 #include "util/EtchResources.h"
 
+class EtchRuntime;
+
 /**
  * Default implementation of DeliveryService.
  */
@@ -128,6 +130,7 @@ public:
   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);

Modified: incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchMessagizer.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchMessagizer.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchMessagizer.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchMessagizer.h Thu Aug 23 16:42:45 2012
@@ -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 @@ public:
   status_t sessionPacket(capu::SmartPointer<EtchWho> sender, capu::SmartPointer<EtchFlexBuffer> buf);
 
 private:
+  EtchRuntime* mRuntime;
   static capu::Mutex mutex;
   EtchTransportPacket* mTransport;
   EtchTaggedDataInput* mTdi;

Modified: incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchPacketizer.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchPacketizer.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchPacketizer.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchPacketizer.h Thu Aug 23 16:42:45 2012
@@ -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 @@ public:
   status_t sessionNotify(capu::SmartPointer<EtchObject> event);
 
 private:
+  EtchRuntime* mRuntime;
 
   EtchTransportData* mTransport;
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchPlainMailboxManager.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchPlainMailboxManager.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchPlainMailboxManager.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchPlainMailboxManager.h Thu Aug 23 16:42:45 2012
@@ -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 @@ public:
 
 
 private:
+  EtchRuntime* mRuntime;
   EtchSessionMessage* mSession;
   EtchTransportMessage* mTransport;
   capu::bool_t mUp;

Modified: incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchTcpConnection.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchTcpConnection.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchTcpConnection.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchTcpConnection.h Thu Aug 23 16:42:45 2012
@@ -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;
 

Modified: incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchTcpListener.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchTcpListener.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchTcpListener.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/transport/EtchTcpListener.h Thu Aug 23 16:42:45 2012
@@ -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 @@ protected:
   virtual status_t readSocket();
 
 private:
+  EtchRuntime* mRuntime;
   EtchServerSocket* mSocket;
   capu::uint16_t mPort;
   capu::uint8_t mBackLog;

Copied: incubator/etch/trunk/binding-cpp/runtime/include/util/EtchLogger.h (from r1376511, incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/os/arch/File.inc)
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/include/util/EtchLogger.h?p2=incubator/etch/trunk/binding-cpp/runtime/include/util/EtchLogger.h&p1=incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/os/arch/File.inc&r1=1376511&r2=1376584&rev=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/os/arch/File.inc (original)
+++ incubator/etch/trunk/binding-cpp/runtime/include/util/EtchLogger.h Thu Aug 23 16:42:45 2012
@@ -16,12 +16,15 @@
  * limitations under the License.
  */
 
-#ifdef OS_LINUX
-    #include "Linux/File.inc"
-#elif OS_WINDOWS
-    #include "Windows/File.inc"
-#elif defined(OS_INTEGRITY)
-    #include "Linux/Memory.inc"
-#elif defined(OS_QNX)
-    #include "Linux/Memory.inc"
-#endif
+#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 */

Modified: incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/CMakeLists.txt?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/CMakeLists.txt (original)
+++ incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/CMakeLists.txt Thu Aug 23 16:42:45 2012
@@ -42,9 +42,6 @@ ADD_FILE(os/UdpSocket SOURCE_GROUP arch_
 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 @@ REQUIRED_PACKAGE(Res)
 
 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")

Modified: incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/List.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/List.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/List.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/container/List.h Thu Aug 23 16:42:45 2012
@@ -192,7 +192,7 @@ namespace capu {
      * 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 @@ namespace capu {
   }
 
   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);
   }
 

Modified: incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/os/arch/File.inc
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/os/arch/File.inc?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/os/arch/File.inc (original)
+++ incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/os/arch/File.inc Thu Aug 23 16:42:45 2012
@@ -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

Modified: incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/util/Logger.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/util/Logger.h?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/util/Logger.h (original)
+++ incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/include/capu/util/Logger.h Thu Aug 23 16:42:45 2012
@@ -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 {
 

Modified: incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/src/util/Logger.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/src/util/Logger.cpp?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/src/util/Logger.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/src/util/Logger.cpp Thu Aug 23 16:42:45 2012
@@ -42,13 +42,13 @@ namespace capu {
       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 @@ namespace capu {
     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 @@ namespace capu {
     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++) {

Modified: incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/test/os/FileTest.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/test/os/FileTest.cpp?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/test/os/FileTest.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/lib/capu/modules/capu/test/os/FileTest.cpp Thu Aug 23 16:42:45 2012
@@ -25,9 +25,9 @@ TEST(File, ConstructorTest) {
   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 @@ TEST(File, IsOpenTest) {
   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 @@ TEST(File, WriteTest) {
   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 @@ TEST(File, ReadTest) {
   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());
 

Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchObject.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchObject.cpp?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchObject.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/common/EtchObject.cpp Thu Aug 23 16:42:45 2012
@@ -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;
+}
+

Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchAuthenticationExceptionSerializer.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchAuthenticationExceptionSerializer.cpp?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchAuthenticationExceptionSerializer.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchAuthenticationExceptionSerializer.cpp Thu Aug 23 16:42:45 2012
@@ -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 @@ const EtchString& EtchAuthenticationExce
 
 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 @@ status_t EtchAuthenticationExceptionSeri
   }
 
   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 @@ status_t EtchAuthenticationExceptionSeri
   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 @@ status_t EtchAuthenticationExceptionSeri
   if (result != ETCH_OK)
     return result;
   type->lock();
+  CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchAuthenticationExceptionSerializer has been initialized");
   return ETCH_OK;
 }

Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataInput.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataInput.cpp?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataInput.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataInput.cpp Thu Aug 23 16:42:45 2012
@@ -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 @@ status_t EtchBinaryTaggedDataInput::read
   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 @@ status_t EtchBinaryTaggedDataInput::read
   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 @@ status_t EtchBinaryTaggedDataInput::read
   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 @@ status_t EtchBinaryTaggedDataInput::read
 
   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 @@ status_t EtchBinaryTaggedDataInput::read
 
   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 @@ status_t EtchBinaryTaggedDataInput::read
   while (true) {
     capu::SmartPointer<EtchObject> value;
     readValue(validator, true, value);
-    if(value == NONE()) {
+    if (value == NONE()) {
       break;
     }
     av->add(value);
@@ -162,16 +177,21 @@ status_t EtchBinaryTaggedDataInput::star
   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::endM
 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 @@ status_t EtchBinaryTaggedDataInput::star
 
   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::read
 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::vali
   }
 }
 
-
-
 status_t EtchBinaryTaggedDataInput::readValue(capu::SmartPointer<EtchValidator> v, capu::SmartPointer<EtchObject>& result) {
   return readValue(v, false, result);
 }
@@ -396,10 +423,12 @@ status_t EtchBinaryTaggedDataInput::read
 
     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 @@ status_t EtchBinaryTaggedDataInput::read
       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 @@ status_t EtchBinaryTaggedDataInput::read
       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 @@ status_t EtchBinaryTaggedDataInput::read
       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 @@ status_t EtchBinaryTaggedDataInput::read
       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 @@ status_t EtchBinaryTaggedDataInput::read
       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 @@ status_t EtchBinaryTaggedDataInput::read
       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 @@ status_t EtchBinaryTaggedDataInput::read
       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 EtchBinaryTaggedDataInput::read
     {
       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 @@ status_t EtchBinaryTaggedDataInput::read
 
       ret = validateValue(v, narray, result);
 
+      CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Byte Array has been received");
+
       return ret;
     }
 
@@ -534,7 +573,7 @@ status_t EtchBinaryTaggedDataInput::read
 
       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 @@ status_t EtchBinaryTaggedDataInput::read
         return ETCH_ERROR;
       } else {
         result = array;
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "Array hhas been received");
         return ETCH_OK;
       }
     }
@@ -555,6 +595,7 @@ status_t EtchBinaryTaggedDataInput::read
         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 @@ status_t EtchBinaryTaggedDataInput::read
     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 @@ status_t EtchBinaryTaggedDataInput::read
         return ETCH_ERROR;
       } else {
         result = str;
+        CAPU_LOG_TRACE(mRuntime->getLogger(), TAG, "String value has been received");
         return ETCH_OK;
       }
     }
@@ -595,6 +637,7 @@ status_t EtchBinaryTaggedDataInput::read
       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 @@ status_t EtchBinaryTaggedDataInput::read
         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;
         }
       }

Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataOutput.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataOutput.cpp?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataOutput.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchBinaryTaggedDataOutput.cpp Thu Aug 23 16:42:45 2012
@@ -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 @@ const EtchString& EtchBinaryTaggedDataOu
 
 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::EtchBinaryTa
 }
 
 EtchBinaryTaggedDataOutput::~EtchBinaryTaggedDataOutput() {
-
 }
 
 status_t EtchBinaryTaggedDataOutput::writeMessage(capu::SmartPointer<EtchMessage> msg, capu::SmartPointer<EtchFlexBuffer> buf) {
@@ -50,16 +55,19 @@ status_t EtchBinaryTaggedDataOutput::wri
 
   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 @@ status_t EtchBinaryTaggedDataOutput::wri
 
   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 @@ status_t EtchBinaryTaggedDataOutput::wri
 
   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 @@ status_t EtchBinaryTaggedDataOutput::wri
   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::end
 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 @@ status_t EtchBinaryTaggedDataOutput::sta
   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 @@ status_t EtchBinaryTaggedDataOutput::wri
       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 @@ status_t EtchBinaryTaggedDataOutput::wri
     {
       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;

Modified: incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchDateSerializer.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchDateSerializer.cpp?rev=1376584&r1=1376583&r2=1376584&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchDateSerializer.cpp (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/main/serialization/EtchDateSerializer.cpp Thu Aug 23 16:42:45 2012
@@ -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 @@ const EtchString& EtchDateSerializer::FI
 
 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 @@ status_t EtchDateSerializer::importValue
   }
 
   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 @@ status_t EtchDateSerializer::exportValue
   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 @@ status_t EtchDateSerializer::Init(EtchTy
   if (result != ETCH_OK)
     return result;
   type->lock();
+  CAPU_LOG_TRACE(runtime->getLogger(), TAG, "EtchDateSerializer has been initialized");
   return ETCH_OK;
 }