}
if (ex instanceof EntryDestroyedException) {
return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
}
if (ex instanceof FailedSynchronizationException) {
return new PessimisticLockingFailureException(ex.getMessage(), ex);
}
if (ex instanceof IndexMaintenanceException) {
return new GemfireIndexException((IndexMaintenanceException) ex);
}
if (ex instanceof OperationAbortedException) {
// treat user exceptions first
if (ex instanceof CacheLoaderException) {
return new GemfireSystemException(ex);
}
if (ex instanceof CacheWriterException) {
return new GemfireSystemException(ex);
}
// the rest are treated as resource failures
return new DataAccessResourceFailureException(ex.getMessage(), ex);
}
if (ex instanceof PartitionedRegionDistributionException) {
return new DataAccessResourceFailureException(ex.getMessage(), ex);
}
if (ex instanceof PartitionedRegionStorageException) {
return new DataAccessResourceFailureException(ex.getMessage(), ex);
}
if (ex instanceof QueryExecutionTimeoutException) {
return new GemfireQueryException((QueryExecutionTimeoutException) ex);
}
if (ex instanceof RegionDestroyedException) {
return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
}
if (ex instanceof com.gemstone.gemfire.admin.RegionNotFoundException) {
return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
}
if (ex instanceof ResourceException) {
return new DataAccessResourceFailureException(ex.getMessage(), ex);
}
if (ex instanceof RoleException) {
return new GemfireSystemException(ex);
}
if (ex instanceof StatisticsDisabledException) {
return new GemfireSystemException(ex);
}
if (ex instanceof SynchronizationCommitConflictException) {
return new PessimisticLockingFailureException(ex.getMessage(), ex);
}
}
if (ex instanceof CopyException) {
return new GemfireSystemException(ex);
}
if (ex instanceof com.gemstone.gemfire.cache.EntryNotFoundInRegion) {
return new DataRetrievalFailureException(ex.getMessage(), ex);
}
if (ex instanceof FunctionException) {
return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
}
if (ex instanceof GemFireCacheException) {
return convertGemfireAccessException(((GemFireCacheException) ex).getCacheException());
}
if (ex instanceof GemFireConfigException) {
return new GemfireSystemException(ex);
}
if (ex instanceof GemFireIOException) {
return new DataAccessResourceFailureException(ex.getMessage(), ex);
}
if (ex instanceof GemFireSecurityException) {
return new PermissionDeniedDataAccessException(ex.getMessage(), ex);
}
if (ex instanceof IncompatibleSystemException) {
return new GemfireSystemException(ex);
}
if (ex instanceof InternalGemFireException) {
return new GemfireSystemException(ex);
}
if (ex instanceof InvalidValueException) {
return new TypeMismatchDataAccessException(ex.getMessage(), ex);
}
if (ex instanceof LeaseExpiredException) {
return new PessimisticLockingFailureException(ex.getMessage(), ex);
}
if (ex instanceof LicenseException) {
return new GemfireSystemException(ex);
}
if (ex instanceof NoSystemException) {