Pivotal GemFire Native Client Cache Reference  9.0.6
ExceptionTypes.hpp
Go to the documentation of this file.
1 #ifndef __GEMFIRE_EXCEPTIONTYPES_H__
2 #define __GEMFIRE_EXCEPTIONTYPES_H__
3 /*=========================================================================
4  * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
5  * This product is protected by U.S. and international copyright
6  * and intellectual property laws. Pivotal products are covered by
7  * more patents listed at http://www.pivotal.io/patents.
8  *========================================================================
9  */
10 
11 
16 #include "gfcpp_globals.hpp"
17 #include "Exception.hpp"
18 
19 namespace gemfire {
20 
21 #define _GF_EXCEPTION_DEF(x) \
22  const char _exception_name_##x[] = "gemfire::" #x; \
23  class x; \
24  typedef SharedPtr<x> x##Ptr; \
25  class CPPCACHE_EXPORT x \
26  : public gemfire::Exception \
27  { \
28  public: \
29  x(const char* msg1, const char* msg2 = NULL, bool forceStack = false, \
30  const ExceptionPtr& cause = NULLPTR) : Exception(msg1, msg2, forceStack, cause) { } \
31  x(const x& other) : Exception(other) { } \
32  virtual Exception* clone() const { return new x(m_message, m_stack, m_cause); } \
33  virtual ~x() { } \
34  virtual const char* getName() const { return _exception_name_##x; } \
35  virtual void raise() { throw *this; } \
36  protected: \
37  x(const CacheableStringPtr& message, const StackTracePtr& stack, const ExceptionPtr& cause) : Exception(message, stack, cause) { } \
38  private: \
39  const x& operator=( const x& ); \
40  }
41 
42 /*
43  *
44  * This is the list of exceptions directly derived from gemfire::Exception.
45  *
46  */
47 
51 _GF_EXCEPTION_DEF( AssertionException );
52 
56 _GF_EXCEPTION_DEF( IllegalArgumentException );
57 
61 _GF_EXCEPTION_DEF( IllegalStateException );
62 
66 _GF_EXCEPTION_DEF( CacheExistsException );
67 
71 _GF_EXCEPTION_DEF( CacheXmlException );
75 _GF_EXCEPTION_DEF( TimeoutException );
76 
80 _GF_EXCEPTION_DEF( CacheWriterException );
81 
85 _GF_EXCEPTION_DEF( RegionExistsException );
86 
90 _GF_EXCEPTION_DEF( CacheClosedException );
91 
95 _GF_EXCEPTION_DEF( LeaseExpiredException );
96 
100 _GF_EXCEPTION_DEF( CacheLoaderException );
101 
105 _GF_EXCEPTION_DEF( RegionDestroyedException );
106 
110 _GF_EXCEPTION_DEF( EntryDestroyedException );
111 
115 _GF_EXCEPTION_DEF( NoSystemException );
116 
121 _GF_EXCEPTION_DEF( AlreadyConnectedException );
122 
126 _GF_EXCEPTION_DEF( FileNotFoundException );
127 
131 _GF_EXCEPTION_DEF( InterruptedException );
132 
137 _GF_EXCEPTION_DEF( UnsupportedOperationException );
138 
143 _GF_EXCEPTION_DEF( StatisticsDisabledException );
144 
148 _GF_EXCEPTION_DEF( ConcurrentModificationException );
149 
153 _GF_EXCEPTION_DEF( UnknownException );
154 
158 _GF_EXCEPTION_DEF( ClassCastException );
159 
163 _GF_EXCEPTION_DEF( EntryNotFoundException );
164 
168 _GF_EXCEPTION_DEF( GemfireIOException );
169 
173 _GF_EXCEPTION_DEF( GemfireConfigException );
174 
179 _GF_EXCEPTION_DEF( NullPointerException );
180 
184 _GF_EXCEPTION_DEF( EntryExistsException );
185 
190 _GF_EXCEPTION_DEF( NotConnectedException );
191 
195 _GF_EXCEPTION_DEF( CacheProxyException );
196 
200 _GF_EXCEPTION_DEF( OutOfMemoryException );
201 
206 _GF_EXCEPTION_DEF( NotOwnerException );
207 
211 _GF_EXCEPTION_DEF( WrongRegionScopeException );
212 
216 _GF_EXCEPTION_DEF( BufferSizeExceededException );
217 
221 _GF_EXCEPTION_DEF( RegionCreationFailedException );
222 
226 _GF_EXCEPTION_DEF( FatalInternalException );
227 
232 _GF_EXCEPTION_DEF( DiskFailureException );
233 
238 _GF_EXCEPTION_DEF( DiskCorruptException );
239 
243 _GF_EXCEPTION_DEF( InitFailedException );
244 
248 _GF_EXCEPTION_DEF( ShutdownFailedException );
249 
253 _GF_EXCEPTION_DEF( CacheServerException );
254 
258 _GF_EXCEPTION_DEF( OutOfRangeException );
259 
263 _GF_EXCEPTION_DEF( QueryException );
264 
268 _GF_EXCEPTION_DEF( MessageException );
269 
273 _GF_EXCEPTION_DEF( NotAuthorizedException );
274 
278 _GF_EXCEPTION_DEF( AuthenticationFailedException );
279 
283 _GF_EXCEPTION_DEF( AuthenticationRequiredException );
284 
288 _GF_EXCEPTION_DEF( DuplicateDurableClientException );
289 
293 _GF_EXCEPTION_DEF(CacheListenerException);
297 _GF_EXCEPTION_DEF( CqException );
301 _GF_EXCEPTION_DEF( CqClosedException );
305 _GF_EXCEPTION_DEF( CqQueryException );
309 _GF_EXCEPTION_DEF( CqExistsException );
319 _GF_EXCEPTION_DEF( CqInvalidException );
323 _GF_EXCEPTION_DEF( FunctionExecutionException );
327 _GF_EXCEPTION_DEF( NoAvailableLocatorsException );
331 _GF_EXCEPTION_DEF( AllConnectionsInUseException );
335 _GF_EXCEPTION_DEF( InvalidDeltaException );
339 _GF_EXCEPTION_DEF( KeyNotFoundException );
344 _GF_EXCEPTION_DEF( TransactionException );
350 _GF_EXCEPTION_DEF( RollbackException );
355 _GF_EXCEPTION_DEF( CommitConflictException );
361 _GF_EXCEPTION_DEF( TransactionDataNodeHasDepartedException );
366 _GF_EXCEPTION_DEF( TransactionDataRebalancedException );
367 
371 _GF_EXCEPTION_DEF( PutAllPartialResultException );
372 
377 extern void CPPCACHE_EXPORT GfErrTypeThrowException( const char* str, GfErrType err );
378 
379 #define GfErrTypeToException(str, err) \
380  { \
381  if ( err != GF_NOERR ) \
382  {\
383  GfErrTypeThrowException(str, err); \
384  }\
385  }
386 };// namespace gemfire
387 
388 #endif //ifndef __GEMFIRE_EXCEPTIONTYPES_H__
This namespace contains all the GemFire C++ API classes, enumerations and globals.
Definition: Assert.hpp:19
GfErrType
Error codes returned by GemFire C++ interface functions.
Definition: gf_base.hpp:220
#define CPPCACHE_EXPORT
Defines a GemFire CPPCACHE export.
Definition: gf_base.hpp:51
void CPPCACHE_EXPORT GfErrTypeThrowException(const char *str, GfErrType err)
Thrown when a version on which delta is based is different than the current version.

GemFire C++ Cache API Documentation