H:/gfcppsancout/product/include/gfcpp/ExceptionTypes.hpp

Go to the documentation of this file.
00001 #ifndef __GEMFIRE_EXCEPTIONTYPES_H__
00002 #define __GEMFIRE_EXCEPTIONTYPES_H__
00003 /*=========================================================================
00004  * (c) Copyright 2002-2007, GemStone Systems, Inc. All Rights Reserved.
00005  * 1260 NW Waterhouse Ave., Suite 200,  Beaverton, OR 97006
00006  *========================================================================
00007  */
00008 
00009 
00014 #include "gfcpp_globals.hpp"
00015 #include "Exception.hpp"
00016 
00017 namespace gemfire {
00018 
00019 #define _GF_EXCEPTION_DEF(x) \
00020   const char _exception_name_##x[] = "gemfire::" #x; \
00021   class x; \
00022   typedef SharedPtr<x> x##Ptr; \
00023   class CPPCACHE_EXPORT x \
00024   : public gemfire::Exception \
00025   { \
00026     public: \
00027       x(const char* msg1, const char* msg2 = NULL, bool forceStack = false, \
00028           const ExceptionPtr& cause = NULLPTR) : Exception(msg1, msg2, forceStack, cause) { } \
00029       x(const x& other) : Exception(other) { } \
00030       virtual Exception* clone() const { return new x(m_message, m_stack, m_cause); } \
00031       virtual ~x() { } \
00032       virtual const char* getName() const { return _exception_name_##x; } \
00033       virtual void raise() { throw *this; } \
00034     protected: \
00035       x(const CacheableStringPtr& message, const StackTracePtr& stack, const ExceptionPtr& cause) : Exception(message, stack, cause) { } \
00036   }
00037 
00038 /*
00039  *
00040  * This is the list of exceptions directly derived from gemfire::Exception.
00041  *
00042  */
00043 
00047 _GF_EXCEPTION_DEF( AssertionException );
00048 
00052 _GF_EXCEPTION_DEF( IllegalArgumentException );
00053 
00057 _GF_EXCEPTION_DEF( IllegalStateException );
00058 
00062 _GF_EXCEPTION_DEF( CacheExistsException );
00063 
00067 _GF_EXCEPTION_DEF( CacheXmlException );
00071 _GF_EXCEPTION_DEF( TimeoutException );
00072 
00076 _GF_EXCEPTION_DEF( CacheWriterException );
00077 
00081 _GF_EXCEPTION_DEF( RegionExistsException );
00082 
00086 _GF_EXCEPTION_DEF( CacheClosedException );
00087 
00091 _GF_EXCEPTION_DEF( LeaseExpiredException );
00092 
00096 _GF_EXCEPTION_DEF( CacheLoaderException );
00097 
00101 _GF_EXCEPTION_DEF( RegionDestroyedException );
00102 
00106 _GF_EXCEPTION_DEF( EntryDestroyedException );
00107 
00111 _GF_EXCEPTION_DEF( NoSystemException );
00112 
00117 _GF_EXCEPTION_DEF( AlreadyConnectedException );
00118 
00122 _GF_EXCEPTION_DEF( FileNotFoundException );
00126 _GF_EXCEPTION_DEF( LicenseException );
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( RedundancyException );
00264 
00268 _GF_EXCEPTION_DEF( QueryException );
00269 
00273 _GF_EXCEPTION_DEF( MessageException );
00274 
00278 _GF_EXCEPTION_DEF( NotAuthorizedException );
00279 
00283 _GF_EXCEPTION_DEF( AuthenticationFailedException );
00284 
00288 _GF_EXCEPTION_DEF( AuthenticationRequiredException );
00289 
00293 _GF_EXCEPTION_DEF( DuplicateDurableClientException );
00294 
00298 _GF_EXCEPTION_DEF(CacheListenerException);
00299 
00300 extern void CPPCACHE_EXPORT GfErrTypeThrowException( const char* str, GfErrType err );
00301 
00302 #define GfErrTypeToException(str, err) \
00303  { \
00304    if ( err != GF_NOERR ) \
00305    {\
00306      GfErrTypeThrowException(str, err); \
00307    }\
00308  }
00309 };// namespace gemfire
00310 
00311 #endif //ifndef __GEMFIRE_EXCEPTIONTYPES_H__

GemFire C++ Cache API Documentation