/export/rook1/users/build/gfcppsancout64/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 );
00123 
00127 _GF_EXCEPTION_DEF( InterruptedException );
00128 
00133 _GF_EXCEPTION_DEF( UnsupportedOperationException );
00134 
00139 _GF_EXCEPTION_DEF( StatisticsDisabledException );
00140 
00144 _GF_EXCEPTION_DEF( ConcurrentModificationException );
00145 
00149 _GF_EXCEPTION_DEF( UnknownException );
00150 
00154 _GF_EXCEPTION_DEF( ClassCastException );
00155 
00159 _GF_EXCEPTION_DEF( EntryNotFoundException );
00160 
00164 _GF_EXCEPTION_DEF( GemfireIOException );
00165 
00169 _GF_EXCEPTION_DEF( GemfireConfigException );
00170 
00175 _GF_EXCEPTION_DEF( NullPointerException );
00176 
00180 _GF_EXCEPTION_DEF( EntryExistsException );
00181 
00186 _GF_EXCEPTION_DEF( NotConnectedException );
00187 
00191 _GF_EXCEPTION_DEF( CacheProxyException );
00192 
00196 _GF_EXCEPTION_DEF( OutOfMemoryException );
00197 
00202 _GF_EXCEPTION_DEF( NotOwnerException );
00203 
00207 _GF_EXCEPTION_DEF( WrongRegionScopeException );
00208 
00212 _GF_EXCEPTION_DEF( BufferSizeExceededException );
00213 
00217 _GF_EXCEPTION_DEF( RegionCreationFailedException );
00218 
00222 _GF_EXCEPTION_DEF( FatalInternalException );
00223 
00228 _GF_EXCEPTION_DEF( DiskFailureException );
00229 
00234 _GF_EXCEPTION_DEF( DiskCorruptException );
00235 
00239 _GF_EXCEPTION_DEF( InitFailedException );
00240 
00244 _GF_EXCEPTION_DEF( ShutdownFailedException );
00245 
00249 _GF_EXCEPTION_DEF( CacheServerException );
00250 
00254 _GF_EXCEPTION_DEF( OutOfRangeException );
00255 
00259 _GF_EXCEPTION_DEF( QueryException );
00260 
00264 _GF_EXCEPTION_DEF( MessageException );
00265 
00269 _GF_EXCEPTION_DEF( NotAuthorizedException );
00270 
00274 _GF_EXCEPTION_DEF( AuthenticationFailedException );
00275 
00279 _GF_EXCEPTION_DEF( AuthenticationRequiredException );
00280 
00284 _GF_EXCEPTION_DEF( DuplicateDurableClientException );
00285 
00289 _GF_EXCEPTION_DEF(CacheListenerException);
00293 _GF_EXCEPTION_DEF( CqException );
00297 _GF_EXCEPTION_DEF( CqClosedException );
00301 _GF_EXCEPTION_DEF( CqQueryException );
00305 _GF_EXCEPTION_DEF( CqExistsException );
00315 _GF_EXCEPTION_DEF( CqInvalidException );
00319 _GF_EXCEPTION_DEF( FunctionExecutionException );
00323 _GF_EXCEPTION_DEF( NoAvailableLocatorsException );
00327 _GF_EXCEPTION_DEF( AllConnectionsInUseException );
00331 _GF_EXCEPTION_DEF( InvalidDeltaException );
00335 _GF_EXCEPTION_DEF( KeyNotFoundException );
00336 
00337 _GF_EXCEPTION_DEF( TransactionException );
00338 
00339 _GF_EXCEPTION_DEF( RollbackException );
00340 
00341 _GF_EXCEPTION_DEF( CommitConflictException );
00342 
00343 _GF_EXCEPTION_DEF( TransactionDataNodeHasDepartedException );
00344 
00345 _GF_EXCEPTION_DEF( TransactionDataRebalancedException );
00346 
00347 extern void CPPCACHE_EXPORT GfErrTypeThrowException( const char* str, GfErrType err );
00348 
00349 #define GfErrTypeToException(str, err) \
00350  { \
00351    if ( err != GF_NOERR ) \
00352    {\
00353      GfErrTypeThrowException(str, err); \
00354    }\
00355  }
00356 };// namespace gemfire
00357 
00358 #endif //ifndef __GEMFIRE_EXCEPTIONTYPES_H__

GemFire C++ Cache API Documentation