geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject [12/51] [partial] geode git commit: Software Grant Agreement (SGA) from Pivotal for Apache Geode
Date Fri, 13 Jan 2017 22:45:56 GMT
http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/src/CacheFactory.cpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/CacheFactory.cpp b/src/clicache/src/CacheFactory.cpp
new file mode 100644
index 0000000..7ca4b67
--- /dev/null
+++ b/src/clicache/src/CacheFactory.cpp
@@ -0,0 +1,404 @@
+/*=========================================================================
+ * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+//#include "gf_includes.hpp"
+
+#include "ExceptionTypes.hpp"
+
+#include "CacheFactory.hpp"
+#include "Cache.hpp"
+#include "DistributedSystem.hpp"
+#include "SystemProperties.hpp"
+#include "impl/SafeConvert.hpp"
+#include "impl/PdxTypeRegistry.hpp"
+//#pragma warning(disable:4091)
+//#include <msclr/lock.h>
+//#pragma warning(disable:4091)
+
+using namespace System;
+
+namespace GemStone
+{
+  namespace GemFire
+  {
+    namespace Cache
+    {
+      namespace Generic
+      {
+      CacheFactory^ CacheFactory::CreateCacheFactory()
+      {
+        return CacheFactory::CreateCacheFactory(Properties<String^, String^>::Create<String^, String^>());
+      }
+
+      CacheFactory^ CacheFactory::CreateCacheFactory(Properties<String^, String^>^ dsProps)
+      {
+        _GF_MG_EXCEPTION_TRY2
+
+           gemfire::PropertiesPtr nativepropsptr(
+            GetNativePtr<gemfire::Properties>(dsProps));
+
+          gemfire::CacheFactoryPtr& nativeptr( gemfire::CacheFactory::createCacheFactory( nativepropsptr) );         
+          if (nativeptr.ptr() != nullptr)
+            return gcnew CacheFactory( nativeptr.ptr(), dsProps );
+            
+          return nullptr;
+
+        _GF_MG_EXCEPTION_CATCH_ALL2        
+      }
+
+      Cache^ CacheFactory::Create()
+      {
+				bool pdxIgnoreUnreadFields = false;
+        bool pdxReadSerialized = false;
+				bool appDomainEnable = false; 
+        _GF_MG_EXCEPTION_TRY2
+          //msclr::lock lockInstance(m_singletonSync);
+          DistributedSystem::acquireDisconnectLock();
+    
+          if(!m_connected)
+          {
+             gemfire::PropertiesPtr nativepropsptr(
+               GetNativePtr<gemfire::Properties>(m_dsProps));
+            DistributedSystem::AppDomainInstanceInitialization(nativepropsptr);                  
+          }
+
+          gemfire::CachePtr& nativeptr( NativePtr->create( ) );
+					pdxIgnoreUnreadFields = nativeptr->getPdxIgnoreUnreadFields();
+          pdxReadSerialized = nativeptr->getPdxReadSerialized();
+
+          appDomainEnable = DistributedSystem::SystemProperties->AppDomainEnabled;
+          Log::SetLogLevel(static_cast<LogLevel>(gemfire::Log::logLevel( )));
+					//TODO::split
+          SafeConvertClassGeneric::SetAppDomainEnabled(appDomainEnable);
+
+            Serializable::RegisterTypeGeneric(
+              gemfire::GemfireTypeIds::PdxType,
+              gcnew TypeFactoryMethodGeneric(GemStone::GemFire::Cache::Generic::Internal::PdxType::CreateDeserializable),
+              nullptr);
+
+           if(!m_connected)
+           {
+             //it registers types in unmanage layer, so should be once only 
+             DistributedSystem::ManagedPostConnect();
+             DistributedSystem::AppDomainInstancePostInitialization();
+             DistributedSystem::connectInstance();
+           }
+          
+           m_connected = true;
+           
+           return Cache::Create( nativeptr.ptr( ) );
+        _GF_MG_EXCEPTION_CATCH_ALL2
+          finally {
+            DistributedSystem::registerCliCallback();
+						Serializable::RegisterPDXManagedCacheableKey(appDomainEnable);
+					GemStone::GemFire::Cache::Generic::Internal::PdxTypeRegistry::PdxIgnoreUnreadFields = pdxIgnoreUnreadFields; 
+          GemStone::GemFire::Cache::Generic::Internal::PdxTypeRegistry::PdxReadSerialized = pdxReadSerialized; 
+          DistributedSystem::releaseDisconnectLock();
+        }
+      }
+
+      Cache^ CacheFactory::GetInstance( DistributedSystem^ system )
+      {
+        _GF_MG_EXCEPTION_TRY2
+
+          gemfire::DistributedSystemPtr p_system(
+            GetNativePtr<gemfire::DistributedSystem>( system ) );
+          gemfire::CachePtr& nativeptr(
+            gemfire::CacheFactory::getInstance( p_system ) );
+
+          return Cache::Create( nativeptr.ptr( ) );
+
+        _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+
+      Cache^ CacheFactory::GetInstanceCloseOk( DistributedSystem^ system )
+      {
+        _GF_MG_EXCEPTION_TRY2
+
+          gemfire::DistributedSystemPtr p_system(
+            GetNativePtr<gemfire::DistributedSystem>( system ) );
+          gemfire::CachePtr& nativeptr(
+            gemfire::CacheFactory::getInstanceCloseOk( p_system ) );
+
+          return Cache::Create( nativeptr.ptr( ) );
+
+        _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+
+      Cache^ CacheFactory::GetAnyInstance( )
+      {
+        _GF_MG_EXCEPTION_TRY2
+
+          gemfire::CachePtr& nativeptr(
+            gemfire::CacheFactory::getAnyInstance( ) );
+          return Cache::Create( nativeptr.ptr( ) );
+
+        _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+
+      String^ CacheFactory::Version::get( )
+      {
+        return ManagedString::Get( gemfire::CacheFactory::getVersion( ) );
+      }
+
+      String^ CacheFactory::ProductDescription::get( )
+      {
+        return ManagedString::Get(
+          gemfire::CacheFactory::getProductDescription( ) );
+      }
+
+
+      CacheFactory^ CacheFactory::SetFreeConnectionTimeout( Int32 connectionTimeout )
+		  {
+			  _GF_MG_EXCEPTION_TRY2
+
+			  NativePtr->setFreeConnectionTimeout( connectionTimeout );
+
+        return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+		  }
+
+		  CacheFactory^ CacheFactory::SetLoadConditioningInterval( Int32 loadConditioningInterval )
+		  {
+			  _GF_MG_EXCEPTION_TRY2
+
+			  NativePtr->setLoadConditioningInterval( loadConditioningInterval );
+        return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+		  }
+
+		  CacheFactory^ CacheFactory::SetSocketBufferSize( Int32 bufferSize )
+      {
+			  _GF_MG_EXCEPTION_TRY2
+
+          NativePtr->setSocketBufferSize( bufferSize );
+          return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+		  }
+
+		  CacheFactory^ CacheFactory::SetReadTimeout( Int32 timeout )
+      {
+			  _GF_MG_EXCEPTION_TRY2
+
+          NativePtr->setReadTimeout( timeout );
+          return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+		  }
+
+		  CacheFactory^ CacheFactory::SetMinConnections( Int32 minConnections )
+      {
+			  _GF_MG_EXCEPTION_TRY2
+
+          NativePtr->setMinConnections( minConnections );
+          return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+		  }
+
+		  CacheFactory^ CacheFactory::SetMaxConnections( Int32 maxConnections )
+      {
+			  _GF_MG_EXCEPTION_TRY2
+
+          NativePtr->setMaxConnections( maxConnections );
+          return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+		  }
+
+		  CacheFactory^ CacheFactory::SetIdleTimeout( Int32 idleTimeout )
+      {
+			  _GF_MG_EXCEPTION_TRY2
+
+          NativePtr->setIdleTimeout( idleTimeout );
+          return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+		  }
+
+		  CacheFactory^ CacheFactory::SetRetryAttempts( Int32 retryAttempts )
+      {
+			  _GF_MG_EXCEPTION_TRY2
+
+			  NativePtr->setRetryAttempts( retryAttempts );
+        return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+		  }
+
+		  CacheFactory^ CacheFactory::SetPingInterval( Int32 pingInterval )
+      {
+			  _GF_MG_EXCEPTION_TRY2
+
+          NativePtr->setPingInterval( pingInterval );
+          return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+		  }
+
+      CacheFactory^ CacheFactory::SetUpdateLocatorListInterval( Int32 updateLocatorListInterval )
+      {
+			  _GF_MG_EXCEPTION_TRY2
+
+          NativePtr->setUpdateLocatorListInterval( updateLocatorListInterval );
+          return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+		  }
+
+      CacheFactory^ CacheFactory::SetStatisticInterval( Int32 statisticInterval )
+      {
+			  _GF_MG_EXCEPTION_TRY2
+
+          NativePtr->setStatisticInterval( statisticInterval );
+          return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+		  }
+
+      CacheFactory^ CacheFactory::SetServerGroup( String^ group )
+      {
+			  _GF_MG_EXCEPTION_TRY2
+
+        ManagedString mg_servergroup( group );
+        NativePtr->setServerGroup( mg_servergroup.CharPtr );
+        return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+		  }
+
+		  CacheFactory^ CacheFactory::AddLocator( String^ host, Int32 port )
+      {
+			  _GF_MG_EXCEPTION_TRY2
+
+        ManagedString mg_host( host );
+        NativePtr->addLocator( mg_host.CharPtr, port );
+        return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+		  }
+
+      CacheFactory^ CacheFactory::AddServer( String^ host, Int32 port )
+      {
+			  _GF_MG_EXCEPTION_TRY2
+
+			  ManagedString mg_host( host );
+        NativePtr->addServer( mg_host.CharPtr, port );
+        return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+		  }
+
+		  CacheFactory^ CacheFactory::SetSubscriptionEnabled( Boolean enabled )
+      {
+			  _GF_MG_EXCEPTION_TRY2
+
+			  NativePtr->setSubscriptionEnabled( enabled );
+        return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+		  }
+
+      CacheFactory^ CacheFactory::SetPRSingleHopEnabled( Boolean enabled )
+      {
+        _GF_MG_EXCEPTION_TRY2
+
+          NativePtr->setPRSingleHopEnabled(enabled);
+          return this;
+
+         _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+
+		  CacheFactory^ CacheFactory::SetSubscriptionRedundancy( Int32 redundancy )
+      {
+			  _GF_MG_EXCEPTION_TRY2
+
+          NativePtr->setSubscriptionRedundancy( redundancy );
+          return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+		  }
+
+		  CacheFactory^ CacheFactory::SetSubscriptionMessageTrackingTimeout( Int32 messageTrackingTimeout )
+      {
+			  _GF_MG_EXCEPTION_TRY2
+
+          NativePtr->setSubscriptionMessageTrackingTimeout( messageTrackingTimeout );
+          return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+		  }
+
+		  CacheFactory^ CacheFactory::SetSubscriptionAckInterval( Int32 ackInterval )
+      {
+			  _GF_MG_EXCEPTION_TRY2
+
+          NativePtr->setSubscriptionAckInterval( ackInterval );
+          return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+		  }
+
+      CacheFactory^ CacheFactory::SetThreadLocalConnections( bool enabled )
+      {
+        _GF_MG_EXCEPTION_TRY2
+
+        NativePtr->setThreadLocalConnections( enabled );
+
+        _GF_MG_EXCEPTION_CATCH_ALL2
+
+        return this;
+      }
+
+      CacheFactory^ CacheFactory::SetMultiuserAuthentication( bool multiuserAuthentication )
+      {
+			  _GF_MG_EXCEPTION_TRY2
+
+          NativePtr->setMultiuserAuthentication( multiuserAuthentication );
+          return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+	   }
+
+			CacheFactory^ CacheFactory::SetPdxIgnoreUnreadFields(bool ignore)
+			{
+				_GF_MG_EXCEPTION_TRY2
+
+          NativePtr->setPdxIgnoreUnreadFields( ignore );
+          return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+			}
+
+      CacheFactory^ CacheFactory::SetPdxReadSerialized(bool pdxReadSerialized)
+      {
+        	_GF_MG_EXCEPTION_TRY2
+
+          NativePtr->setPdxReadSerialized( pdxReadSerialized );
+          return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+
+      CacheFactory^ CacheFactory::Set(String^ name, String^ value)
+      {
+        _GF_MG_EXCEPTION_TRY2
+          ManagedString mg_name( name );
+          ManagedString mg_value( value );
+          NativePtr->set( mg_name.CharPtr, mg_value.CharPtr );
+          return this;
+
+			  _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+      } // end namespace Generic
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/src/CacheFactory.hpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/CacheFactory.hpp b/src/clicache/src/CacheFactory.hpp
new file mode 100644
index 0000000..080fe78
--- /dev/null
+++ b/src/clicache/src/CacheFactory.hpp
@@ -0,0 +1,603 @@
+/*=========================================================================
+ * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+#pragma once
+
+#include "gf_defs.hpp"
+#include "impl/NativeWrapper.hpp"
+#include <gfcpp/CacheFactory.hpp>
+#include "Properties.hpp"
+
+//using namespace System;
+using namespace System::Collections::Generic;
+
+namespace GemStone
+{
+  namespace GemFire
+  {
+    namespace Cache
+    {
+      namespace Generic
+      {
+      ref class Cache;
+      ref class CacheAttributes;
+      ref class DistributedSystem;
+
+      /// <summary>
+      /// A factory class that must be used to obtain instance of <see cref="Cache" />.
+      /// </summary>
+      /// <remarks>
+      /// To create a new cache instance, use <see cref="CacheFactory.CreateCacheFactory" />.
+      /// <para>
+      /// To get an existing unclosed cache instance, use <see cref="CacheFactory.GetInstance" />.
+      /// </para>
+      /// </remarks>
+      public ref class CacheFactory :public Internal::SBWrap<gemfire::CacheFactory>
+      {
+      public:
+
+        /// <summary>
+        /// A factory class that must be used to obtain instance of <see cref="Cache" />.
+        /// This should be called once. Using this one can set default values of <see cref="Pool" />.
+        /// </summary>
+        /// <param name="dsProps">Properties which are applicable at client level.</param>
+			//	static CacheFactory^ CreateCacheFactory(Dictionary<Object^, Object^>^ dsProps);
+        static CacheFactory^ CreateCacheFactory(Properties<String^, String^>^ dsProps);
+
+        /// <summary>
+        /// A factory class that must be used to obtain instance of <see cref="Cache" />.
+        /// This should be called once. Using this one can set default values of <see cref="Pool" />.
+        /// </summary>       
+        static CacheFactory^ CreateCacheFactory();
+
+        /// <summary>
+        /// To create the instance of <see cref="Cache" />.
+        /// </summary>
+        Cache^ Create();
+
+        /// <summary>
+        /// Gets the instance of <see cref="Cache" /> produced by an
+        /// earlier call to <see cref="CacheFactory.Create" />.
+        /// </summary>
+        /// <param name="system">
+        /// the <see cref="DistributedSystem" /> the cache was created with.
+        /// </param>
+        /// <returns>the <see cref="Cache" /> associated with the specified system.</returns>
+        /// <exception cref="IllegalArgumentException">
+        /// if the distributed system argument is null
+        /// </exception>
+        /// <exception cref="CacheClosedException">
+        /// if a cache has not been created or the created one is closed
+        /// ( <see cref="Cache.IsClosed" /> )
+        /// </exception>
+        /// <exception cref="EntryNotFoundException">
+        /// if a cache with specified system not found
+        /// </exception>
+        static Cache^ GetInstance( DistributedSystem^ system );
+
+        /// <summary>
+        /// Gets the instance of <see cref="Cache" /> produced by an
+        /// earlier call to <see cref="CacheFactory.Create" />, even if it has been closed.
+        /// </summary>
+        /// <param name="system">
+        /// the <see cref="DistributedSystem" /> the cache was created with.
+        /// </param>
+        /// <returns>
+        /// the <c>Cache</c> associated with the specified system.
+        /// </returns>
+        /// <exception cref="IllegalArgumentException">
+        /// if the distributed system argument is null
+        /// </exception>
+        /// <exception cref="CacheClosedException">
+        /// if a cache has not been created.
+        /// </exception>
+        /// <exception cref="EntryNotFoundException">
+        /// if a cache with specified system not found
+        /// </exception>
+        static Cache^ GetInstanceCloseOk( DistributedSystem^ system );
+
+        /// <summary>
+        /// Gets an arbitrary open instance of <see cref="Cache" /> produced by an
+        /// earlier call to <see cref="CacheFactory.Create" />.
+        /// </summary>
+        /// <exception cref="CacheClosedException">
+        /// if a cache has not been created or the only created one is
+        /// closed ( <see cref="Cache.IsClosed" /> )
+        /// </exception>
+        /// <exception cref="EntryNotFoundException">
+        /// if a cache with specified system not found
+        /// </exception>
+        static Cache^ GetAnyInstance( );
+
+        /// <summary>
+        /// Set allocators for non default Microsoft CRT versions.
+        /// </summary>
+        static void SetNewAndDelete()
+        {
+          gemfire::setNewAndDelete( & operator new, & operator delete );
+        }
+
+        /// <summary>
+        /// Returns the version of the cache implementation.
+        /// For the 1.0 release of GemFire, the string returned is <c>1.0</c>.
+        /// </summary>
+        /// <returns>the version of the cache implementation as a <c>String</c></returns>
+        static property String^ Version
+        {
+          static String^ get( );
+        }
+
+        /// <summary>
+        /// Returns the product description string including product name and version.
+        /// </summary>
+        static property String^ ProductDescription
+        {
+          static String^ get( );
+        }
+
+      /// <summary>
+		  /// Sets the free connection timeout for this pool.
+		  /// </summary>
+		  /// <remarks>
+		  /// If the pool has a max connections setting, operations will block
+		  /// if all of the connections are in use. The free connection timeout
+		  /// specifies how long those operations will block waiting for
+		  /// a free connection before receiving an AllConnectionsInUseException.
+		  /// If max connections is not set this setting has no effect.
+      /// </remarks>
+		  /// <param>
+		  /// connectionTimeout the connection timeout in milliseconds
+		  /// </param>
+		  /// <exception>
+		  /// IllegalArgumentException if connectionTimeout 
+		  /// is less than or equal to 0.
+		  /// </exception>
+		  CacheFactory^ SetFreeConnectionTimeout( Int32 connectionTimeout );
+
+		  /// <summary>
+		  /// Sets the load conditioning interval for this pool.
+		  /// </summary>
+		  /// <remarks>
+		  /// This interval controls how frequently the pool will check to see if
+		  /// a connection to a given server should be moved to a different
+		  /// server to improve the load balance.
+		  /// </remarks>
+		  /// <param>
+		  /// loadConditioningInterval the connection lifetime in milliseconds
+		  /// A value of -1 disables load conditioning.
+		  /// </param>
+		  /// <exception>
+		  /// throws IllegalArgumentException if connectionLifetime
+		  /// is less than -1.
+		  /// </exception>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+      CacheFactory^ SetLoadConditioningInterval( Int32 loadConditioningInterval );
+
+		  /// <summary>
+		  /// Sets the socket buffer size for each connection made in this pool.
+		  /// </summary>
+		  /// <remarks>
+		  /// Large messages can be received and sent faster when this buffer is larger.
+		  /// Larger buffers also optimize the rate at which servers can send events
+		  /// for client subscriptions.
+		  /// </remarks>
+		  /// <param>
+		  /// bufferSize the size of the socket buffers used for reading and
+		  /// writing on each connection in this pool.
+		  /// </param>
+		  /// <exception>
+		  /// throws IllegalArgumentException if bufferSize
+		  /// is less than or equal to 0.
+		  /// </exception>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+		  CacheFactory^ SetSocketBufferSize( Int32 bufferSize );
+
+		  /// <summary>
+		  /// Sets the number of milliseconds to wait for a response from a server before
+		  /// timing out the operation and trying another server (if any are available).
+		  /// </summary>
+		  /// <param>
+		  /// timeout number of milliseconds to wait for a response from a server
+		  /// </param>
+		  /// <exception>
+		  /// throws IllegalArgumentException if timeout
+		  /// is less than or equal to 0.
+		  /// </exception>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+		  CacheFactory^ SetReadTimeout( Int32 timeout );
+
+		  /// <summary>
+		  /// Set the minimum number of connections to keep available at all times.
+		  /// </summary>
+		  /// <remarks>
+		  /// When the pool is created, it will create this many connections.
+		  /// If 0 then connections will not be made until an actual operation
+		  /// is done that requires client-to-server communication.
+		  /// </remarks>
+		  /// <param>
+		  /// minConnections the initial number of connections this pool will create.
+		  /// </param>
+		  /// <exception>
+		  /// throws IllegalArgumentException if minConnections is less than 0.
+		  /// </exception>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+		  CacheFactory^ SetMinConnections( Int32 minConnections );
+
+		  /// <summary>
+		  /// Set the max number of client to server connections that the pool will create.
+		  /// </summary>
+		  /// <remarks>
+		  /// If all of the connections are in use, an operation requiring a client to
+		  /// server connection will block until a connection is available.
+		  /// see setFreeConnectionTimeout(int)
+		  /// </remarks>
+		  /// <param>
+		  /// maxConnections the maximum number of connections in the pool.
+		  /// -1 indicates that there is no maximum number of connections.
+		  /// </param>
+		  /// <exception>
+		  /// throws IllegalArgumentException if maxConnections is less than minConnections.
+		  /// </exception>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+		  CacheFactory^ SetMaxConnections( Int32 maxConnections );
+
+		  /// <summary>
+		  /// Set the amount of time a connection can be idle before expiring the connection.
+		  /// </summary>
+		  /// <remarks>
+		  /// If the pool size is greater than the minimum specified, connections which have
+		  /// been idle for longer than the idleTimeout will be closed.
+		  /// </remarks>
+		  /// <param>
+		  /// idleTimeout The amount of time in milliseconds that an idle connection
+		  /// should live before expiring. -1 indicates that connections should never expire.
+		  /// </param>
+		  /// <exception>
+		  /// throws IllegalArgumentException if idleTimout is less than 0.
+		  /// </exception>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+		  CacheFactory^ SetIdleTimeout( Int32 idleTimeout );
+
+		  /// <summary>
+		  /// Set the number of times to retry a request after timeout/exception.
+		  /// </summary>
+		  /// <param>
+		  /// retryAttempts The number of times to retry a request
+		  /// after timeout/exception. -1 indicates that a request should be
+		  /// tried against every available server before failing.
+		  /// </param>
+		  /// <exception>
+		  /// throws IllegalArgumentException if idleTimout is less than 0.
+		  /// </exception>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+		  CacheFactory^ SetRetryAttempts( Int32 retryAttempts );
+
+		  /// <summary>
+		  /// Set how often to ping servers to verify that they are still alive.
+		  /// </summary>
+		  /// <remarks>
+		  /// Each server will be sent a ping every pingInterval if there has not
+		  /// been any other communication with the server.
+		  /// These pings are used by the server to monitor the health of
+		  /// the client. Make sure that the pingInterval is less than the
+		  /// maximum time between pings allowed by the bridge server.
+		  /// see in CacheServer: setMaximumTimeBetweenPings(int)
+		  /// </remarks>
+		  /// <param>
+		  /// pingInterval The amount of time in milliseconds between pings.
+		  /// </param>
+		  /// <exception>
+		  /// throws IllegalArgumentException if pingInterval is less than 0.
+		  /// </exception>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+		  CacheFactory^ SetPingInterval( Int32 pingInterval );
+
+      /// <summary>
+		  /// Set how often to update locator list from locator
+		  /// </summary>
+		  /// <param>
+		  /// updateLocatorListInterval The amount of time in milliseconds between
+      /// updating locator list. If its set to 0 then client will not update
+      /// the locator list.
+		  /// </param>
+		  /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+		  CacheFactory^ SetUpdateLocatorListInterval( Int32 updateLocatorListInterval );
+
+
+		  /// <summary>
+		  /// Set how often to send client statistics to the server.
+		  /// </summary>
+		  /// <remarks>
+		  /// Doing this allows gfmon to monitor clients.
+		  /// A value of -1 disables the sending of client statistics
+		  /// to the server.
+          /// </remarks>
+		  /// <param>
+		  /// statisticInterval The amount of time in milliseconds between
+		  /// sends of client statistics to the server.
+		  /// </param>
+		  /// <exception>
+		  /// throws IllegalArgumentException if statisticInterval
+		  /// is less than -1.
+		  /// </exception>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+      CacheFactory^ SetStatisticInterval( Int32 statisticInterval);
+
+		  /// <summary>
+		  /// Configures the group that all servers this pool connects to must belong to.
+		  /// </summary>
+		  /// <param>
+		  /// group the server group that this pool will connect to.
+		  /// If null or "" then all servers will be connected to.
+		  /// </param>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+      CacheFactory^ SetServerGroup( String^ group );
+
+		  /// <summary>
+		  /// Add a locator, given its host and port, to this factory.
+		  /// </summary>
+		  /// <remarks>
+		  /// The locator must be a server locator and will be used to discover other running
+		  /// bridge servers and locators.
+		  /// </remarks>
+		  /// <param>
+		  /// host the host name or ip address that the locator is listening on.
+		  /// </param>
+		  /// <param>
+		  /// port the port that the locator is listening on
+		  /// </param>
+		  /// <exception>
+		  /// throws IllegalArgumentException if host is an unknown host
+		  /// or if port is outside the valid range of [1..65535] inclusive.
+		  /// </exception>
+		  /// <exception>
+		  /// throws IllegalStateException if a locator has already been added to this factory.
+		  /// </exception>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+		  CacheFactory^ AddLocator( String^ host, Int32 port );
+
+		  /// <summary>
+		  /// Add a server, given its host and port, to this factory.
+		  /// </summary>
+		  /// <remarks>
+		  /// The server must be a bridge server and this client will
+		  /// directly connect to without consulting a server locator.
+		  /// </remarks>
+		  /// <param>
+		  /// host the host name or ip address that the server is listening on.
+		  /// </param>
+		  /// <param>
+		  /// port the port that the server is listening on
+		  /// </param>
+          /// <exception>
+		  /// throws IllegalArgumentException if host is an unknown host
+		  /// or if port is outside the valid range of [1..65535] inclusive.
+		  /// </exception>
+		  /// <exception>
+		  /// throws IllegalStateException if a server has already been added to this factory.
+		  /// </exception>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+      CacheFactory^ AddServer( String^ host, Int32 port );
+
+		  /// <summary>
+		  /// Enable subscriptions.
+		  /// </summary>
+		  /// <remarks>
+		  /// If set to true then the created pool will have server-to-client
+		  /// subscriptions enabled. If set to false then all Subscription*
+		  /// attributes are ignored at create time.
+		  /// </remarks>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+		  CacheFactory^ SetSubscriptionEnabled( Boolean enabled );
+
+      /// <summary>
+		  /// By default SetPRSingleHopEnabled is true.
+		  /// </summary>
+		  /// <remarks>
+		  /// The client is aware of location of partitions on servers hosting
+      /// Using this information, the client routes the client cache operations
+		  /// directly to the server which is hosting the required partition for the
+		  /// cache operation. 
+      /// If SetPRSingleHopEnabled is false the client can do an extra hop on servers
+      /// to go to the required partition for that cache operation.
+      /// The SetPRSingleHopEnabled avoids extra hops only for following cache operations :
+      /// put, get & destroy operations.
+		  /// </remarks>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+		  CacheFactory^ SetPRSingleHopEnabled( Boolean enabled );
+
+		  /// <summary>
+		  /// Sets the redundancy level for this pools server-to-client subscriptions.
+		  /// </summary>
+		  /// <remarks>
+		  /// If 0 then no redundant copies will be kept on the servers.
+		  /// Otherwise an effort will be made to maintain the requested number of
+		  /// copies of the server-to-client subscriptions. At most one copy per server will
+		  /// be made up to the requested level.
+		  /// </remarks>
+		  /// <param>
+		  /// redundancy the number of redundant servers for this client's subscriptions.
+		  /// </param>
+		  /// <exception>
+		  /// throws IllegalArgumentException if redundancyLevel is less than -1.
+		  /// </exception>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+		  CacheFactory^ SetSubscriptionRedundancy( Int32 redundancy );
+
+		  /// <summary>
+		  /// Sets the messageTrackingTimeout attribute which is the time-to-live period,
+		  /// in milliseconds, for subscription events the client has received from the server.
+		  /// </summary>
+		  /// <remarks>
+		  /// It's used to minimize duplicate events. Entries that have not been modified
+		  /// for this amount of time are expired from the list.
+		  /// </remarks>
+		  /// <param>
+		  /// messageTrackingTimeout number of milliseconds to set the timeout to.
+		  /// </param>
+		  /// <exception>
+		  /// throws IllegalArgumentException if messageTrackingTimeout is less than or equal to 0.
+		  /// </exception>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+		  CacheFactory^ SetSubscriptionMessageTrackingTimeout( Int32 messageTrackingTimeout );
+
+		  /// <summary>
+		  /// Sets the is the interval in milliseconds to wait before sending
+		  /// acknowledgements to the bridge server for events received from the server subscriptions.
+		  /// </summary>
+		  /// <param>
+		  /// ackInterval number of milliseconds to wait before sending event acknowledgements.
+		  /// </param>
+		  /// <exception>
+		  /// throws IllegalArgumentException if ackInterval is less than or equal to 0.
+		  /// </exception>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+		  CacheFactory^ SetSubscriptionAckInterval( Int32 ackInterval );
+
+      /// <summary>
+      /// Enable thread local connections.
+      /// </summary>
+      /// <remarks>
+      /// Sets the thread local connections policy for the default connection pool.
+      /// If true then any time a thread goes to use a connection
+      /// from this pool it will check a thread local cache and see if it already
+      /// has a connection in it. If so it will use it. If not it will get one from
+      /// this pool and cache it in the thread local. This gets rid of thread contention
+      /// for the connections but increases the number of connections the servers see.
+      /// If false then connections are returned to the pool as soon
+      /// as the operation being done with the connection completes. This allows
+      /// connections to be shared amonst multiple threads keeping the number of
+      /// connections down.
+      /// </remarks>
+      CacheFactory^ SetThreadLocalConnections( bool enabled );
+
+      /// <summary>
+		  /// Sets whether pool is in multiuser mode
+		  /// </summary>
+		  /// <param>
+		  /// multiuserAuthentication should be true/false. Default value is false;
+		  /// </param>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+      CacheFactory^ SetMultiuserAuthentication( bool multiuserAuthentication );
+
+
+		  ///<summary>
+			/// Control whether pdx ignores fields that were unread during deserialization.
+			/// The default is to preserve unread fields be including their data during serialization.
+			/// But if you configure the cache to ignore unread fields then their data will be lost
+			/// during serialization.
+			/// <P>You should only set this attribute to <code>true</code> if you know this member
+			/// will only be reading cache data. In this use case you do not need to pay the cost
+			/// of preserving the unread fields since you will never be reserializing pdx data. 
+			///<summary>
+			/// <param> ignore <code>true</code> if fields not read during pdx deserialization should be ignored;
+			/// <code>false</code>, the default, if they should be preserved.
+			/// </param>
+			/// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+			CacheFactory^ SetPdxIgnoreUnreadFields(bool ignore);
+
+      ///<summary>
+     /// Sets the object preference to PdxInstance type.
+     /// When a cached object that was serialized as a PDX is read
+     /// from the cache a {@link PdxInstance} will be returned instead of the actual domain class.
+     /// The PdxInstance is an interface that provides run time access to 
+     /// the fields of a PDX without deserializing the entire PDX. 
+     /// The PdxInstance implementation is a light weight wrapper 
+     /// that simply refers to the raw bytes of the PDX that are kept 
+     /// in the cache. Using this method applications can choose to 
+     /// access PdxInstance instead of Java object.
+     /// Note that a PdxInstance is only returned if a serialized PDX is found in the cache.
+     /// If the cache contains a deserialized PDX, then a domain class instance is returned instead of a PdxInstance.
+     ///</summary>
+      /// <param> pdxReadSerialized <code>true</code> to prefer PdxInstance
+			/// <code>false</code>, the default, if they should be preserved.
+			/// </param>
+			/// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+      CacheFactory^  SetPdxReadSerialized(bool pdxReadSerialized); 
+
+
+      /// <summary>
+		  /// Sets a gemfire property that will be used when creating the ClientCache.
+      /// </summary>
+		  /// <param>
+		  /// name the name of the gemfire property
+		  /// </param>
+      /// <param>
+		  /// value the value of the gemfire property
+		  /// </param>
+      /// <returns>
+      /// a instance of <c>CacheFactory</c> 
+      /// </returns>
+      CacheFactory^ Set(String^ name, String^ value);
+
+       private:
+
+        /// <summary>
+        /// Private constructor to wrap a native object pointer
+        /// </summary>
+        /// <param name="nativeptr">The native object pointer</param>
+         inline CacheFactory( gemfire::CacheFactory* nativeptr, Properties<String^, String^>^ dsProps )
+					 : SBWrap( nativeptr ) 
+         { 
+            m_dsProps = dsProps;
+         }
+
+         Properties<String^, String^>^ m_dsProps; 
+
+         static System::Object^ m_singletonSync = gcnew System::Object();
+
+        internal:
+          static bool m_connected = false;
+      };
+
+    }
+  }
+}
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/src/CacheListenerAdapter.hpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/CacheListenerAdapter.hpp b/src/clicache/src/CacheListenerAdapter.hpp
new file mode 100644
index 0000000..6436960
--- /dev/null
+++ b/src/clicache/src/CacheListenerAdapter.hpp
@@ -0,0 +1,75 @@
+/*=========================================================================
+ * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+#pragma once
+
+#include "gf_defs.hpp"
+#include "ICacheListener.hpp"
+
+
+namespace GemStone
+{
+  namespace GemFire
+  {
+    namespace Cache { namespace Generic
+    {
+
+      /// <summary>
+      /// Utility class that implements all methods in <c>ICacheListener</c>
+      /// with empty implementations. Applications can subclass this class
+      /// and only override the methods for the events of interest.
+      /// </summary>
+      generic<class TKey, class TValue>
+      public ref class CacheListenerAdapter
+        : public ICacheListener<TKey, TValue>
+      {
+      public:
+        virtual void AfterCreate(EntryEvent<TKey, TValue>^ ev)
+        {
+        }
+
+        virtual void AfterUpdate(EntryEvent<TKey, TValue>^ ev)
+        {
+        }
+
+        virtual void AfterInvalidate(EntryEvent<TKey, TValue>^ ev)
+        {
+        }
+
+        virtual void AfterDestroy(EntryEvent<TKey, TValue>^ ev)
+        {
+        }
+
+        virtual void AfterRegionInvalidate(RegionEvent<TKey, TValue>^ ev)
+        {
+        }
+
+        virtual void AfterRegionDestroy(RegionEvent<TKey, TValue>^ ev)
+        {
+        }
+
+        virtual void AfterRegionLive(RegionEvent<TKey, TValue>^ ev)
+        {
+        }
+
+        virtual void AfterRegionClear(RegionEvent<TKey, TValue>^ ev)
+        {
+        }
+
+        virtual void Close(GemStone::GemFire::Cache::Generic::IRegion<TKey, TValue>^ region)
+        {
+        }
+		virtual void AfterRegionDisconnected(GemStone::GemFire::Cache::Generic::IRegion<TKey, TValue>^ region)
+        {
+        }
+      };
+
+    }
+  }
+}
+ } //namespace 

http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/src/CacheStatistics.cpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/CacheStatistics.cpp b/src/clicache/src/CacheStatistics.cpp
new file mode 100644
index 0000000..e975f63
--- /dev/null
+++ b/src/clicache/src/CacheStatistics.cpp
@@ -0,0 +1,33 @@
+/*=========================================================================
+ * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+//#include "gf_includes.hpp"
+#include "CacheStatistics.hpp"
+
+
+namespace GemStone
+{
+  namespace GemFire
+  {
+    namespace Cache { namespace Generic
+    {
+
+      uint32_t CacheStatistics::LastModifiedTime::get( )
+      {
+        return NativePtr->getLastModifiedTime( );
+      }
+
+      uint32_t CacheStatistics::LastAccessedTime::get( )
+      {
+        return NativePtr->getLastAccessedTime( );
+      }
+
+    }
+  }
+}
+ } //namespace 

http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/src/CacheStatistics.hpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/CacheStatistics.hpp b/src/clicache/src/CacheStatistics.hpp
new file mode 100644
index 0000000..ab3b69a
--- /dev/null
+++ b/src/clicache/src/CacheStatistics.hpp
@@ -0,0 +1,145 @@
+/*=========================================================================
+ * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+#pragma once
+
+#include "gf_defs.hpp"
+#include <gfcpp/CacheStatistics.hpp>
+#include "impl/NativeWrapper.hpp"
+
+
+namespace GemStone
+{
+  namespace GemFire
+  {
+    namespace Cache { namespace Generic
+    {
+
+      /// <summary>
+      /// Defines common statistical information for both the region and its entries.
+      /// </summary>
+      /// <remarks>
+      /// All of these methods may throw a <c>CacheClosedException</c>,
+      /// <c>RegionDestroyedException</c>, or <c>EntryDestroyedException</c>.
+      /// </remarks>
+      /// <seealso cref="Region.Statistics" />
+      /// <seealso cref="RegionEntry.Statistics" />
+      public ref class CacheStatistics sealed
+        : public Internal::SBWrap<gemfire::CacheStatistics>
+      {
+      public:
+
+        /// <summary>
+        /// For an entry, returns the time that the entry's value was last modified.
+        /// For a region, returns the last time any of the region's entries' values or
+        /// the values in subregions' entries were modified.
+        /// </summary>
+        /// <remarks>
+        /// <para>
+        /// The modification may have been initiated locally, or it may have been
+        /// an update distributed from another cache. It may also have been a new
+        /// value provided by a loader. The modification time on a region is
+        /// propagated upward to parent regions, transitively, to the root region.
+        /// </para><para>
+        /// The number is expressed as the number of milliseconds since January 1, 1970.
+        /// The granularity may be as coarse as 100ms, so the accuracy may be off by
+        /// up to 50ms.
+        /// </para><para>
+        /// Entry and subregion creation will update the modification time on a
+        /// region, but <c>Region.Destroy</c>, <c>Region.DestroyRegion</c>,
+        /// <c>Region.Invalidate</c>, and <c>Region.InvalidateRegion</c>
+        /// do not update the modification time.
+        /// </para>
+        /// </remarks>
+        /// <returns>
+        /// the last modification time of the region or the entry;
+        /// returns 0 if the entry is invalid or the modification time is uninitialized.
+        /// </returns>
+        /// <seealso cref="Region.Put" />
+        /// <seealso cref="Region.Get" />
+        /// <seealso cref="Region.Create" />
+        /// <seealso cref="Region.CreateSubRegion" />
+        property uint32_t LastModifiedTime
+        {
+          /// <summary>
+          /// Get the last modified time of an entry or a region.
+          /// </summary>
+          /// <returns>
+          /// the last accessed time expressed as the number of milliseconds since
+          /// January 1, 1970.
+          /// </returns>
+          uint32_t get( );
+        }
+
+        /// <summary>
+        /// For an entry, returns the last time it was accessed via <c>Region.Get</c>.
+        /// For a region, returns the last time any of its entries or the entries of
+        /// its subregions were accessed with <c>Region.Get</c>.
+        /// </summary>
+        /// <remarks>
+        /// <para>
+        /// Any modifications will also update the <c>LastAccessedTime</c>,
+        /// so <c>LastAccessedTime</c> is always greater than or equal to
+        /// <c>LastModifiedTime</c>. The <c>LastAccessedTime</c> on a region is
+        /// propagated upward to parent regions, transitively, to the the root region.
+        /// </para><para>
+        /// The number is expressed as the number of milliseconds since
+        /// January 1, 1970. The granularity may be as coarse as 100ms, so
+        /// the accuracy may be off by up to 50ms.
+        /// </para>
+        /// </remarks>
+        /// <returns>
+        /// the last access time of the region or the entry's value;
+        /// returns 0 if entry is invalid or access time is uninitialized.
+        /// </returns>
+        /// <seealso cref="Region.Get" />
+        /// <seealso cref="LastModifiedTime" />
+        property uint32_t LastAccessedTime
+        {
+          /// <summary>
+          /// Get the last accessed time of an entry or a region.
+          /// </summary>
+          /// <returns>
+          /// the last accessed time expressed as the number of milliseconds since
+          /// January 1, 1970.
+          /// </returns>
+          uint32_t get( );
+        }
+
+
+      internal:
+
+        /// <summary>
+        /// Internal factory function to wrap a native object pointer inside
+        /// this managed class with null pointer check.
+        /// </summary>
+        /// <param name="nativeptr">The native object pointer</param>
+        /// <returns>
+        /// The managed wrapper object; null if the native pointer is null.
+        /// </returns>
+        inline static CacheStatistics^ Create( gemfire::CacheStatistics* nativeptr )
+        {
+          return ( nativeptr != nullptr ?
+            gcnew CacheStatistics( nativeptr ) : nullptr );
+        }
+
+
+      private:
+
+        /// <summary>
+        /// Private constructor to wrap a native object pointer
+        /// </summary>
+        /// <param name="nativeptr">The native object pointer</param>
+        inline CacheStatistics( gemfire::CacheStatistics* nativeptr )
+          : SBWrap( nativeptr ) { }
+      };
+
+    }
+  }
+}
+ } //namespace 

http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/src/CacheTransactionManager.cpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/CacheTransactionManager.cpp b/src/clicache/src/CacheTransactionManager.cpp
new file mode 100644
index 0000000..927878b
--- /dev/null
+++ b/src/clicache/src/CacheTransactionManager.cpp
@@ -0,0 +1,204 @@
+/*=========================================================================
+ * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+//#include "gf_includes.hpp"
+#include "impl/SafeConvert.hpp"
+#include "impl/ManagedTransactionListener.hpp"
+#include "impl/ManagedTransactionWriter.hpp"
+#include "CacheTransactionManager.hpp"
+
+using namespace System;
+
+namespace GemStone
+{
+  namespace GemFire
+  {
+    namespace Cache {
+			namespace Generic
+    {
+
+      void CacheTransactionManager::Begin( )
+      {
+        _GF_MG_EXCEPTION_TRY2
+
+          NativePtr->begin( );
+
+        _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+
+      void CacheTransactionManager::Prepare( )
+      {
+        _GF_MG_EXCEPTION_TRY2
+
+          NativePtr->prepare( );
+
+        _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+
+      void CacheTransactionManager::Commit( )
+      {
+        _GF_MG_EXCEPTION_TRY2
+          NativePtr->commit( );
+        _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+
+      void CacheTransactionManager::Rollback( )
+      {
+        _GF_MG_EXCEPTION_TRY2
+          NativePtr->rollback( );
+        _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+
+      bool CacheTransactionManager::Exists( )
+      {
+        _GF_MG_EXCEPTION_TRY2
+
+          return NativePtr->exists( );
+
+        _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+
+      GemStone::GemFire::Cache::Generic::TransactionId^ CacheTransactionManager::Suspend( )
+      {
+        _GF_MG_EXCEPTION_TRY2
+       
+          return GemStone::GemFire::Cache::Generic::TransactionId::Create( NativePtr->suspend().ptr() );
+       
+        _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+			GemStone::GemFire::Cache::Generic::TransactionId^ CacheTransactionManager::TransactionId::get( )
+      {
+        _GF_MG_EXCEPTION_TRY2
+
+          return GemStone::GemFire::Cache::Generic::TransactionId::Create( NativePtr->getTransactionId().ptr() );
+
+        _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+      void CacheTransactionManager::Resume(GemStone::GemFire::Cache::Generic::TransactionId^ transactionId)
+      {
+        _GF_MG_EXCEPTION_TRY2
+        
+          return NativePtr->resume( gemfire::TransactionIdPtr(transactionId->NativePtr()));
+
+        _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+      bool CacheTransactionManager::IsSuspended(GemStone::GemFire::Cache::Generic::TransactionId^ transactionId)
+      {
+        _GF_MG_EXCEPTION_TRY2
+
+          return NativePtr->isSuspended( gemfire::TransactionIdPtr(transactionId->NativePtr()));
+
+        _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+      bool CacheTransactionManager::TryResume(GemStone::GemFire::Cache::Generic::TransactionId^ transactionId)
+      {
+        _GF_MG_EXCEPTION_TRY2
+
+          return NativePtr->tryResume( gemfire::TransactionIdPtr(transactionId->NativePtr()));
+
+        _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+      bool CacheTransactionManager::TryResume(GemStone::GemFire::Cache::Generic::TransactionId^ transactionId, int32_t waitTimeInMilliSec)
+      {
+        _GF_MG_EXCEPTION_TRY2
+
+          return NativePtr->tryResume( gemfire::TransactionIdPtr(transactionId->NativePtr()), waitTimeInMilliSec);
+
+        _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+      bool CacheTransactionManager::Exists(GemStone::GemFire::Cache::Generic::TransactionId^ transactionId)
+      {
+        _GF_MG_EXCEPTION_TRY2
+
+          return NativePtr->exists( gemfire::TransactionIdPtr(transactionId->NativePtr()));
+
+        _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+
+#ifdef CSTX_COMMENTED
+      generic<class TKey, class TValue>
+      ITransactionWriter<TKey, TValue>^ CacheTransactionManager::GetWriter( )
+      {
+        _GF_MG_EXCEPTION_TRY2
+
+          // Conver the unmanaged object to  managed generic object 
+          gemfire::TransactionWriterPtr& writerPtr( NativePtr->getWriter( ) );
+          gemfire::ManagedTransactionWriterGeneric* twg =
+          dynamic_cast<gemfire::ManagedTransactionWriterGeneric*>( writerPtr.ptr( ) );
+
+          if (twg != nullptr)
+          {
+            return (ITransactionWriter<TKey, TValue>^)twg->userptr( );
+          }
+        
+        _GF_MG_EXCEPTION_CATCH_ALL2
+        
+        return nullptr;
+      }
+      
+      generic<class TKey, class TValue>
+      void CacheTransactionManager::SetWriter(ITransactionWriter<TKey, TValue>^ transactionWriter)
+      {
+        _GF_MG_EXCEPTION_TRY2
+          // Create a unmanaged object using the ManagedTransactionWriterGeneric.
+          // Set the generic object inside the TransactionWriterGeneric that is a non generic object
+          gemfire::TransactionWriterPtr writerPtr;
+          if ( transactionWriter != nullptr ) 
+          {
+            TransactionWriterGeneric<TKey, TValue>^ twg = gcnew TransactionWriterGeneric<TKey, TValue> ();
+            twg->SetTransactionWriter(transactionWriter);
+            writerPtr = new gemfire::ManagedTransactionWriterGeneric( transactionWriter );
+            ((gemfire::ManagedTransactionWriterGeneric*)writerPtr.ptr())->setptr(twg);
+          }
+          NativePtr->setWriter( writerPtr );
+          
+        _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+
+      generic<class TKey, class TValue>
+      void CacheTransactionManager::AddListener(ITransactionListener<TKey, TValue>^ transactionListener)
+      {
+        _GF_MG_EXCEPTION_TRY2
+          // Create a unmanaged object using the ManagedTransactionListenerGeneric.
+          // Set the generic object inside the TransactionListenerGeneric that is a non generic object
+          gemfire::TransactionListenerPtr listenerPtr;
+          if ( transactionListener != nullptr ) 
+          {
+            TransactionListenerGeneric<TKey, TValue>^ twg = gcnew TransactionListenerGeneric<TKey, TValue> ();
+            twg->SetTransactionListener(transactionListener);
+            listenerPtr = new gemfire::ManagedTransactionListenerGeneric( transactionListener );
+            ((gemfire::ManagedTransactionListenerGeneric*)listenerPtr.ptr())->setptr(twg);
+          }
+          NativePtr->addListener( listenerPtr );
+          
+        _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+        
+      generic<class TKey, class TValue>
+      void CacheTransactionManager::RemoveListener(ITransactionListener<TKey, TValue>^ transactionListener)
+      {
+        _GF_MG_EXCEPTION_TRY2
+          // Create an unmanaged non generic object using the managed generic object
+          // use this to call the remove listener
+          gemfire::TransactionListenerPtr listenerPtr;
+          if ( transactionListener != nullptr ) 
+          {
+            TransactionListenerGeneric<TKey, TValue>^ twg = gcnew TransactionListenerGeneric<TKey, TValue> ();
+            twg->SetTransactionListener(transactionListener);
+            listenerPtr = new gemfire::ManagedTransactionListenerGeneric( transactionListener );
+            ((gemfire::ManagedTransactionListenerGeneric*)listenerPtr.ptr())->setptr(twg);
+          }
+          NativePtr->removeListener( listenerPtr );
+
+        _GF_MG_EXCEPTION_CATCH_ALL2
+      }
+#endif
+    }
+  }
+}
+ } //namespace 

http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/src/CacheTransactionManager.hpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/CacheTransactionManager.hpp b/src/clicache/src/CacheTransactionManager.hpp
new file mode 100644
index 0000000..811624d
--- /dev/null
+++ b/src/clicache/src/CacheTransactionManager.hpp
@@ -0,0 +1,262 @@
+/*=========================================================================
+ * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+#pragma once
+
+#include "gf_defs.hpp"
+#include <gfcpp/CacheTransactionManager.hpp>
+#include <gfcpp/InternalCacheTransactionManager2PC.hpp>
+#include "TransactionId.hpp"
+//#include "impl/NativeWrapper.hpp"
+//#include "impl/TransactionWriter.hpp"
+//#include "impl/TransactionListener.hpp"
+
+using namespace System;
+namespace GemStone
+{
+  namespace GemFire
+  {
+    namespace Cache { 
+			namespace Generic
+    {
+      
+      /// <summary>
+      /// CacheTransactionManager encapsulates the transactions for a cache
+      /// </summary>
+      public ref class CacheTransactionManager sealed
+        : Internal::SBWrap<gemfire::InternalCacheTransactionManager2PC>
+      {
+      public:
+        /// <summary>
+        /// Creates a new transaction and associates it with the current thread.
+        /// </summary>
+        /// <exception cref="IllegalStateException">
+        /// Throws exception if the thread is already associated with a transaction
+        /// </exception>
+        void Begin();
+
+        /// <summary>
+        /// Prepare the first message of two-phase-commit transaction associated
+        /// with the current thread.
+        /// </summary>
+        /// <exception cref="IllegalStateException">
+        /// if the thread is not associated with a transaction
+        /// </exception>
+        /// <exception cref="CommitConflictException">
+        /// if the commit operation fails due to a write conflict.
+        /// </exception>
+        void Prepare();
+
+        /// <summary>
+        /// Commit the transaction associated with the current thread. If
+        /// the commit operation fails due to a conflict it will destroy
+        /// the transaction state and throw a <c>CommitConflictException</c>. 
+        /// If the commit operation succeeds,it returns after the transaction 
+        /// state has been merged with committed state.  When this method 
+        /// completes, the thread is no longer associated with a transaction.
+        /// </summary>
+        /// <exception cref="IllegalStateException">
+        /// if the thread is not associated with a transaction
+        /// </exception>
+        /// <exception cref="CommitConflictException">
+        /// if the commit operation fails due to a write conflict.
+        /// </exception>
+        void Commit();
+        
+        /// <summary>
+        /// Roll back the transaction associated with the current thread. When
+        /// this method completes, the thread is no longer associated with a
+        /// transaction and the transaction context is destroyed.
+        /// </summary>
+        /// <exception cref="IllegalStateException">
+        /// if the thread is not associated with a transaction
+        /// </exception>  
+        void Rollback();
+        
+        /// <summary>
+        /// Reports the existence of a Transaction for this thread
+        /// </summary>
+        /// <returns>true if a transaction exists, false otherwise</returns>
+        bool Exists();
+
+        /// <summary>
+        /// Suspends the transaction on the current thread. All subsequent operations
+        /// performed by this thread will be non-transactional. The suspended
+        /// transaction can be resumed by calling <see cref="TransactionId"/>
+        /// <para>
+        /// Since 3.6.2
+        /// </para>
+        /// </summary>
+        /// <returns>the transaction identifier of the suspended transaction or null if
+        /// the thread was not associated with a transaction</returns>
+        GemStone::GemFire::Cache::Generic::TransactionId^ Suspend();
+
+        /// <summary>
+        /// On the current thread, resumes a transaction that was previously suspended
+        /// using <see cref="suspend"/>
+        /// <para>
+        /// Since 3.6.2
+        /// </para>
+        /// </summary>
+        /// <param name="transactionId">the transaction to resume</param>
+        /// <exception cref="IllegalStateException">if the thread is associated with a transaction or if
+        /// would return false for the given transactionId</exception>
+        /// <see cref="TransactionId"/> 
+        void Resume(GemStone::GemFire::Cache::Generic::TransactionId^ transactionId);
+
+        /// <summary>
+        /// This method can be used to determine if a transaction with the given
+        /// transaction identifier is currently suspended locally. This method does not
+        ///  check other members for transaction status.
+        /// <para>
+        /// Since 3.6.2
+        /// </para>
+        /// </summary>
+        /// <param name="transactionId"></param>
+        /// <returns>true if the transaction is in suspended state, false otherwise</returns>
+        /// <see cref="TransactionId"/>
+        bool IsSuspended(GemStone::GemFire::Cache::Generic::TransactionId^ transactionId);
+
+
+        /// <summary>
+        /// On the current thread, resumes a transaction that was previously suspended
+        /// using <see cref="suspend"/>.
+        /// This method is equivalent to
+        /// <code>
+        /// if (isSuspended(txId)) {
+        ///   resume(txId);
+        /// }
+        /// </code>
+        /// except that this action is performed atomically
+        /// <para>
+        /// Since 3.6.2
+        /// </para>
+        /// </summary>
+        /// <param name="transactionId">the transaction to resume</param>
+        /// <returns>true if the transaction was resumed, false otherwise</returns>
+        bool TryResume(GemStone::GemFire::Cache::Generic::TransactionId^ transactionId);
+
+
+        /// <summary>
+        /// On the current thread, resumes a transaction that was previously suspended
+        /// using <see cref="suspend"/>, or waits for the specified timeout interval if
+        /// the transaction has not been suspended. This method will return if:
+        /// <para>
+        /// Another thread suspends the transaction
+        /// </para>
+        /// <para>
+        /// Another thread calls commit/rollback on the transaction
+        /// </para>
+        /// <para>
+        /// This thread has waited for the specified timeout
+        /// </para>
+        /// This method returns immediately if <see cref="TransactionId"/> returns false.
+        /// <para>
+        /// Since 3.6.2
+        /// </para>
+        /// </summary>
+        /// <param name="transactionId">the transaction to resume</param>
+        /// <param name="waitTimeInMilliSec">the maximum milliseconds to wait </param>
+        /// <returns>true if the transaction was resumed, false otherwise</returns>
+        bool TryResume(GemStone::GemFire::Cache::Generic::TransactionId^ transactionId, int32_t waitTimeInMilliSec);
+
+
+
+        /// <summary>
+        /// Reports the existence of a transaction for the given transactionId. This
+        /// method can be used to determine if a transaction with the given transaction
+        /// identifier is currently in progress locally.
+        /// <para>
+        /// Since 3.6.2
+        /// </para>
+        /// </summary>
+        /// <param name="transactionId">the given transaction identifier</param>
+        /// <returns>true if the transaction is in progress, false otherwise.</returns>
+        /// <see cref="isSuspended"/> 
+        bool Exists(GemStone::GemFire::Cache::Generic::TransactionId^ transactionId);
+
+
+        /// <summary>
+        /// Returns the transaction identifier for the current thread
+        /// <para>
+        /// Since 3.6.2
+        /// </para>
+        /// </summary>
+        /// <returns>the transaction identifier or null if no transaction exists</returns>
+        property GemStone::GemFire::Cache::Generic::TransactionId^ TransactionId
+        {
+        //TODO::split
+        GemStone::GemFire::Cache::Generic::TransactionId^ get( );
+        }        
+
+#ifdef CSTX_COMMENTED
+          
+ 		    /// <summary>
+        /// Returns the current transaction writer
+        /// </summary>
+        /// <returns>current transaction writer(<c>ITransactionWriter</c>)</returns>
+        generic<class TKey, class TValue>
+        ITransactionWriter<TKey, TValue>^ GetWriter ();
+        
+        /// <summary>
+        /// Set the <c>ITransactionWriter</c> for the cache
+        /// <param name="transactionWriter">transaction writer</param>
+        generic<class TKey, class TValue>
+        void SetWriter (ITransactionWriter<TKey, TValue>^ transactionWriter);
+
+        /// <summary>
+        /// Adds a transaction listener to the end of the list of transaction listeners 
+        /// on this cache.
+        /// </summary>
+        /// <param name="aListener"> 
+        /// the user defined transaction listener to add to the cache
+        /// </param>
+        /// <exception cref="IllegalArgumentException">
+        /// If the parameter is null.
+        /// </exception>
+        generic<class TKey, class TValue>
+        void AddListener(ITransactionListener<TKey, TValue>^ aListener);
+        
+        /// <summary>
+        /// Removes a transaction listener from the list of transaction listeners on this cache.
+        /// Does nothing if the specified listener has not been added.
+        /// If the specified listener has been added then the close method of the listener will
+        /// be called.
+        /// </summary>
+        /// <param name="aListener">the transaction listener to remove from the cache.</param>
+        /// <exception cref="IllegalArgumentException">
+        /// if the parameteris null
+        /// </exception>
+        generic<class TKey, class TValue>
+        void RemoveListener(ITransactionListener<TKey, TValue>^ aListener);
+        
+#endif
+
+      internal:
+
+        inline static CacheTransactionManager^ Create( gemfire::InternalCacheTransactionManager2PC* nativeptr )
+        {
+          return ( nativeptr != nullptr ?
+            gcnew CacheTransactionManager( nativeptr ) : nullptr );
+        }
+
+
+      private:
+
+        /// <summary>
+        /// Private constructor to wrap a native object pointer
+        /// </summary>
+        /// <param name="nativeptr">The native object pointer</param>
+        inline CacheTransactionManager( gemfire::InternalCacheTransactionManager2PC* nativeptr )
+          : SBWrap( nativeptr ) { }
+      };
+
+    }
+  }
+}
+ } //namespace 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/src/CacheWriterAdapter.hpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/CacheWriterAdapter.hpp b/src/clicache/src/CacheWriterAdapter.hpp
new file mode 100644
index 0000000..e9fd045
--- /dev/null
+++ b/src/clicache/src/CacheWriterAdapter.hpp
@@ -0,0 +1,65 @@
+/*=========================================================================
+ * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+#pragma once
+
+#include "gf_defs.hpp"
+#include "ICacheWriter.hpp"
+
+
+namespace GemStone
+{
+  namespace GemFire
+  {
+    namespace Cache { namespace Generic
+    {
+
+      /// <summary>
+      /// Utility class that implements all methods in <c>ICacheWriter</c>
+      /// with empty implementations. Applications can subclass this class
+      /// and only override the methods for the events of interest.
+      /// </summary>
+      generic<class TKey, class TValue>
+      public ref class CacheWriterAdapter
+        : public ICacheWriter<TKey, TValue>
+      {
+      public:
+        virtual bool BeforeUpdate(EntryEvent<TKey, TValue>^ ev)
+        {
+          return true;
+        }
+
+        virtual bool BeforeCreate(EntryEvent<TKey, TValue>^ ev)
+        {
+          return true;
+        }
+
+        virtual bool BeforeDestroy(EntryEvent<TKey, TValue>^ ev)
+        {
+          return true;
+        }
+
+        virtual bool BeforeRegionDestroy(RegionEvent<TKey, TValue>^ ev)
+        {
+          return true;
+        }
+
+        virtual bool BeforeRegionClear(RegionEvent<TKey, TValue>^ ev)
+        {
+          return true;
+        }
+
+        virtual void Close(IRegion<TKey, TValue>^ region)
+        {
+        }
+      };
+
+    }
+  }
+}
+ } //namespace 

http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/src/CacheableArrayList.hpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/CacheableArrayList.hpp b/src/clicache/src/CacheableArrayList.hpp
new file mode 100644
index 0000000..9770ace
--- /dev/null
+++ b/src/clicache/src/CacheableArrayList.hpp
@@ -0,0 +1,87 @@
+/*=========================================================================
+ * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+#pragma once
+
+#include "gf_defs.hpp"
+#include "CacheableVector.hpp"
+
+
+using namespace System;
+using namespace System::Collections::Generic;
+
+namespace GemStone
+{
+  namespace GemFire
+  {
+    namespace Cache { namespace Generic
+    {
+      /// <summary>
+      /// A mutable <c>IGFSerializable</c> vector wrapper that can serve as
+      /// a distributable object for caching. This class extends .NET generic
+      /// <c>List</c> class.
+      /// </summary>
+      ref class CacheableArrayList
+        : public CacheableVector
+      {
+      public:
+        /// <summary>
+        /// Allocates a new empty instance.
+        /// </summary>
+        inline CacheableArrayList(System::Collections::IList^ list)
+          : CacheableVector(list)
+        { }
+
+        
+        /// <summary>
+        /// Static function to create a new empty instance.
+        /// </summary>
+        inline static CacheableArrayList^ Create()
+        {
+          return gcnew CacheableArrayList(gcnew System::Collections::Generic::List<Object^>());
+        }
+
+        /// <summary>
+        /// Static function to create a new empty instance.
+        /// </summary>
+        inline static CacheableArrayList^ Create(System::Collections::IList^ list)
+        {
+          return gcnew CacheableArrayList(list);
+        }
+
+        
+        // Region: IGFSerializable Members
+
+        /// <summary>
+        /// Returns the classId of the instance being serialized.
+        /// This is used by deserialization to determine what instance
+        /// type to create and deserialize into.
+        /// </summary>
+        /// <returns>the classId</returns>
+        virtual property uint32_t ClassId
+        {
+          virtual uint32_t get() override
+          {
+            return GemFireClassIds::CacheableArrayList;
+          }
+        }
+
+        // End Region: IGFSerializable Members
+
+        /// <summary>
+        /// Factory function to register this class.
+        /// </summary>
+        static IGFSerializable^ CreateDeserializable()
+        {
+          return gcnew CacheableArrayList(gcnew System::Collections::Generic::List<Object^>());
+        }
+      };
+    }
+  }
+}
+ } //namespace 


Mime
View raw message