You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by jb...@apache.org on 2017/01/23 19:17:06 UTC
[14/50] [abbrv] geode git commit: GEODE-2316: Rename namespace
gemfire to apache::geode::client.
http://git-wip-us.apache.org/repos/asf/geode/blob/e4fd74fb/src/clicache/src/impl/ManagedFixedPartitionResolver.cpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/impl/ManagedFixedPartitionResolver.cpp b/src/clicache/src/impl/ManagedFixedPartitionResolver.cpp
index 0d51418..166d3d9 100644
--- a/src/clicache/src/impl/ManagedFixedPartitionResolver.cpp
+++ b/src/clicache/src/impl/ManagedFixedPartitionResolver.cpp
@@ -29,227 +29,234 @@ using namespace System;
using namespace System::Text;
using namespace System::Reflection;
-namespace gemfire
+namespace apache
{
- PartitionResolver* ManagedFixedPartitionResolverGeneric::create( const char* assemblyPath,
- const char* factoryFunctionName )
+ namespace geode
{
- try
+ namespace client
{
- String^ mg_assemblyPath =
- GemStone::GemFire::Cache::Generic::ManagedString::Get( assemblyPath );
- String^ mg_factoryFunctionName =
- GemStone::GemFire::Cache::Generic::ManagedString::Get( factoryFunctionName );
- String^ mg_typeName = nullptr;
-
- String^ mg_genericKey = nullptr;
- String^ mg_genericVal = nullptr;
-
- int32_t dotIndx = -1;
- int32_t genericsOpenIndx = -1;
- int32_t genericsCloseIndx = -1;
- int32_t commaIndx = -1;
-
- if (mg_factoryFunctionName == nullptr ||
- ( dotIndx = mg_factoryFunctionName->LastIndexOf( '.' ) ) < 0 )
+ PartitionResolver* ManagedFixedPartitionResolverGeneric::create(const char* assemblyPath,
+ const char* factoryFunctionName)
{
- std::string ex_str = "ManagedFixedPartitionResolverGeneric: Factory function name '";
- ex_str += factoryFunctionName;
- ex_str += "' does not contain type name";
- throw IllegalArgumentException( ex_str.c_str( ) );
- }
-
- if ((genericsCloseIndx = mg_factoryFunctionName->LastIndexOf( '>' )) < 0 )
- {
- std::string ex_str = "ManagedFixedPartitionResolverGeneric: Factory function name '";
- ex_str += factoryFunctionName;
- ex_str += "' does not contain any generic type parameters";
- throw gemfire::IllegalArgumentException( ex_str.c_str( ) );
- }
-
- if ((genericsOpenIndx = mg_factoryFunctionName->LastIndexOf( '<' )) < 0 ||
- genericsOpenIndx > genericsCloseIndx)
- {
- std::string ex_str = "ManagedFixedPartitionResolverGeneric: Factory function name '";
- ex_str += factoryFunctionName;
- ex_str += "' does not contain expected generic type parameters";
- throw gemfire::IllegalArgumentException( ex_str.c_str( ) );
- }
-
- if ((commaIndx = mg_factoryFunctionName->LastIndexOf( ',' )) < 0 ||
- (commaIndx < genericsOpenIndx || commaIndx > genericsCloseIndx))
- {
- std::string ex_str = "ManagedFixedPartitionResolverGeneric: Factory function name '";
- ex_str += factoryFunctionName;
- ex_str += "' does not contain expected generic type parameter comma separator";
- throw gemfire::IllegalArgumentException( ex_str.c_str( ) );
- }
+ try
+ {
+ String^ mg_assemblyPath =
+ GemStone::GemFire::Cache::Generic::ManagedString::Get(assemblyPath);
+ String^ mg_factoryFunctionName =
+ GemStone::GemFire::Cache::Generic::ManagedString::Get(factoryFunctionName);
+ String^ mg_typeName = nullptr;
- StringBuilder^ typeBuilder = gcnew StringBuilder(mg_factoryFunctionName->Substring(0, genericsOpenIndx));
- mg_typeName = typeBuilder->ToString();
- mg_genericKey = mg_factoryFunctionName->Substring(genericsOpenIndx + 1, commaIndx - genericsOpenIndx - 1);
- mg_genericKey = mg_genericKey->Trim();
- mg_genericVal = mg_factoryFunctionName->Substring(commaIndx + 1, genericsCloseIndx - commaIndx - 1);
- mg_genericVal = mg_genericVal->Trim();
- mg_factoryFunctionName = mg_factoryFunctionName->Substring( dotIndx + 1 );
+ String^ mg_genericKey = nullptr;
+ String^ mg_genericVal = nullptr;
- GemStone::GemFire::Cache::Generic::Log::Fine(
- "Attempting to instantiate a [{0}<{1}, {2}>] via the [{3}] factory method.",
- mg_typeName, mg_genericKey, mg_genericVal, mg_factoryFunctionName);
+ int32_t dotIndx = -1;
+ int32_t genericsOpenIndx = -1;
+ int32_t genericsCloseIndx = -1;
+ int32_t commaIndx = -1;
- typeBuilder->Append("`2");
- mg_typeName = typeBuilder->ToString();
+ if (mg_factoryFunctionName == nullptr ||
+ (dotIndx = mg_factoryFunctionName->LastIndexOf('.')) < 0)
+ {
+ std::string ex_str = "ManagedFixedPartitionResolverGeneric: Factory function name '";
+ ex_str += factoryFunctionName;
+ ex_str += "' does not contain type name";
+ throw IllegalArgumentException(ex_str.c_str());
+ }
- Assembly^ assmb = nullptr;
- try
- {
- assmb = Assembly::Load( mg_assemblyPath );
- }
- catch (System::Exception^)
- {
- assmb = nullptr;
- }
- if (assmb == nullptr)
- {
- std::string ex_str = "ManagedFixedPartitionResolverGeneric: Could not load assembly: ";
- ex_str += assemblyPath;
- throw IllegalArgumentException( ex_str.c_str( ) );
- }
-
- GemStone::GemFire::Cache::Generic::Log::Debug("Loading type: [{0}]", mg_typeName);
+ if ((genericsCloseIndx = mg_factoryFunctionName->LastIndexOf('>')) < 0)
+ {
+ std::string ex_str = "ManagedFixedPartitionResolverGeneric: Factory function name '";
+ ex_str += factoryFunctionName;
+ ex_str += "' does not contain any generic type parameters";
+ throw apache::geode::client::IllegalArgumentException(ex_str.c_str());
+ }
- Type^ typeInst = assmb->GetType(mg_typeName, false, true);
+ if ((genericsOpenIndx = mg_factoryFunctionName->LastIndexOf('<')) < 0 ||
+ genericsOpenIndx > genericsCloseIndx)
+ {
+ std::string ex_str = "ManagedFixedPartitionResolverGeneric: Factory function name '";
+ ex_str += factoryFunctionName;
+ ex_str += "' does not contain expected generic type parameters";
+ throw apache::geode::client::IllegalArgumentException(ex_str.c_str());
+ }
- if (typeInst != nullptr)
- {
- array<Type^>^ types = gcnew array<Type^>(2);
- types[0] = Type::GetType(mg_genericKey, false, true);
- types[1] = Type::GetType(mg_genericVal, false, true);
+ if ((commaIndx = mg_factoryFunctionName->LastIndexOf(',')) < 0 ||
+ (commaIndx < genericsOpenIndx || commaIndx > genericsCloseIndx))
+ {
+ std::string ex_str = "ManagedFixedPartitionResolverGeneric: Factory function name '";
+ ex_str += factoryFunctionName;
+ ex_str += "' does not contain expected generic type parameter comma separator";
+ throw apache::geode::client::IllegalArgumentException(ex_str.c_str());
+ }
- if (types[0] == nullptr || types[1] == nullptr)
- {
- std::string ex_str = "ManagedFixedPartitionResolverGeneric: Could not get both generic type argument instances";
- throw gemfire::IllegalArgumentException( ex_str.c_str( ) );
- }
+ StringBuilder^ typeBuilder = gcnew StringBuilder(mg_factoryFunctionName->Substring(0, genericsOpenIndx));
+ mg_typeName = typeBuilder->ToString();
+ mg_genericKey = mg_factoryFunctionName->Substring(genericsOpenIndx + 1, commaIndx - genericsOpenIndx - 1);
+ mg_genericKey = mg_genericKey->Trim();
+ mg_genericVal = mg_factoryFunctionName->Substring(commaIndx + 1, genericsCloseIndx - commaIndx - 1);
+ mg_genericVal = mg_genericVal->Trim();
+ mg_factoryFunctionName = mg_factoryFunctionName->Substring(dotIndx + 1);
- typeInst = typeInst->MakeGenericType(types);
- GemStone::GemFire::Cache::Generic::Log::Info("Loading function: [{0}]", mg_factoryFunctionName);
+ GemStone::GemFire::Cache::Generic::Log::Fine(
+ "Attempting to instantiate a [{0}<{1}, {2}>] via the [{3}] factory method.",
+ mg_typeName, mg_genericKey, mg_genericVal, mg_factoryFunctionName);
- MethodInfo^ mInfo = typeInst->GetMethod( mg_factoryFunctionName,
- BindingFlags::Public | BindingFlags::Static | BindingFlags::IgnoreCase );
+ typeBuilder->Append("`2");
+ mg_typeName = typeBuilder->ToString();
- if (mInfo != nullptr)
- {
- Object^ managedptr = nullptr;
+ Assembly^ assmb = nullptr;
try
{
- managedptr = mInfo->Invoke( typeInst, nullptr );
+ assmb = Assembly::Load(mg_assemblyPath);
}
- catch (System::Exception^ ex)
+ catch (System::Exception^)
{
- GemStone::GemFire::Cache::Generic::Log::Debug("{0}: {1}", ex->GetType()->Name, ex->Message);
- managedptr = nullptr;
+ assmb = nullptr;
}
- if (managedptr == nullptr)
+ if (assmb == nullptr)
{
- std::string ex_str = "ManagedFixedPartitionResolverGeneric: Could not create "
- "object on invoking factory function [";
- ex_str += factoryFunctionName;
- ex_str += "] in assembly: ";
+ std::string ex_str = "ManagedFixedPartitionResolverGeneric: Could not load assembly: ";
ex_str += assemblyPath;
- throw IllegalArgumentException( ex_str.c_str( ) );
+ throw IllegalArgumentException(ex_str.c_str());
}
- ManagedFixedPartitionResolverGeneric * mgpr = new ManagedFixedPartitionResolverGeneric(managedptr);
+ GemStone::GemFire::Cache::Generic::Log::Debug("Loading type: [{0}]", mg_typeName);
- Type^ prgType = Type::GetType("GemStone.GemFire.Cache.Generic.FixedPartitionResolverGeneric`2");
- prgType = prgType->MakeGenericType(types);
- Object^ prg = Activator::CreateInstance(prgType);
+ Type^ typeInst = assmb->GetType(mg_typeName, false, true);
- mInfo = prgType->GetMethod("SetPartitionResolver");
- array<Object^>^ params = gcnew array<Object^>(1);
- params[0] = managedptr;
- mInfo->Invoke(prg, params);
+ if (typeInst != nullptr)
+ {
+ array<Type^>^ types = gcnew array<Type^>(2);
+ types[0] = Type::GetType(mg_genericKey, false, true);
+ types[1] = Type::GetType(mg_genericVal, false, true);
+
+ if (types[0] == nullptr || types[1] == nullptr)
+ {
+ std::string ex_str = "ManagedFixedPartitionResolverGeneric: Could not get both generic type argument instances";
+ throw apache::geode::client::IllegalArgumentException(ex_str.c_str());
+ }
+
+ typeInst = typeInst->MakeGenericType(types);
+ GemStone::GemFire::Cache::Generic::Log::Info("Loading function: [{0}]", mg_factoryFunctionName);
+
+ MethodInfo^ mInfo = typeInst->GetMethod(mg_factoryFunctionName,
+ BindingFlags::Public | BindingFlags::Static | BindingFlags::IgnoreCase);
+
+ if (mInfo != nullptr)
+ {
+ Object^ managedptr = nullptr;
+ try
+ {
+ managedptr = mInfo->Invoke(typeInst, nullptr);
+ }
+ catch (System::Exception^ ex)
+ {
+ GemStone::GemFire::Cache::Generic::Log::Debug("{0}: {1}", ex->GetType()->Name, ex->Message);
+ managedptr = nullptr;
+ }
+ if (managedptr == nullptr)
+ {
+ std::string ex_str = "ManagedFixedPartitionResolverGeneric: Could not create "
+ "object on invoking factory function [";
+ ex_str += factoryFunctionName;
+ ex_str += "] in assembly: ";
+ ex_str += assemblyPath;
+ throw IllegalArgumentException(ex_str.c_str());
+ }
- mgpr->setptr((GemStone::GemFire::Cache::Generic::IFixedPartitionResolverProxy^)prg);
+ ManagedFixedPartitionResolverGeneric * mgpr = new ManagedFixedPartitionResolverGeneric(managedptr);
- return mgpr;
+ Type^ prgType = Type::GetType("GemStone.GemFire.Cache.Generic.FixedPartitionResolverGeneric`2");
+ prgType = prgType->MakeGenericType(types);
+ Object^ prg = Activator::CreateInstance(prgType);
+
+ mInfo = prgType->GetMethod("SetPartitionResolver");
+ array<Object^>^ params = gcnew array<Object^>(1);
+ params[0] = managedptr;
+ mInfo->Invoke(prg, params);
+
+ mgpr->setptr((GemStone::GemFire::Cache::Generic::IFixedPartitionResolverProxy^)prg);
+
+ return mgpr;
+ }
+ else
+ {
+ std::string ex_str = "ManagedFixedPartitionResolverGeneric: Could not load "
+ "function with name [";
+ ex_str += factoryFunctionName;
+ ex_str += "] in assembly: ";
+ ex_str += assemblyPath;
+ throw IllegalArgumentException(ex_str.c_str());
+ }
+ }
+ else
+ {
+ GemStone::GemFire::Cache::Generic::ManagedString typeName(mg_typeName);
+ std::string ex_str = "ManagedFixedPartitionResolverGeneric: Could not load type [";
+ ex_str += typeName.CharPtr;
+ ex_str += "] in assembly: ";
+ ex_str += assemblyPath;
+ throw IllegalArgumentException(ex_str.c_str());
+ }
}
- else
+ catch (const apache::geode::client::Exception&)
{
- std::string ex_str = "ManagedFixedPartitionResolverGeneric: Could not load "
- "function with name [";
- ex_str += factoryFunctionName;
- ex_str += "] in assembly: ";
- ex_str += assemblyPath;
- throw IllegalArgumentException( ex_str.c_str( ) );
+ throw;
}
+ catch (System::Exception^ ex)
+ {
+ GemStone::GemFire::Cache::Generic::ManagedString mg_exStr(ex->ToString());
+ std::string ex_str = "ManagedFixedPartitionResolverGeneric: Got an exception while "
+ "loading managed library: ";
+ ex_str += mg_exStr.CharPtr;
+ throw IllegalArgumentException(ex_str.c_str());
+ }
+ return NULL;
}
- else
+
+ CacheableKeyPtr ManagedFixedPartitionResolverGeneric::getRoutingObject(const EntryEvent& key)
{
- GemStone::GemFire::Cache::Generic::ManagedString typeName( mg_typeName );
- std::string ex_str = "ManagedFixedPartitionResolverGeneric: Could not load type [";
- ex_str += typeName.CharPtr;
- ex_str += "] in assembly: ";
- ex_str += assemblyPath;
- throw IllegalArgumentException( ex_str.c_str( ) );
+ try {
+ return m_managedptr->getRoutingObject(key);
+ }
+ catch (GemStone::GemFire::Cache::Generic::GemFireException^ ex) {
+ ex->ThrowNative();
+ }
+ catch (System::Exception^ ex) {
+ GemStone::GemFire::Cache::Generic::GemFireException::ThrowNative(ex);
+ }
+ return NULLPTR;
}
- }
- catch (const gemfire::Exception&)
- {
- throw;
- }
- catch (System::Exception^ ex)
- {
- GemStone::GemFire::Cache::Generic::ManagedString mg_exStr( ex->ToString( ) );
- std::string ex_str = "ManagedFixedPartitionResolverGeneric: Got an exception while "
- "loading managed library: ";
- ex_str += mg_exStr.CharPtr;
- throw IllegalArgumentException( ex_str.c_str( ) );
- }
- return NULL;
- }
-
- CacheableKeyPtr ManagedFixedPartitionResolverGeneric::getRoutingObject(const EntryEvent& key)
- {
- try {
- return m_managedptr->getRoutingObject(key);
- }
- catch (GemStone::GemFire::Cache::Generic::GemFireException^ ex) {
- ex->ThrowNative();
- }
- catch (System::Exception^ ex) {
- GemStone::GemFire::Cache::Generic::GemFireException::ThrowNative(ex);
- }
- return NULLPTR;
- }
-
- const char* ManagedFixedPartitionResolverGeneric::getName()
- {
- try {
- return m_managedptr->getName();
- }
- catch (GemStone::GemFire::Cache::Generic::GemFireException^ ex) {
- ex->ThrowNative();
- }
- catch (System::Exception^ ex) {
- GemStone::GemFire::Cache::Generic::GemFireException::ThrowNative(ex);
- }
- return NULL;
- }
-
- const char* ManagedFixedPartitionResolverGeneric::getPartitionName(const EntryEvent& opDetails)
- {
- try {
- return m_managedptr->getPartitionName(opDetails);
- }
- catch (GemStone::GemFire::Cache::Generic::GemFireException^ ex) {
- ex->ThrowNative();
- }
- catch (System::Exception^ ex) {
- GemStone::GemFire::Cache::Generic::GemFireException::ThrowNative(ex);
- }
- return NULL;
- }
-
-}
+
+ const char* ManagedFixedPartitionResolverGeneric::getName()
+ {
+ try {
+ return m_managedptr->getName();
+ }
+ catch (GemStone::GemFire::Cache::Generic::GemFireException^ ex) {
+ ex->ThrowNative();
+ }
+ catch (System::Exception^ ex) {
+ GemStone::GemFire::Cache::Generic::GemFireException::ThrowNative(ex);
+ }
+ return NULL;
+ }
+
+ const char* ManagedFixedPartitionResolverGeneric::getPartitionName(const EntryEvent& opDetails)
+ {
+ try {
+ return m_managedptr->getPartitionName(opDetails);
+ }
+ catch (GemStone::GemFire::Cache::Generic::GemFireException^ ex) {
+ ex->ThrowNative();
+ }
+ catch (System::Exception^ ex) {
+ GemStone::GemFire::Cache::Generic::GemFireException::ThrowNative(ex);
+ }
+ return NULL;
+ }
+
+ } // namespace client
+ } // namespace geode
+} // namespace apache
+
http://git-wip-us.apache.org/repos/asf/geode/blob/e4fd74fb/src/clicache/src/impl/ManagedFixedPartitionResolver.hpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/impl/ManagedFixedPartitionResolver.hpp b/src/clicache/src/impl/ManagedFixedPartitionResolver.hpp
index 4b75487..ba88230 100644
--- a/src/clicache/src/impl/ManagedFixedPartitionResolver.hpp
+++ b/src/clicache/src/impl/ManagedFixedPartitionResolver.hpp
@@ -23,118 +23,122 @@
#include "FixedPartitionResolver.hpp"
-namespace gemfire {
-
- /// <summary>
- /// Wraps the managed <see cref="GemStone.GemFire.Cache.IFixedPartitionResolver" />
- /// object and implements the native <c>gemfire::FixedPartitionResolver</c> interface.
- /// </summary>
- class ManagedFixedPartitionResolverGeneric
- : public FixedPartitionResolver
- {
- public:
-
- /// <summary>
- /// Constructor to initialize with the provided managed object.
- /// </summary>
- /// <param name="userptr">
- /// The managed object.
- /// </param>
- inline ManagedFixedPartitionResolverGeneric( Object^ userptr ) : m_userptr( userptr ) { }
-
- /// <summary>
- /// Destructor -- does nothing.
- /// </summary>
- virtual ~ManagedFixedPartitionResolverGeneric( ) { }
-
- /// <summary>
- /// Static function to create a <c>ManagedFixedPartitionResolver</c> using given
- /// managed assembly path and given factory function.
- /// </summary>
- /// <param name="assemblyPath">
- /// The path of the managed assembly that contains the <c>IFixedPartitionResolver</c>
- /// factory function.
- /// </param>
- /// <param name="factoryFunctionName">
- /// The name of the factory function of the managed class for creating
- /// an object that implements <c>IFixedPartitionResolver</c>.
- /// This should be a static function of the format
- /// {Namespace}.{Class Name}.{Method Name}.
- /// </param>
- /// <exception cref="IllegalArgumentException">
- /// If the managed library cannot be loaded or the factory function fails.
- /// </exception>
- static PartitionResolver* create( const char* assemblyPath,
- const char* factoryFunctionName );
-
- /// <summary>
- /// return object associated with entry event which allows the Partitioned Region to store associated data together.
- /// </summary>
- /// <remarks>
- /// throws RuntimeException - any exception thrown will terminate the operation and the exception will be passed to the
- /// calling thread.
- /// </remarks>
- /// <param name="key">
- /// key the detail of the entry event.
- /// </param>
-
- virtual CacheableKeyPtr getRoutingObject(const EntryEvent& key);
-
- /// <summary>
- /// Returns the name of the FixedPartitionResolver.
- /// </summary>
- /// <remarks>
- /// <para>
- /// This function does not throw any exception.
- /// </para>
- /// <returns>
- /// the name of the FixedPartitionResolver
- /// </returns>
- /// </remarks>
- virtual const char* getName();
-
-
- /// <summary>
- /// This method is used to get the name of the partition for the given entry
- /// operation.
- /// <param name="opDetails">
- /// the details of the entry event e.g. {@link Region#get(Object)}
- /// </param>
- /// <returns>
- /// partition-name associated with node which allows mapping of given data to user defined partition.
- /// </returns>
- virtual const char* getPartitionName(const EntryEvent& opDetails);
-
-
- /// <summary>
- /// Returns the wrapped managed object reference.
- /// </summary>
- inline GemStone::GemFire::Cache::Generic::IFixedPartitionResolverProxy^ ptr( ) const
- {
- return m_managedptr;
- }
-
- inline void setptr(GemStone::GemFire::Cache::Generic::IFixedPartitionResolverProxy^ managedptr)
- {
- m_managedptr = managedptr;
- }
-
- inline Object^ userptr( ) const
- {
- return m_userptr;
- }
-
- private:
-
- /// <summary>
- /// Using gcroot to hold the managed delegate pointer (since it cannot be stored directly).
- /// Note: not using auto_gcroot since it will result in 'Dispose' of the IFixedPartitionResolver
- /// to be called which is not what is desired when this object is destroyed. Normally this
- /// managed object may be created by the user and will be handled automatically by the GC.
- /// </summary>
- gcroot<GemStone::GemFire::Cache::Generic::IFixedPartitionResolverProxy^> m_managedptr;
-
- gcroot<Object^> m_userptr;
- };
-
-}
+namespace apache {
+ namespace geode {
+ namespace client {
+
+ /// <summary>
+ /// Wraps the managed <see cref="GemStone.GemFire.Cache.IFixedPartitionResolver" />
+ /// object and implements the native <c>apache::geode::client::FixedPartitionResolver</c> interface.
+ /// </summary>
+ class ManagedFixedPartitionResolverGeneric
+ : public FixedPartitionResolver
+ {
+ public:
+
+ /// <summary>
+ /// Constructor to initialize with the provided managed object.
+ /// </summary>
+ /// <param name="userptr">
+ /// The managed object.
+ /// </param>
+ inline ManagedFixedPartitionResolverGeneric(Object^ userptr) : m_userptr(userptr) { }
+
+ /// <summary>
+ /// Destructor -- does nothing.
+ /// </summary>
+ virtual ~ManagedFixedPartitionResolverGeneric() { }
+
+ /// <summary>
+ /// Static function to create a <c>ManagedFixedPartitionResolver</c> using given
+ /// managed assembly path and given factory function.
+ /// </summary>
+ /// <param name="assemblyPath">
+ /// The path of the managed assembly that contains the <c>IFixedPartitionResolver</c>
+ /// factory function.
+ /// </param>
+ /// <param name="factoryFunctionName">
+ /// The name of the factory function of the managed class for creating
+ /// an object that implements <c>IFixedPartitionResolver</c>.
+ /// This should be a static function of the format
+ /// {Namespace}.{Class Name}.{Method Name}.
+ /// </param>
+ /// <exception cref="IllegalArgumentException">
+ /// If the managed library cannot be loaded or the factory function fails.
+ /// </exception>
+ static PartitionResolver* create(const char* assemblyPath,
+ const char* factoryFunctionName);
+
+ /// <summary>
+ /// return object associated with entry event which allows the Partitioned Region to store associated data together.
+ /// </summary>
+ /// <remarks>
+ /// throws RuntimeException - any exception thrown will terminate the operation and the exception will be passed to the
+ /// calling thread.
+ /// </remarks>
+ /// <param name="key">
+ /// key the detail of the entry event.
+ /// </param>
+
+ virtual CacheableKeyPtr getRoutingObject(const EntryEvent& key);
+
+ /// <summary>
+ /// Returns the name of the FixedPartitionResolver.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// This function does not throw any exception.
+ /// </para>
+ /// <returns>
+ /// the name of the FixedPartitionResolver
+ /// </returns>
+ /// </remarks>
+ virtual const char* getName();
+
+
+ /// <summary>
+ /// This method is used to get the name of the partition for the given entry
+ /// operation.
+ /// <param name="opDetails">
+ /// the details of the entry event e.g. {@link Region#get(Object)}
+ /// </param>
+ /// <returns>
+ /// partition-name associated with node which allows mapping of given data to user defined partition.
+ /// </returns>
+ virtual const char* getPartitionName(const EntryEvent& opDetails);
+
+
+ /// <summary>
+ /// Returns the wrapped managed object reference.
+ /// </summary>
+ inline GemStone::GemFire::Cache::Generic::IFixedPartitionResolverProxy^ ptr() const
+ {
+ return m_managedptr;
+ }
+
+ inline void setptr(GemStone::GemFire::Cache::Generic::IFixedPartitionResolverProxy^ managedptr)
+ {
+ m_managedptr = managedptr;
+ }
+
+ inline Object^ userptr() const
+ {
+ return m_userptr;
+ }
+
+ private:
+
+ /// <summary>
+ /// Using gcroot to hold the managed delegate pointer (since it cannot be stored directly).
+ /// Note: not using auto_gcroot since it will result in 'Dispose' of the IFixedPartitionResolver
+ /// to be called which is not what is desired when this object is destroyed. Normally this
+ /// managed object may be created by the user and will be handled automatically by the GC.
+ /// </summary>
+ gcroot<GemStone::GemFire::Cache::Generic::IFixedPartitionResolverProxy^> m_managedptr;
+
+ gcroot<Object^> m_userptr;
+ };
+
+ } // namespace client
+ } // namespace geode
+} // namespace apache
http://git-wip-us.apache.org/repos/asf/geode/blob/e4fd74fb/src/clicache/src/impl/ManagedPartitionResolver.cpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/impl/ManagedPartitionResolver.cpp b/src/clicache/src/impl/ManagedPartitionResolver.cpp
index a849cbb..ff0da5c 100644
--- a/src/clicache/src/impl/ManagedPartitionResolver.cpp
+++ b/src/clicache/src/impl/ManagedPartitionResolver.cpp
@@ -32,214 +32,221 @@ using namespace System;
using namespace System::Text;
using namespace System::Reflection;
-namespace gemfire
+namespace apache
{
-
- PartitionResolver* ManagedPartitionResolverGeneric::create( const char* assemblyPath,
- const char* factoryFunctionName )
+ namespace geode
{
- try
+ namespace client
{
- String^ mg_assemblyPath =
- GemStone::GemFire::Cache::Generic::ManagedString::Get( assemblyPath );
- String^ mg_factoryFunctionName =
- GemStone::GemFire::Cache::Generic::ManagedString::Get( factoryFunctionName );
- String^ mg_typeName = nullptr;
-
- String^ mg_genericKey = nullptr;
- String^ mg_genericVal = nullptr;
-
- int32_t dotIndx = -1;
- int32_t genericsOpenIndx = -1;
- int32_t genericsCloseIndx = -1;
- int32_t commaIndx = -1;
-
- if (mg_factoryFunctionName == nullptr ||
- ( dotIndx = mg_factoryFunctionName->LastIndexOf( '.' ) ) < 0 )
- {
- std::string ex_str = "ManagedPartitionResolverGeneric: Factory function name '";
- ex_str += factoryFunctionName;
- ex_str += "' does not contain type name";
- throw IllegalArgumentException( ex_str.c_str( ) );
- }
-
- if ((genericsCloseIndx = mg_factoryFunctionName->LastIndexOf( '>' )) < 0 )
- {
- std::string ex_str = "ManagedPartitionResolverGeneric: Factory function name '";
- ex_str += factoryFunctionName;
- ex_str += "' does not contain any generic type parameters";
- throw gemfire::IllegalArgumentException( ex_str.c_str( ) );
- }
-
- if ((genericsOpenIndx = mg_factoryFunctionName->LastIndexOf( '<' )) < 0 ||
- genericsOpenIndx > genericsCloseIndx)
- {
- std::string ex_str = "ManagedPartitionResolverGeneric: Factory function name '";
- ex_str += factoryFunctionName;
- ex_str += "' does not contain expected generic type parameters";
- throw gemfire::IllegalArgumentException( ex_str.c_str( ) );
- }
- if ((commaIndx = mg_factoryFunctionName->LastIndexOf( ',' )) < 0 ||
- (commaIndx < genericsOpenIndx || commaIndx > genericsCloseIndx))
+ PartitionResolver* ManagedPartitionResolverGeneric::create(const char* assemblyPath,
+ const char* factoryFunctionName)
{
- std::string ex_str = "ManagedPartitionResolverGeneric: Factory function name '";
- ex_str += factoryFunctionName;
- ex_str += "' does not contain expected generic type parameter comma separator";
- throw gemfire::IllegalArgumentException( ex_str.c_str( ) );
- }
-
- StringBuilder^ typeBuilder = gcnew StringBuilder(mg_factoryFunctionName->Substring(0, genericsOpenIndx));
- mg_typeName = typeBuilder->ToString();
- mg_genericKey = mg_factoryFunctionName->Substring(genericsOpenIndx + 1, commaIndx - genericsOpenIndx - 1);
- mg_genericKey = mg_genericKey->Trim();
- mg_genericVal = mg_factoryFunctionName->Substring(commaIndx + 1, genericsCloseIndx - commaIndx - 1);
- mg_genericVal = mg_genericVal->Trim();
- mg_factoryFunctionName = mg_factoryFunctionName->Substring( dotIndx + 1 );
-
- GemStone::GemFire::Cache::Generic::Log::Fine(
- "Attempting to instantiate a [{0}<{1}, {2}>] via the [{3}] factory method.",
- mg_typeName, mg_genericKey, mg_genericVal, mg_factoryFunctionName);
-
- typeBuilder->Append("`2");
- mg_typeName = typeBuilder->ToString();
+ try
+ {
+ String^ mg_assemblyPath =
+ GemStone::GemFire::Cache::Generic::ManagedString::Get(assemblyPath);
+ String^ mg_factoryFunctionName =
+ GemStone::GemFire::Cache::Generic::ManagedString::Get(factoryFunctionName);
+ String^ mg_typeName = nullptr;
+
+ String^ mg_genericKey = nullptr;
+ String^ mg_genericVal = nullptr;
+
+ int32_t dotIndx = -1;
+ int32_t genericsOpenIndx = -1;
+ int32_t genericsCloseIndx = -1;
+ int32_t commaIndx = -1;
+
+ if (mg_factoryFunctionName == nullptr ||
+ (dotIndx = mg_factoryFunctionName->LastIndexOf('.')) < 0)
+ {
+ std::string ex_str = "ManagedPartitionResolverGeneric: Factory function name '";
+ ex_str += factoryFunctionName;
+ ex_str += "' does not contain type name";
+ throw IllegalArgumentException(ex_str.c_str());
+ }
- Assembly^ assmb = nullptr;
- try
- {
- assmb = Assembly::Load( mg_assemblyPath );
- }
- catch (System::Exception^)
- {
- assmb = nullptr;
- }
- if (assmb == nullptr)
- {
- std::string ex_str = "ManagedPartitionResolverGeneric: Could not load assembly: ";
- ex_str += assemblyPath;
- throw IllegalArgumentException( ex_str.c_str( ) );
- }
-
- GemStone::GemFire::Cache::Generic::Log::Debug("Loading type: [{0}]", mg_typeName);
+ if ((genericsCloseIndx = mg_factoryFunctionName->LastIndexOf('>')) < 0)
+ {
+ std::string ex_str = "ManagedPartitionResolverGeneric: Factory function name '";
+ ex_str += factoryFunctionName;
+ ex_str += "' does not contain any generic type parameters";
+ throw apache::geode::client::IllegalArgumentException(ex_str.c_str());
+ }
- Type^ typeInst = assmb->GetType(mg_typeName, false, true);
+ if ((genericsOpenIndx = mg_factoryFunctionName->LastIndexOf('<')) < 0 ||
+ genericsOpenIndx > genericsCloseIndx)
+ {
+ std::string ex_str = "ManagedPartitionResolverGeneric: Factory function name '";
+ ex_str += factoryFunctionName;
+ ex_str += "' does not contain expected generic type parameters";
+ throw apache::geode::client::IllegalArgumentException(ex_str.c_str());
+ }
- if (typeInst != nullptr)
- {
- array<Type^>^ types = gcnew array<Type^>(2);
- types[0] = Type::GetType(mg_genericKey, false, true);
- types[1] = Type::GetType(mg_genericVal, false, true);
+ if ((commaIndx = mg_factoryFunctionName->LastIndexOf(',')) < 0 ||
+ (commaIndx < genericsOpenIndx || commaIndx > genericsCloseIndx))
+ {
+ std::string ex_str = "ManagedPartitionResolverGeneric: Factory function name '";
+ ex_str += factoryFunctionName;
+ ex_str += "' does not contain expected generic type parameter comma separator";
+ throw apache::geode::client::IllegalArgumentException(ex_str.c_str());
+ }
- if (types[0] == nullptr || types[1] == nullptr)
- {
- std::string ex_str = "ManagedPartitionResolverGeneric: Could not get both generic type argument instances";
- throw gemfire::IllegalArgumentException( ex_str.c_str( ) );
- }
+ StringBuilder^ typeBuilder = gcnew StringBuilder(mg_factoryFunctionName->Substring(0, genericsOpenIndx));
+ mg_typeName = typeBuilder->ToString();
+ mg_genericKey = mg_factoryFunctionName->Substring(genericsOpenIndx + 1, commaIndx - genericsOpenIndx - 1);
+ mg_genericKey = mg_genericKey->Trim();
+ mg_genericVal = mg_factoryFunctionName->Substring(commaIndx + 1, genericsCloseIndx - commaIndx - 1);
+ mg_genericVal = mg_genericVal->Trim();
+ mg_factoryFunctionName = mg_factoryFunctionName->Substring(dotIndx + 1);
- typeInst = typeInst->MakeGenericType(types);
- GemStone::GemFire::Cache::Generic::Log::Info("Loading function: [{0}]", mg_factoryFunctionName);
+ GemStone::GemFire::Cache::Generic::Log::Fine(
+ "Attempting to instantiate a [{0}<{1}, {2}>] via the [{3}] factory method.",
+ mg_typeName, mg_genericKey, mg_genericVal, mg_factoryFunctionName);
- MethodInfo^ mInfo = typeInst->GetMethod( mg_factoryFunctionName,
- BindingFlags::Public | BindingFlags::Static | BindingFlags::IgnoreCase );
+ typeBuilder->Append("`2");
+ mg_typeName = typeBuilder->ToString();
- if (mInfo != nullptr)
- {
- Object^ managedptr = nullptr;
+ Assembly^ assmb = nullptr;
try
{
- managedptr = mInfo->Invoke( typeInst, nullptr );
+ assmb = Assembly::Load(mg_assemblyPath);
}
- catch (System::Exception^ ex)
+ catch (System::Exception^)
{
- GemStone::GemFire::Cache::Generic::Log::Debug("{0}: {1}", ex->GetType()->Name, ex->Message);
- managedptr = nullptr;
+ assmb = nullptr;
}
- if (managedptr == nullptr)
+ if (assmb == nullptr)
{
- std::string ex_str = "ManagedPartitionResolverGeneric: Could not create "
- "object on invoking factory function [";
- ex_str += factoryFunctionName;
- ex_str += "] in assembly: ";
+ std::string ex_str = "ManagedPartitionResolverGeneric: Could not load assembly: ";
ex_str += assemblyPath;
- throw IllegalArgumentException( ex_str.c_str( ) );
+ throw IllegalArgumentException(ex_str.c_str());
}
- ManagedPartitionResolverGeneric * mgpr = new ManagedPartitionResolverGeneric(managedptr);
-
- Type^ prgType = Type::GetType("GemStone.GemFire.Cache.Generic.PartitionResolverGeneric`2");
- prgType = prgType->MakeGenericType(types);
- Object^ prg = Activator::CreateInstance(prgType);
-
- mInfo = prgType->GetMethod("SetPartitionResolver");
- array<Object^>^ params = gcnew array<Object^>(1);
- params[0] = managedptr;
- mInfo->Invoke(prg, params);
+ GemStone::GemFire::Cache::Generic::Log::Debug("Loading type: [{0}]", mg_typeName);
- mgpr->setptr((GemStone::GemFire::Cache::Generic::IPartitionResolverProxy^)prg);
+ Type^ typeInst = assmb->GetType(mg_typeName, false, true);
- return mgpr;
+ if (typeInst != nullptr)
+ {
+ array<Type^>^ types = gcnew array<Type^>(2);
+ types[0] = Type::GetType(mg_genericKey, false, true);
+ types[1] = Type::GetType(mg_genericVal, false, true);
+
+ if (types[0] == nullptr || types[1] == nullptr)
+ {
+ std::string ex_str = "ManagedPartitionResolverGeneric: Could not get both generic type argument instances";
+ throw apache::geode::client::IllegalArgumentException(ex_str.c_str());
+ }
+
+ typeInst = typeInst->MakeGenericType(types);
+ GemStone::GemFire::Cache::Generic::Log::Info("Loading function: [{0}]", mg_factoryFunctionName);
+
+ MethodInfo^ mInfo = typeInst->GetMethod(mg_factoryFunctionName,
+ BindingFlags::Public | BindingFlags::Static | BindingFlags::IgnoreCase);
+
+ if (mInfo != nullptr)
+ {
+ Object^ managedptr = nullptr;
+ try
+ {
+ managedptr = mInfo->Invoke(typeInst, nullptr);
+ }
+ catch (System::Exception^ ex)
+ {
+ GemStone::GemFire::Cache::Generic::Log::Debug("{0}: {1}", ex->GetType()->Name, ex->Message);
+ managedptr = nullptr;
+ }
+ if (managedptr == nullptr)
+ {
+ std::string ex_str = "ManagedPartitionResolverGeneric: Could not create "
+ "object on invoking factory function [";
+ ex_str += factoryFunctionName;
+ ex_str += "] in assembly: ";
+ ex_str += assemblyPath;
+ throw IllegalArgumentException(ex_str.c_str());
+ }
+
+ ManagedPartitionResolverGeneric * mgpr = new ManagedPartitionResolverGeneric(managedptr);
+
+ Type^ prgType = Type::GetType("GemStone.GemFire.Cache.Generic.PartitionResolverGeneric`2");
+ prgType = prgType->MakeGenericType(types);
+ Object^ prg = Activator::CreateInstance(prgType);
+
+ mInfo = prgType->GetMethod("SetPartitionResolver");
+ array<Object^>^ params = gcnew array<Object^>(1);
+ params[0] = managedptr;
+ mInfo->Invoke(prg, params);
+
+ mgpr->setptr((GemStone::GemFire::Cache::Generic::IPartitionResolverProxy^)prg);
+
+ return mgpr;
+ }
+ else
+ {
+ std::string ex_str = "ManagedPartitionResolverGeneric: Could not load "
+ "function with name [";
+ ex_str += factoryFunctionName;
+ ex_str += "] in assembly: ";
+ ex_str += assemblyPath;
+ throw IllegalArgumentException(ex_str.c_str());
+ }
+ }
+ else
+ {
+ GemStone::GemFire::Cache::Generic::ManagedString typeName(mg_typeName);
+ std::string ex_str = "ManagedPartitionResolverGeneric: Could not load type [";
+ ex_str += typeName.CharPtr;
+ ex_str += "] in assembly: ";
+ ex_str += assemblyPath;
+ throw IllegalArgumentException(ex_str.c_str());
+ }
+ }
+ catch (const apache::geode::client::Exception&)
+ {
+ throw;
}
- else
+ catch (System::Exception^ ex)
{
- std::string ex_str = "ManagedPartitionResolverGeneric: Could not load "
- "function with name [";
- ex_str += factoryFunctionName;
- ex_str += "] in assembly: ";
- ex_str += assemblyPath;
- throw IllegalArgumentException( ex_str.c_str( ) );
+ GemStone::GemFire::Cache::Generic::ManagedString mg_exStr(ex->ToString());
+ std::string ex_str = "ManagedPartitionResolverGeneric: Got an exception while "
+ "loading managed library: ";
+ ex_str += mg_exStr.CharPtr;
+ throw IllegalArgumentException(ex_str.c_str());
}
+ return NULL;
}
- else
+
+ CacheableKeyPtr ManagedPartitionResolverGeneric::getRoutingObject(const EntryEvent& key)
{
- GemStone::GemFire::Cache::Generic::ManagedString typeName( mg_typeName );
- std::string ex_str = "ManagedPartitionResolverGeneric: Could not load type [";
- ex_str += typeName.CharPtr;
- ex_str += "] in assembly: ";
- ex_str += assemblyPath;
- throw IllegalArgumentException( ex_str.c_str( ) );
+ try {
+ return m_managedptr->getRoutingObject(key);
+ }
+ catch (GemStone::GemFire::Cache::Generic::GemFireException^ ex) {
+ ex->ThrowNative();
+ }
+ catch (System::Exception^ ex) {
+ GemStone::GemFire::Cache::Generic::GemFireException::ThrowNative(ex);
+ }
+ return NULLPTR;
}
- }
- catch (const gemfire::Exception&)
- {
- throw;
- }
- catch (System::Exception^ ex)
- {
- GemStone::GemFire::Cache::Generic::ManagedString mg_exStr( ex->ToString( ) );
- std::string ex_str = "ManagedPartitionResolverGeneric: Got an exception while "
- "loading managed library: ";
- ex_str += mg_exStr.CharPtr;
- throw IllegalArgumentException( ex_str.c_str( ) );
- }
- return NULL;
- }
-
- CacheableKeyPtr ManagedPartitionResolverGeneric::getRoutingObject(const EntryEvent& key)
- {
- try {
- return m_managedptr->getRoutingObject(key);
- }
- catch (GemStone::GemFire::Cache::Generic::GemFireException^ ex) {
- ex->ThrowNative();
- }
- catch (System::Exception^ ex) {
- GemStone::GemFire::Cache::Generic::GemFireException::ThrowNative(ex);
- }
- return NULLPTR;
- }
-
- const char* ManagedPartitionResolverGeneric::getName()
- {
- try {
- return m_managedptr->getName();
- }
- catch (GemStone::GemFire::Cache::Generic::GemFireException^ ex) {
- ex->ThrowNative();
- }
- catch (System::Exception^ ex) {
- GemStone::GemFire::Cache::Generic::GemFireException::ThrowNative(ex);
- }
- return NULL;
- }
-
-}
+
+ const char* ManagedPartitionResolverGeneric::getName()
+ {
+ try {
+ return m_managedptr->getName();
+ }
+ catch (GemStone::GemFire::Cache::Generic::GemFireException^ ex) {
+ ex->ThrowNative();
+ }
+ catch (System::Exception^ ex) {
+ GemStone::GemFire::Cache::Generic::GemFireException::ThrowNative(ex);
+ }
+ return NULL;
+ }
+
+ } // namespace client
+ } // namespace geode
+} // namespace apache
+
http://git-wip-us.apache.org/repos/asf/geode/blob/e4fd74fb/src/clicache/src/impl/ManagedPartitionResolver.hpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/impl/ManagedPartitionResolver.hpp b/src/clicache/src/impl/ManagedPartitionResolver.hpp
index df0f240..3aefccb 100644
--- a/src/clicache/src/impl/ManagedPartitionResolver.hpp
+++ b/src/clicache/src/impl/ManagedPartitionResolver.hpp
@@ -25,106 +25,110 @@
using namespace System;
-namespace gemfire {
-
- /// <summary>
- /// Wraps the managed <see cref="GemStone.GemFire.Cache.IPartitionResolver" />
- /// object and implements the native <c>gemfire::PartitionResolver</c> interface.
- /// </summary>
- class ManagedPartitionResolverGeneric
- : public PartitionResolver
- {
- public:
-
- /// <summary>
- /// Constructor to initialize with the provided managed object.
- /// </summary>
- /// <param name="userptr">
- /// The managed object.
- /// </param>
- inline ManagedPartitionResolverGeneric( Object^ userptr ) : m_userptr( userptr ) { }
-
- /// <summary>
- /// Static function to create a <c>ManagedPartitionResolver</c> using given
- /// managed assembly path and given factory function.
- /// </summary>
- /// <param name="assemblyPath">
- /// The path of the managed assembly that contains the <c>IPartitionResolver</c>
- /// factory function.
- /// </param>
- /// <param name="factoryFunctionName">
- /// The name of the factory function of the managed class for creating
- /// an object that implements <c>IPartitionResolver</c>.
- /// This should be a static function of the format
- /// {Namespace}.{Class Name}.{Method Name}.
- /// </param>
- /// <exception cref="IllegalArgumentException">
- /// If the managed library cannot be loaded or the factory function fails.
- /// </exception>
- static PartitionResolver* create( const char* assemblyPath,
- const char* factoryFunctionName );
-
- /// <summary>
- /// Destructor -- does nothing.
- /// </summary>
- virtual ~ManagedPartitionResolverGeneric( ) { }
-
- /// <summary>
- /// return object associated with entry event which allows the Partitioned Region to store associated data together.
- /// </summary>
- /// <remarks>
- /// throws RuntimeException - any exception thrown will terminate the operation and the exception will be passed to the
- /// calling thread.
- /// </remarks>
- /// <param name="key">
- /// key the detail of the entry event.
- /// </param>
-
- virtual CacheableKeyPtr getRoutingObject(const EntryEvent& key);
-
- /// <summary>
- /// Returns the name of the PartitionResolver.
- /// </summary>
- /// <remarks>
- /// <para>
- /// This function does not throw any exception.
- /// </para>
- /// <returns>
- /// the name of the PartitionResolver
- /// </returns>
- /// </remarks>
- virtual const char* getName();
-
-
- /// <summary>
- /// Returns the wrapped managed object reference.
- /// </summary>
- inline GemStone::GemFire::Cache::Generic::IPartitionResolverProxy^ ptr() const
- {
- return m_managedptr;
- }
-
- inline void setptr(GemStone::GemFire::Cache::Generic::IPartitionResolverProxy^ managedptr)
- {
- m_managedptr = managedptr;
- }
-
- inline Object^ userptr( ) const
- {
- return m_userptr;
- }
-
- private:
-
- /// <summary>
- /// Using gcroot to hold the managed delegate pointer (since it cannot be stored directly).
- /// Note: not using auto_gcroot since it will result in 'Dispose' of the IPartitionResolver
- /// to be called which is not what is desired when this object is destroyed. Normally this
- /// managed object may be created by the user and will be handled automatically by the GC.
- /// </summary>
- gcroot<GemStone::GemFire::Cache::Generic::IPartitionResolverProxy^> m_managedptr;
-
- gcroot<Object^> m_userptr;
- };
-
-}
+namespace apache {
+ namespace geode {
+ namespace client {
+
+ /// <summary>
+ /// Wraps the managed <see cref="GemStone.GemFire.Cache.IPartitionResolver" />
+ /// object and implements the native <c>apache::geode::client::PartitionResolver</c> interface.
+ /// </summary>
+ class ManagedPartitionResolverGeneric
+ : public PartitionResolver
+ {
+ public:
+
+ /// <summary>
+ /// Constructor to initialize with the provided managed object.
+ /// </summary>
+ /// <param name="userptr">
+ /// The managed object.
+ /// </param>
+ inline ManagedPartitionResolverGeneric(Object^ userptr) : m_userptr(userptr) { }
+
+ /// <summary>
+ /// Static function to create a <c>ManagedPartitionResolver</c> using given
+ /// managed assembly path and given factory function.
+ /// </summary>
+ /// <param name="assemblyPath">
+ /// The path of the managed assembly that contains the <c>IPartitionResolver</c>
+ /// factory function.
+ /// </param>
+ /// <param name="factoryFunctionName">
+ /// The name of the factory function of the managed class for creating
+ /// an object that implements <c>IPartitionResolver</c>.
+ /// This should be a static function of the format
+ /// {Namespace}.{Class Name}.{Method Name}.
+ /// </param>
+ /// <exception cref="IllegalArgumentException">
+ /// If the managed library cannot be loaded or the factory function fails.
+ /// </exception>
+ static PartitionResolver* create(const char* assemblyPath,
+ const char* factoryFunctionName);
+
+ /// <summary>
+ /// Destructor -- does nothing.
+ /// </summary>
+ virtual ~ManagedPartitionResolverGeneric() { }
+
+ /// <summary>
+ /// return object associated with entry event which allows the Partitioned Region to store associated data together.
+ /// </summary>
+ /// <remarks>
+ /// throws RuntimeException - any exception thrown will terminate the operation and the exception will be passed to the
+ /// calling thread.
+ /// </remarks>
+ /// <param name="key">
+ /// key the detail of the entry event.
+ /// </param>
+
+ virtual CacheableKeyPtr getRoutingObject(const EntryEvent& key);
+
+ /// <summary>
+ /// Returns the name of the PartitionResolver.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// This function does not throw any exception.
+ /// </para>
+ /// <returns>
+ /// the name of the PartitionResolver
+ /// </returns>
+ /// </remarks>
+ virtual const char* getName();
+
+
+ /// <summary>
+ /// Returns the wrapped managed object reference.
+ /// </summary>
+ inline GemStone::GemFire::Cache::Generic::IPartitionResolverProxy^ ptr() const
+ {
+ return m_managedptr;
+ }
+
+ inline void setptr(GemStone::GemFire::Cache::Generic::IPartitionResolverProxy^ managedptr)
+ {
+ m_managedptr = managedptr;
+ }
+
+ inline Object^ userptr() const
+ {
+ return m_userptr;
+ }
+
+ private:
+
+ /// <summary>
+ /// Using gcroot to hold the managed delegate pointer (since it cannot be stored directly).
+ /// Note: not using auto_gcroot since it will result in 'Dispose' of the IPartitionResolver
+ /// to be called which is not what is desired when this object is destroyed. Normally this
+ /// managed object may be created by the user and will be handled automatically by the GC.
+ /// </summary>
+ gcroot<GemStone::GemFire::Cache::Generic::IPartitionResolverProxy^> m_managedptr;
+
+ gcroot<Object^> m_userptr;
+ };
+
+ } // namespace client
+ } // namespace geode
+} // namespace apache
http://git-wip-us.apache.org/repos/asf/geode/blob/e4fd74fb/src/clicache/src/impl/ManagedPersistenceManager.cpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/impl/ManagedPersistenceManager.cpp b/src/clicache/src/impl/ManagedPersistenceManager.cpp
index 6a06d3f..22e6caf 100644
--- a/src/clicache/src/impl/ManagedPersistenceManager.cpp
+++ b/src/clicache/src/impl/ManagedPersistenceManager.cpp
@@ -25,217 +25,223 @@ using namespace System;
using namespace System::Text;
using namespace System::Reflection;
-namespace gemfire
+namespace apache
{
-
- gemfire::PersistenceManager* ManagedPersistenceManagerGeneric::create( const char* assemblyPath,
- const char* factoryFunctionName )
+ namespace geode
{
- try
+ namespace client
{
- String^ mg_assemblyPath = GemStone::GemFire::Cache::Generic::ManagedString::Get( assemblyPath );
- String^ mg_factoryFunctionName = GemStone::GemFire::Cache::Generic::ManagedString::Get( factoryFunctionName );
- String^ mg_typeName = nullptr;
-
- String^ mg_genericKey = nullptr;
- String^ mg_genericVal = nullptr;
-
- int32_t dotIndx = -1;
- int32_t genericsOpenIndx = -1;
- int32_t genericsCloseIndx = -1;
- int32_t commaIndx = -1;
-
- if (mg_factoryFunctionName == nullptr ||
- ( dotIndx = mg_factoryFunctionName->LastIndexOf( '.' ) ) < 0 )
- {
- std::string ex_str = "ManagedPersistenceManagerGeneric: Factory function name '";
- ex_str += factoryFunctionName;
- ex_str += "' does not contain type name";
- throw IllegalArgumentException( ex_str.c_str( ) );
- }
- if ((genericsCloseIndx = mg_factoryFunctionName->LastIndexOf( '>' )) < 0 )
+ apache::geode::client::PersistenceManager* ManagedPersistenceManagerGeneric::create(const char* assemblyPath,
+ const char* factoryFunctionName)
{
- std::string ex_str = "ManagedPersistenceManagerGeneric: Factory function name '";
- ex_str += factoryFunctionName;
- ex_str += "' does not contain any generic type parameters";
- throw gemfire::IllegalArgumentException( ex_str.c_str( ) );
- }
-
- if ((genericsOpenIndx = mg_factoryFunctionName->LastIndexOf( '<' )) < 0 ||
- genericsOpenIndx > genericsCloseIndx)
- {
- std::string ex_str = "ManagedPersistenceManagerGeneric: Factory function name '";
- ex_str += factoryFunctionName;
- ex_str += "' does not contain expected generic type parameters";
- throw gemfire::IllegalArgumentException( ex_str.c_str( ) );
- }
-
- if ((commaIndx = mg_factoryFunctionName->LastIndexOf( ',' )) < 0 ||
- (commaIndx < genericsOpenIndx || commaIndx > genericsCloseIndx))
- {
- std::string ex_str = "ManagedPersistenceManagerGeneric: Factory function name '";
- ex_str += factoryFunctionName;
- ex_str += "' does not contain expected generic type parameter comma separator";
- throw gemfire::IllegalArgumentException( ex_str.c_str( ) );
- }
-
- StringBuilder^ typeBuilder = gcnew StringBuilder(mg_factoryFunctionName->Substring(0, genericsOpenIndx));
- mg_typeName = typeBuilder->ToString();
- mg_genericKey = mg_factoryFunctionName->Substring(genericsOpenIndx + 1, commaIndx - genericsOpenIndx - 1);
- mg_genericKey = mg_genericKey->Trim();
- mg_genericVal = mg_factoryFunctionName->Substring(commaIndx + 1, genericsCloseIndx - commaIndx - 1);
- mg_genericVal = mg_genericVal->Trim();
- mg_factoryFunctionName = mg_factoryFunctionName->Substring( dotIndx + 1 );
+ try
+ {
+ String^ mg_assemblyPath = GemStone::GemFire::Cache::Generic::ManagedString::Get(assemblyPath);
+ String^ mg_factoryFunctionName = GemStone::GemFire::Cache::Generic::ManagedString::Get(factoryFunctionName);
+ String^ mg_typeName = nullptr;
- GemStone::GemFire::Cache::Generic::Log::Fine("Attempting to instantiate a [{0}<{1}, {2}>] via the [{3}] factory method.",
- mg_typeName, mg_genericKey, mg_genericVal, mg_factoryFunctionName);
+ String^ mg_genericKey = nullptr;
+ String^ mg_genericVal = nullptr;
- typeBuilder->Append("`2");
- mg_typeName = typeBuilder->ToString();
+ int32_t dotIndx = -1;
+ int32_t genericsOpenIndx = -1;
+ int32_t genericsCloseIndx = -1;
+ int32_t commaIndx = -1;
- Assembly^ assmb = nullptr;
- try
- {
- assmb = Assembly::Load( mg_assemblyPath );
- }
- catch (System::Exception^)
- {
- assmb = nullptr;
- }
- if (assmb == nullptr)
- {
- std::string ex_str = "ManagedPersistenceManagerGeneric: Could not load assembly: ";
- ex_str += assemblyPath;
- throw IllegalArgumentException( ex_str.c_str( ) );
- }
+ if (mg_factoryFunctionName == nullptr ||
+ (dotIndx = mg_factoryFunctionName->LastIndexOf('.')) < 0)
+ {
+ std::string ex_str = "ManagedPersistenceManagerGeneric: Factory function name '";
+ ex_str += factoryFunctionName;
+ ex_str += "' does not contain type name";
+ throw IllegalArgumentException(ex_str.c_str());
+ }
- GemStone::GemFire::Cache::Generic::Log::Debug("Loading type: [{0}]", mg_typeName);
+ if ((genericsCloseIndx = mg_factoryFunctionName->LastIndexOf('>')) < 0)
+ {
+ std::string ex_str = "ManagedPersistenceManagerGeneric: Factory function name '";
+ ex_str += factoryFunctionName;
+ ex_str += "' does not contain any generic type parameters";
+ throw apache::geode::client::IllegalArgumentException(ex_str.c_str());
+ }
- Type^ typeInst = assmb->GetType(mg_typeName, false, true);
+ if ((genericsOpenIndx = mg_factoryFunctionName->LastIndexOf('<')) < 0 ||
+ genericsOpenIndx > genericsCloseIndx)
+ {
+ std::string ex_str = "ManagedPersistenceManagerGeneric: Factory function name '";
+ ex_str += factoryFunctionName;
+ ex_str += "' does not contain expected generic type parameters";
+ throw apache::geode::client::IllegalArgumentException(ex_str.c_str());
+ }
- if (typeInst != nullptr)
- {
- array<Type^>^ types = gcnew array<Type^>(2);
- types[0] = Type::GetType(mg_genericKey, false, true);
- types[1] = Type::GetType(mg_genericVal, false, true);
+ if ((commaIndx = mg_factoryFunctionName->LastIndexOf(',')) < 0 ||
+ (commaIndx < genericsOpenIndx || commaIndx > genericsCloseIndx))
+ {
+ std::string ex_str = "ManagedPersistenceManagerGeneric: Factory function name '";
+ ex_str += factoryFunctionName;
+ ex_str += "' does not contain expected generic type parameter comma separator";
+ throw apache::geode::client::IllegalArgumentException(ex_str.c_str());
+ }
- if (types[0] == nullptr || types[1] == nullptr)
- {
- std::string ex_str = "ManagedPersistenceManagerGeneric: Could not get both generic type argument instances";
- throw gemfire::IllegalArgumentException( ex_str.c_str( ) );
- }
+ StringBuilder^ typeBuilder = gcnew StringBuilder(mg_factoryFunctionName->Substring(0, genericsOpenIndx));
+ mg_typeName = typeBuilder->ToString();
+ mg_genericKey = mg_factoryFunctionName->Substring(genericsOpenIndx + 1, commaIndx - genericsOpenIndx - 1);
+ mg_genericKey = mg_genericKey->Trim();
+ mg_genericVal = mg_factoryFunctionName->Substring(commaIndx + 1, genericsCloseIndx - commaIndx - 1);
+ mg_genericVal = mg_genericVal->Trim();
+ mg_factoryFunctionName = mg_factoryFunctionName->Substring(dotIndx + 1);
- typeInst = typeInst->MakeGenericType(types);
- GemStone::GemFire::Cache::Generic::Log::Info("Loading function: [{0}]", mg_factoryFunctionName);
+ GemStone::GemFire::Cache::Generic::Log::Fine("Attempting to instantiate a [{0}<{1}, {2}>] via the [{3}] factory method.",
+ mg_typeName, mg_genericKey, mg_genericVal, mg_factoryFunctionName);
- MethodInfo^ mInfo = typeInst->GetMethod( mg_factoryFunctionName,
- BindingFlags::Public | BindingFlags::Static | BindingFlags::IgnoreCase );
+ typeBuilder->Append("`2");
+ mg_typeName = typeBuilder->ToString();
- if (mInfo != nullptr)
- {
- Object^ managedptr = nullptr;
+ Assembly^ assmb = nullptr;
try
{
- managedptr = mInfo->Invoke(typeInst, nullptr);
+ assmb = Assembly::Load(mg_assemblyPath);
}
- catch (System::Exception^ ex)
+ catch (System::Exception^)
{
- GemStone::GemFire::Cache::Generic::Log::Debug("{0}: {1}", ex->GetType()->Name, ex->Message);
- managedptr = nullptr;
+ assmb = nullptr;
}
- if (managedptr == nullptr)
+ if (assmb == nullptr)
{
- std::string ex_str = "ManagedPersistenceManagerGeneric: Could not create "
- "object on invoking factory function [";
- ex_str += factoryFunctionName;
- ex_str += "] in assembly: ";
+ std::string ex_str = "ManagedPersistenceManagerGeneric: Could not load assembly: ";
ex_str += assemblyPath;
- throw IllegalArgumentException( ex_str.c_str( ) );
+ throw IllegalArgumentException(ex_str.c_str());
}
- ManagedPersistenceManagerGeneric* mgcl = new ManagedPersistenceManagerGeneric(managedptr);
-
- Type^ clgType = Type::GetType("GemStone.GemFire.Cache.Generic.PersistenceManagerGeneric`2");
- clgType = clgType->MakeGenericType(types);
- Object^ clg = Activator::CreateInstance(clgType);
+ GemStone::GemFire::Cache::Generic::Log::Debug("Loading type: [{0}]", mg_typeName);
- mInfo = clgType->GetMethod("SetPersistenceManager");
- array<Object^>^ params = gcnew array<Object^>(1);
- params[0] = managedptr;
- mInfo->Invoke(clg, params);
+ Type^ typeInst = assmb->GetType(mg_typeName, false, true);
- mgcl->setptr((GemStone::GemFire::Cache::Generic::IPersistenceManagerProxy^)clg);
-
- return mgcl;
+ if (typeInst != nullptr)
+ {
+ array<Type^>^ types = gcnew array<Type^>(2);
+ types[0] = Type::GetType(mg_genericKey, false, true);
+ types[1] = Type::GetType(mg_genericVal, false, true);
+
+ if (types[0] == nullptr || types[1] == nullptr)
+ {
+ std::string ex_str = "ManagedPersistenceManagerGeneric: Could not get both generic type argument instances";
+ throw apache::geode::client::IllegalArgumentException(ex_str.c_str());
+ }
+
+ typeInst = typeInst->MakeGenericType(types);
+ GemStone::GemFire::Cache::Generic::Log::Info("Loading function: [{0}]", mg_factoryFunctionName);
+
+ MethodInfo^ mInfo = typeInst->GetMethod(mg_factoryFunctionName,
+ BindingFlags::Public | BindingFlags::Static | BindingFlags::IgnoreCase);
+
+ if (mInfo != nullptr)
+ {
+ Object^ managedptr = nullptr;
+ try
+ {
+ managedptr = mInfo->Invoke(typeInst, nullptr);
+ }
+ catch (System::Exception^ ex)
+ {
+ GemStone::GemFire::Cache::Generic::Log::Debug("{0}: {1}", ex->GetType()->Name, ex->Message);
+ managedptr = nullptr;
+ }
+ if (managedptr == nullptr)
+ {
+ std::string ex_str = "ManagedPersistenceManagerGeneric: Could not create "
+ "object on invoking factory function [";
+ ex_str += factoryFunctionName;
+ ex_str += "] in assembly: ";
+ ex_str += assemblyPath;
+ throw IllegalArgumentException(ex_str.c_str());
+ }
+
+ ManagedPersistenceManagerGeneric* mgcl = new ManagedPersistenceManagerGeneric(managedptr);
+
+ Type^ clgType = Type::GetType("GemStone.GemFire.Cache.Generic.PersistenceManagerGeneric`2");
+ clgType = clgType->MakeGenericType(types);
+ Object^ clg = Activator::CreateInstance(clgType);
+
+ mInfo = clgType->GetMethod("SetPersistenceManager");
+ array<Object^>^ params = gcnew array<Object^>(1);
+ params[0] = managedptr;
+ mInfo->Invoke(clg, params);
+
+ mgcl->setptr((GemStone::GemFire::Cache::Generic::IPersistenceManagerProxy^)clg);
+
+ return mgcl;
+ }
+ else
+ {
+ std::string ex_str = "ManagedPersistenceManagerGeneric: Could not load "
+ "function with name [";
+ ex_str += factoryFunctionName;
+ ex_str += "] in assembly: ";
+ ex_str += assemblyPath;
+ throw IllegalArgumentException(ex_str.c_str());
+ }
+ }
+ else
+ {
+ GemStone::GemFire::Cache::Generic::ManagedString typeName(mg_typeName);
+ std::string ex_str = "ManagedPersistenceManagerGeneric: Could not load type [";
+ ex_str += typeName.CharPtr;
+ ex_str += "] in assembly: ";
+ ex_str += assemblyPath;
+ throw IllegalArgumentException(ex_str.c_str());
+ }
}
- else
+ catch (const apache::geode::client::Exception&)
{
- std::string ex_str = "ManagedPersistenceManagerGeneric: Could not load "
- "function with name [";
- ex_str += factoryFunctionName;
- ex_str += "] in assembly: ";
- ex_str += assemblyPath;
- throw IllegalArgumentException( ex_str.c_str( ) );
+ throw;
}
+ catch (System::Exception^ ex)
+ {
+ GemStone::GemFire::Cache::Generic::ManagedString mg_exStr(ex->ToString());
+ std::string ex_str = "ManagedPersistenceManagerGeneric: Got an exception while "
+ "loading managed library: ";
+ ex_str += mg_exStr.CharPtr;
+ throw IllegalArgumentException(ex_str.c_str());
+ }
+ return NULL;
}
- else
+
+
+ void ManagedPersistenceManagerGeneric::write(const CacheableKeyPtr& key, const CacheablePtr& value, void *& PersistenceInfo)
{
- GemStone::GemFire::Cache::Generic::ManagedString typeName( mg_typeName );
- std::string ex_str = "ManagedPersistenceManagerGeneric: Could not load type [";
- ex_str += typeName.CharPtr;
- ex_str += "] in assembly: ";
- ex_str += assemblyPath;
- throw IllegalArgumentException( ex_str.c_str( ) );
+ m_managedptr->write(key, value);
}
- }
- catch (const gemfire::Exception&)
- {
- throw;
- }
- catch (System::Exception^ ex)
- {
- GemStone::GemFire::Cache::Generic::ManagedString mg_exStr(ex->ToString());
- std::string ex_str = "ManagedPersistenceManagerGeneric: Got an exception while "
- "loading managed library: ";
- ex_str += mg_exStr.CharPtr;
- throw IllegalArgumentException( ex_str.c_str( ) );
- }
- return NULL;
- }
-
-
- void ManagedPersistenceManagerGeneric::write(const CacheableKeyPtr& key, const CacheablePtr& value, void *& PersistenceInfo)
- {
- m_managedptr->write(key,value);
- }
-
- bool ManagedPersistenceManagerGeneric::writeAll()
- {
- throw gcnew System::NotSupportedException;
- }
- void ManagedPersistenceManagerGeneric::init(const RegionPtr& region, PropertiesPtr& diskProperties)
- {
- m_managedptr->init(region, diskProperties);
- }
+ bool ManagedPersistenceManagerGeneric::writeAll()
+ {
+ throw gcnew System::NotSupportedException;
+ }
- CacheablePtr ManagedPersistenceManagerGeneric::read(const CacheableKeyPtr& key, void *& PersistenceInfo)
- {
- return m_managedptr->read(key);
- }
-
- bool ManagedPersistenceManagerGeneric::readAll()
- {
- throw gcnew System::NotSupportedException;
- }
+ void ManagedPersistenceManagerGeneric::init(const RegionPtr& region, PropertiesPtr& diskProperties)
+ {
+ m_managedptr->init(region, diskProperties);
+ }
- void ManagedPersistenceManagerGeneric::destroy(const CacheableKeyPtr& key, void *& PersistenceInfo)
- {
- m_managedptr->destroy(key);
- }
- void ManagedPersistenceManagerGeneric::close()
- {
- m_managedptr->close();
- }
-}
+ CacheablePtr ManagedPersistenceManagerGeneric::read(const CacheableKeyPtr& key, void *& PersistenceInfo)
+ {
+ return m_managedptr->read(key);
+ }
+
+ bool ManagedPersistenceManagerGeneric::readAll()
+ {
+ throw gcnew System::NotSupportedException;
+ }
+
+ void ManagedPersistenceManagerGeneric::destroy(const CacheableKeyPtr& key, void *& PersistenceInfo)
+ {
+ m_managedptr->destroy(key);
+ }
+ void ManagedPersistenceManagerGeneric::close()
+ {
+ m_managedptr->close();
+ }
+ } // namespace client
+ } // namespace geode
+} // namespace apache
http://git-wip-us.apache.org/repos/asf/geode/blob/e4fd74fb/src/clicache/src/impl/ManagedPersistenceManager.hpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/impl/ManagedPersistenceManager.hpp b/src/clicache/src/impl/ManagedPersistenceManager.hpp
index 366e4e1..2afd404 100644
--- a/src/clicache/src/impl/ManagedPersistenceManager.hpp
+++ b/src/clicache/src/impl/ManagedPersistenceManager.hpp
@@ -22,58 +22,62 @@
#include <gfcpp/PersistenceManager.hpp>
#include "PersistenceManagerProxy.hpp"
-namespace gemfire {
+namespace apache {
+ namespace geode {
+ namespace client {
- /// <summary>
- /// Wraps the managed <see cref="GemStone.GemFire.Cache.IPersistenceManager" />
- /// object and implements the native <c>gemfire::PersistenceManager</c> interface.
- /// </summary>
- class ManagedPersistenceManagerGeneric : public gemfire::PersistenceManager
- {
- public:
+ /// <summary>
+ /// Wraps the managed <see cref="GemStone.GemFire.Cache.IPersistenceManager" />
+ /// object and implements the native <c>apache::geode::client::PersistenceManager</c> interface.
+ /// </summary>
+ class ManagedPersistenceManagerGeneric : public apache::geode::client::PersistenceManager
+ {
+ public:
- inline ManagedPersistenceManagerGeneric(Object^ userptr ) : m_userptr(userptr) { }
+ inline ManagedPersistenceManagerGeneric(Object^ userptr) : m_userptr(userptr) { }
- static gemfire::PersistenceManager* create( const char* assemblyPath,
- const char* factoryFunctionName );
+ static apache::geode::client::PersistenceManager* create(const char* assemblyPath,
+ const char* factoryFunctionName);
- virtual ~ManagedPersistenceManagerGeneric( ) { }
+ virtual ~ManagedPersistenceManagerGeneric() { }
-
- virtual void write(const CacheableKeyPtr& key, const CacheablePtr& value, void *& PersistenceInfo);
- virtual bool writeAll();
- virtual void init(const RegionPtr& region, PropertiesPtr& diskProperties);
- virtual CacheablePtr read(const CacheableKeyPtr& key, void *& PersistenceInfo);
- virtual bool readAll();
- virtual void destroy(const CacheableKeyPtr& key, void *& PersistenceInfo);
- virtual void close();
- inline void setptr(GemStone::GemFire::Cache::Generic::IPersistenceManagerProxy^ managedptr)
- {
- m_managedptr = managedptr;
- }
+ virtual void write(const CacheableKeyPtr& key, const CacheablePtr& value, void *& PersistenceInfo);
+ virtual bool writeAll();
+ virtual void init(const RegionPtr& region, PropertiesPtr& diskProperties);
+ virtual CacheablePtr read(const CacheableKeyPtr& key, void *& PersistenceInfo);
+ virtual bool readAll();
+ virtual void destroy(const CacheableKeyPtr& key, void *& PersistenceInfo);
+ virtual void close();
- inline Object^ userptr( ) const
- {
- return m_userptr;
- }
+ inline void setptr(GemStone::GemFire::Cache::Generic::IPersistenceManagerProxy^ managedptr)
+ {
+ m_managedptr = managedptr;
+ }
- private:
+ inline Object^ userptr() const
+ {
+ return m_userptr;
+ }
+ private:
- /// <summary>
- /// Using gcroot to hold the managed delegate pointer (since it cannot be stored directly).
- /// Note: not using auto_gcroot since it will result in 'Dispose' of the IPersistenceManager
- /// to be called which is not what is desired when this object is destroyed. Normally this
- /// managed object may be created by the user and will be handled automatically by the GC.
- /// </summary>
- gcroot<GemStone::GemFire::Cache::Generic::IPersistenceManagerProxy^> m_managedptr;
- gcroot<Object^> m_userptr;
+ /// <summary>
+ /// Using gcroot to hold the managed delegate pointer (since it cannot be stored directly).
+ /// Note: not using auto_gcroot since it will result in 'Dispose' of the IPersistenceManager
+ /// to be called which is not what is desired when this object is destroyed. Normally this
+ /// managed object may be created by the user and will be handled automatically by the GC.
+ /// </summary>
+ gcroot<GemStone::GemFire::Cache::Generic::IPersistenceManagerProxy^> m_managedptr;
- // Disable the copy and assignment constructors
- ManagedPersistenceManagerGeneric( const ManagedPersistenceManagerGeneric& );
- ManagedPersistenceManagerGeneric& operator = ( const ManagedPersistenceManagerGeneric& );
- };
+ gcroot<Object^> m_userptr;
-}
+ // Disable the copy and assignment constructors
+ ManagedPersistenceManagerGeneric(const ManagedPersistenceManagerGeneric&);
+ ManagedPersistenceManagerGeneric& operator = (const ManagedPersistenceManagerGeneric&);
+ };
+
+ } // namespace client
+ } // namespace geode
+} // namespace apache