build-artifacts/win/product/include/gfcpp/ExceptionTypes.hpp

Go to the documentation of this file.
00001 #ifndef __GEMFIRE_EXCEPTIONTYPES_H__
00002 #define __GEMFIRE_EXCEPTIONTYPES_H__
00003 /*=========================================================================
00004  * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
00005  * This product is protected by U.S. and international copyright
00006  * and intellectual property laws. Pivotal products are covered by
00007  * more patents listed at http://www.pivotal.io/patents.
00008  *========================================================================
00009  */
00010 
00011 
00016 #include "gfcpp_globals.hpp"
00017 #include "Exception.hpp"
00018 
00019 namespace gemfire {
00020 
00021 #define _GF_EXCEPTION_DEF(x) \
00022   const char _exception_name_##x[] = "gemfire::" #x; \
00023   class x; \
00024   typedef SharedPtr<x> x##Ptr; \
00025   class CPPCACHE_EXPORT x \
00026   : public gemfire::Exception \
00027   { \
00028     public: \
00029       x(const char* msg1, const char* msg2 = NULL, bool forceStack = false, \
00030           const ExceptionPtr& cause = NULLPTR) : Exception(msg1, msg2, forceStack, cause) { } \
00031       x(const x& other) : Exception(other) { } \
00032       virtual Exception* clone() const { return new x(m_message, m_stack, m_cause); } \
00033       virtual ~x() { } \
00034       virtual const char* getName() const { return _exception_name_##x; } \
00035       virtual void raise() { throw *this; } \
00036     protected: \
00037       x(const CacheableStringPtr& message, const StackTracePtr& stack, const ExceptionPtr& cause) : Exception(message, stack, cause) { } \
00038   private: \
00039       const x& operator=( const x& ); \
00040   }
00041 
00042 /*
00043  *
00044  * This is the list of exceptions directly derived from gemfire::Exception.
00045  *
00046  */
00047 
00051 _GF_EXCEPTION_DEF( AssertionException );
00052 
00056 _GF_EXCEPTION_DEF( IllegalArgumentException );
00057 
00061 _GF_EXCEPTION_DEF( IllegalStateException );
00062 
00066 _GF_EXCEPTION_DEF( CacheExistsException );
00067 
00071 _GF_EXCEPTION_DEF( CacheXmlException );
00075 _GF_EXCEPTION_DEF( TimeoutException );
00076 
00080 _GF_EXCEPTION_DEF( CacheWriterException );
00081 
00085 _GF_EXCEPTION_DEF( RegionExistsException );
00086 
00090 _GF_EXCEPTION_DEF( CacheClosedException );
00091 
00095 _GF_EXCEPTION_DEF( LeaseExpiredException );
00096 
00100 _GF_EXCEPTION_DEF( CacheLoaderException );
00101 
00105 _GF_EXCEPTION_DEF( RegionDestroyedException );
00106 
00110 _GF_EXCEPTION_DEF( EntryDestroyedException );
00111 
00115 _GF_EXCEPTION_DEF( NoSystemException );
00116 
00121 _GF_EXCEPTION_DEF( AlreadyConnectedException );
00122 
00126 _GF_EXCEPTION_DEF( FileNotFoundException );
00127 
00131 _GF_EXCEPTION_DEF( InterruptedException );
00132 
00137 _GF_EXCEPTION_DEF( UnsupportedOperationException );
00138 
00143 _GF_EXCEPTION_DEF( StatisticsDisabledException );
00144 
00148 _GF_EXCEPTION_DEF( ConcurrentModificationException );
00149 
00153 _GF_EXCEPTION_DEF( UnknownException );
00154 
00158 _GF_EXCEPTION_DEF( ClassCastException );
00159 
00163 _GF_EXCEPTION_DEF( EntryNotFoundException );
00164 
00168 _GF_EXCEPTION_DEF( GemfireIOException );
00169 
00173 _GF_EXCEPTION_DEF( GemfireConfigException );
00174 
00179 _GF_EXCEPTION_DEF( NullPointerException );
00180 
00184 _GF_EXCEPTION_DEF( EntryExistsException );
00185 
00190 _GF_EXCEPTION_DEF( NotConnectedException );
00191 
00195 _GF_EXCEPTION_DEF( CacheProxyException );
00196 
00200 _GF_EXCEPTION_DEF( OutOfMemoryException );
00201 
00206 _GF_EXCEPTION_DEF( NotOwnerException );
00207 
00211 _GF_EXCEPTION_DEF( WrongRegionScopeException );
00212 
00216 _GF_EXCEPTION_DEF( BufferSizeExceededException );
00217 
00221 _GF_EXCEPTION_DEF( RegionCreationFailedException );
00222 
00226 _GF_EXCEPTION_DEF( FatalInternalException );
00227 
00232 _GF_EXCEPTION_DEF( DiskFailureException );
00233 
00238 _GF_EXCEPTION_DEF( DiskCorruptException );
00239 
00243 _GF_EXCEPTION_DEF( InitFailedException );
00244 
00248 _GF_EXCEPTION_DEF( ShutdownFailedException );
00249 
00253 _GF_EXCEPTION_DEF( CacheServerException );
00254 
00258 _GF_EXCEPTION_DEF( OutOfRangeException );
00259 
00263 _GF_EXCEPTION_DEF( QueryException );
00264 
00268 _GF_EXCEPTION_DEF( MessageException );
00269 
00273 _GF_EXCEPTION_DEF( NotAuthorizedException );
00274 
00278 _GF_EXCEPTION_DEF( AuthenticationFailedException );
00279 
00283 _GF_EXCEPTION_DEF( AuthenticationRequiredException );
00284 
00288 _GF_EXCEPTION_DEF( DuplicateDurableClientException );
00289 
00293 _GF_EXCEPTION_DEF(CacheListenerException);
00297 _GF_EXCEPTION_DEF( CqException );
00301 _GF_EXCEPTION_DEF( CqClosedException );
00305 _GF_EXCEPTION_DEF( CqQueryException );
00309 _GF_EXCEPTION_DEF( CqExistsException );
00319 _GF_EXCEPTION_DEF( CqInvalidException );
00323 _GF_EXCEPTION_DEF( FunctionExecutionException );
00327 _GF_EXCEPTION_DEF( NoAvailableLocatorsException );
00331 _GF_EXCEPTION_DEF( AllConnectionsInUseException );
00335 _GF_EXCEPTION_DEF( InvalidDeltaException );
00339 _GF_EXCEPTION_DEF( KeyNotFoundException );
00344 _GF_EXCEPTION_DEF( TransactionException );
00350 _GF_EXCEPTION_DEF( RollbackException );
00355 _GF_EXCEPTION_DEF( CommitConflictException );
00361 _GF_EXCEPTION_DEF( TransactionDataNodeHasDepartedException );
00366 _GF_EXCEPTION_DEF( TransactionDataRebalancedException );
00367 
00371 _GF_EXCEPTION_DEF( PutAllPartialResultException );
00372 
00377 extern void CPPCACHE_EXPORT GfErrTypeThrowException( const char* str, GfErrType err );
00378 
00379 #define GfErrTypeToException(str, err) \
00380  { \
00381    if ( err != GF_NOERR ) \
00382    {\
00383      GfErrTypeThrowException(str, err); \
00384    }\
00385  }
00386 };// namespace gemfire
00387 
00388 #endif //ifndef __GEMFIRE_EXCEPTIONTYPES_H__

GemFire C++ Cache API Documentation