InternalCacheForClientAccess implements InternalCache { @Override public InternalRegion getReinitializingRegion(String fullPath) { InternalRegion result = delegate.getReinitializingRegion(fullPath); checkForInternalRegion(result); return result; } InternalCacheForClientAccess(InternalCache delegate); @Override Region<K, V> getRegion(String path); Region<K, V> getInternalRegion(String path); @Override Region<K, V> getRegion(String path, boolean returnDestroyedRegion); @Override InternalRegion getReinitializingRegion(String fullPath); @Override Region<K, V> getRegionByPath(String path); @Override InternalRegion getInternalRegionByPath(String path); @Override InternalRegion getRegionByPathForProcessing(String path); @Override DistributedRegion getRegionInDestroy(String path); @Override Set<PartitionedRegion> getPartitionedRegions(); @Override Set<Region<?, ?>> rootRegions(); @Override Set<Region<?, ?>> rootRegions(boolean includePRAdminRegions); @Override Set<InternalRegion> getAllRegions(); @Override Region<K, V> createVMRegion(String name, RegionAttributes<K, V> p_attrs,
      InternalRegionArguments internalRegionArgs); Region<K, V> createInternalRegion(String name, RegionAttributes<K, V> p_attrs,
      InternalRegionArguments internalRegionArgs); @Override Cache getReconnectedCache(); @Override FilterProfile getFilterProfile(String regionName); @Override Region<K, V> basicCreateRegion(String name, RegionAttributes<K, V> attrs); @Override Region<K, V> createVMRegion(String name, RegionAttributes<K, V> aRegionAttributes); @Override Region<K, V> createRegion(String name, RegionAttributes<K, V> aRegionAttributes); @Override RegionFactory<K, V> createRegionFactory(); @Override RegionFactory<K, V> createRegionFactory(RegionShortcut shortcut); @Override RegionFactory<K, V> createRegionFactory(String regionAttributesId); @Override RegionFactory<K, V> createRegionFactory(RegionAttributes<K, V> regionAttributes); @Override void close(boolean keepAlive); @Override LogWriterI18n getLoggerI18n(); @Override LogWriterI18n getSecurityLoggerI18n(); @Override int getLockTimeout(); @Override void setLockTimeout(int seconds); @Override int getMessageSyncInterval(); @Override void setMessageSyncInterval(int seconds); @Override int getLockLease(); @Override void setLockLease(int seconds); @Override int getSearchTimeout(); @Override void setSearchTimeout(int seconds); @Override CacheServer addCacheServer(); @Override List<CacheServer> getCacheServers(); @Override void setGatewayConflictResolver(GatewayConflictResolver resolver); @Override GatewayConflictResolver getGatewayConflictResolver(); @Override void setIsServer(boolean isServer); @Override boolean isServer(); @Override void readyForEvents(); @Override GatewaySenderFactory createGatewaySenderFactory(); @Override AsyncEventQueueFactory createAsyncEventQueueFactory(); @Override GatewayReceiverFactory createGatewayReceiverFactory(); @Override Set<GatewaySender> getGatewaySenders(); @Override GatewaySender getGatewaySender(String id); @Override Set<GatewayReceiver> getGatewayReceivers(); @Override Set<AsyncEventQueue> getAsyncEventQueues(); @Override AsyncEventQueue getAsyncEventQueue(String id); @Override Set<DistributedMember> getMembers(); @Override Set<DistributedMember> getAdminMembers(); @Override Set<DistributedMember> getMembers(Region region); @Override CacheSnapshotService getSnapshotService(); @Override boolean isReconnecting(); @Override boolean waitUntilReconnected(long time, TimeUnit units); @Override void stopReconnecting(); @Override String getName(); @Override DistributedSystem getDistributedSystem(); @Override ResourceManager getResourceManager(); @Override void setCopyOnRead(boolean copyOnRead); @Override boolean getCopyOnRead(); @Override RegionAttributes<K, V> getRegionAttributes(String id); @Override void setRegionAttributes(String id, RegionAttributes<K, V> attrs); @Override Map<String, RegionAttributes<K, V>> listRegionAttributes(); @Override void loadCacheXml(InputStream is); @Override LogWriter getLogger(); @Override LogWriter getSecurityLogger(); @Override DiskStore findDiskStore(String name); @Override DiskStoreFactory createDiskStoreFactory(); @Override boolean getPdxReadSerialized(); @Override PdxSerializer getPdxSerializer(); @Override String getPdxDiskStore(); @Override boolean getPdxPersistent(); @Override boolean getPdxIgnoreUnreadFields(); @Override void registerPdxMetaData(Object instance); @Override CacheTransactionManager getCacheTransactionManager(); @Override Context getJNDIContext(); @Override Declarable getInitializer(); @Override Properties getInitializerProps(); @Override CancelCriterion getCancelCriterion(); @Override PdxInstanceFactory createPdxInstanceFactory(String className); @Override PdxInstance createPdxEnum(String className, String enumName, int enumOrdinal); @Override void close(); @Override boolean isClosed(); @Override ExtensionPoint<Cache> getExtensionPoint(); @Override InternalDistributedMember getMyId(); @Override Collection<DiskStore> listDiskStores(); @Override Collection<DiskStore> listDiskStoresIncludingRegionOwned(); @Override CqService getCqService(); @Override T getService(Class<T> clazz); @Override Optional<T> getOptionalService(Class<T> clazz); @Override Collection<CacheService> getServices(); @Override SystemTimer getCCPTimer(); @Override void cleanupForClient(CacheClientNotifier ccn, ClientProxyMembershipID client); @Override void purgeCCPTimer(); @Override MemoryAllocator getOffHeapStore(); @Override DistributedLockService getPartitionedRegionLockService(); @Override PersistentMemberManager getPersistentMemberManager(); @Override Set<GatewaySender> getAllGatewaySenders(); @Override CachePerfStats getCachePerfStats(); @Override DistributionManager getDistributionManager(); @Override void regionReinitialized(Region region); @Override void setRegionByPath(String path, InternalRegion r); @Override InternalResourceManager getInternalResourceManager(); @Override ResourceAdvisor getResourceAdvisor(); @Override boolean isCacheAtShutdownAll(); @Override boolean requiresNotificationFromPR(PartitionedRegion r); @Override RegionAttributes<K, V> invokeRegionBefore(InternalRegion parent, String name,
      RegionAttributes<K, V> attrs, InternalRegionArguments internalRegionArgs); @Override void invokeRegionAfter(InternalRegion region); @Override void invokeBeforeDestroyed(InternalRegion region); @Override void invokeCleanupFailedInitialization(InternalRegion region); @Override TXManagerImpl getTXMgr(); @Override boolean forcedDisconnect(); @Override InternalResourceManager getInternalResourceManager(boolean checkCancellationInProgress); @Override boolean isCopyOnRead(); @Override TombstoneService getTombstoneService(); @Override QueryService getLocalQueryService(); @Override void registerInterestStarted(); @Override void registerInterestCompleted(); @Override void regionReinitializing(String fullPath); @Override void unregisterReinitializingRegion(String fullPath); @Override boolean removeRoot(InternalRegion rootRgn); @Override Executor getEventThreadPool(); @Override boolean keepDurableSubscriptionsAlive(); @Override CacheClosedException getCacheClosedException(String reason); @Override CacheClosedException getCacheClosedException(String reason, Throwable cause); @Override TypeRegistry getPdxRegistry(); @Override DiskStoreImpl getOrCreateDefaultDiskStore(); @Override ExpirationScheduler getExpirationScheduler(); @Override TransactionManager getJTATransactionManager(); @Override TXManagerImpl getTxManager(); @Override void beginDestroy(String path, DistributedRegion region); @Override void endDestroy(String path, DistributedRegion region); @Override ClientMetadataService getClientMetadataService(); @Override long cacheTimeMillis(); @Override URL getCacheXmlURL(); @Override List<File> getBackupFiles(); @Override boolean isClient(); @Override InternalDistributedSystem getInternalDistributedSystem(); @Override void addRegionListener(RegionListener regionListener); @Override void removeRegionListener(RegionListener regionListener); @Override Set<RegionListener> getRegionListeners(); @Override CacheConfig getCacheConfig(); @Override boolean getPdxReadSerializedByAnyGemFireServices(); @Override void setDeclarativeCacheConfig(CacheConfig cacheConfig); @Override void initializePdxRegistry(); @Override void readyDynamicRegionFactory(); @Override void setBackupFiles(List<File> backups); @Override void addDeclarableProperties(Map<Declarable, Properties> mapOfNewDeclarableProps); @Override void setInitializer(Declarable initializer, Properties initializerProps); @Override boolean hasPool(); @Override DiskStoreFactory createDiskStoreFactory(DiskStoreAttributes attrs); @Override BackupService getBackupService(); @Override @VisibleForTesting Throwable getDisconnectCause(); @Override void addPartitionedRegion(PartitionedRegion region); @Override void removePartitionedRegion(PartitionedRegion region); @Override void addDiskStore(DiskStoreImpl dsi); @Override TXEntryStateFactory getTXEntryStateFactory(); @Override EventTrackerExpiryTask getEventTrackerTask(); @Override void removeDiskStore(DiskStoreImpl diskStore); @Override void addGatewaySender(GatewaySender sender); @Override void addAsyncEventQueue(AsyncEventQueueImpl asyncQueue); @Override void removeAsyncEventQueue(AsyncEventQueue asyncQueue); @Override QueryMonitor getQueryMonitor(); @Override void close(String reason, Throwable systemFailureCause, boolean keepAlive, boolean keepDS,
      boolean skipAwait); @Override JmxManagerAdvisor getJmxManagerAdvisor(); @Override List<Properties> getDeclarableProperties(String className); @Override long getUpTime(); @Override void addRegionOwnedDiskStore(DiskStoreImpl dsi); @Override DiskStoreMonitor getDiskStoreMonitor(); @Override void close(String reason, Throwable optionalCause); @Override List<InternalCacheServer> getCacheServersAndGatewayReceiver(); @Override boolean isGlobalRegionInitializing(String fullPath); @Override DistributionAdvisor getDistributionAdvisor(); @Override void setQueryMonitorRequiredForResourceManager(boolean required); @Override boolean isQueryMonitorDisabledForLowMemory(); @Override boolean isRESTServiceRunning(); @Override InternalLogWriter getInternalLogWriter(); @Override InternalLogWriter getSecurityInternalLogWriter(); @Override Set<InternalRegion> getApplicationRegions(); @Override void removeGatewaySender(GatewaySender sender); @Override DistributedLockService getGatewaySenderLockService(); @Override @VisibleForTesting RestAgent getRestAgent(); @Override Properties getDeclarableProperties(Declarable declarable); @Override void setRESTServiceRunning(boolean isRESTServiceRunning); @Override void close(String reason, boolean keepAlive, boolean keepDS); @Override void addGatewayReceiver(GatewayReceiver receiver); @Override void removeGatewayReceiver(GatewayReceiver receiver); @Override InternalCacheServer addGatewayReceiverServer(GatewayReceiver receiver); @Override @VisibleForTesting boolean removeCacheServer(CacheServer cacheServer); @Override boolean removeGatewayReceiverServer(InternalCacheServer receiverServer); @Override @VisibleForTesting void setReadSerializedForTest(boolean value); @Override void setReadSerializedForCurrentThread(boolean value); @Override PdxInstanceFactory createPdxInstanceFactory(String className, boolean expectDomainClass); @Override void waitForRegisterInterestsInProgress(); @Override void reLoadClusterConfiguration(); @Override SecurityService getSecurityService(); @Override boolean hasPersistentRegion(); @Override void shutDownAll(); @Override void invokeRegionEntrySynchronizationListenersAfterSynchronization(
      InternalDistributedMember sender, InternalRegion region, List<Entry> entriesToSynchronize); @Override QueryService getQueryService(); @Override InternalQueryService getInternalQueryService(); @Override void lockDiskStore(String diskStoreName); @Override void unlockDiskStore(String diskStoreName); @Override JSONFormatter getJsonFormatter(); @Override @VisibleForTesting Set<AsyncEventQueue> getAsyncEventQueues(boolean visibleOnly); @Override @VisibleForTesting void closeDiskStores(); @Override Object convertPdxInstanceIfNeeded(Object obj, boolean preferCD); @Override Boolean getPdxReadSerializedOverride(); @Override void setPdxReadSerializedOverride(boolean pdxReadSerialized); @Override InternalCacheForClientAccess getCacheForProcessingClientRequests(); @Override void initialize(); @Override void throwCacheExistsException(); @Override MeterRegistry getMeterRegistry(); @Override void saveCacheXmlForReconnect(); @Override @VisibleForTesting HeapEvictor getHeapEvictor(); @Override @VisibleForTesting OffHeapEvictor getOffHeapEvictor(); @Override StatisticsClock getStatisticsClock();  }
@Test public void getReinitializingRegionWithApplicationWorks() { when(delegate.getReinitializingRegion("application")).thenReturn(applicationRegion); Region result = cache.getReinitializingRegion("application"); assertThat(result).isSameAs(applicationRegion); }
@Test public void getReinitializingRegionWithSecretThrows() { when(delegate.getReinitializingRegion("secret")).thenReturn(secretRegion); assertThatThrownBy(() -> { cache.getReinitializingRegion("secret"); }).isInstanceOf(NotAuthorizedException.class); }