GemFireCacheImpl implements InternalCache, InternalClientCache, HasCachePerfStats,
    DistributionAdvisee { @Override public void addGatewayReceiver(GatewayReceiver receiver) { throwIfClient(); stopper.checkCancelInProgress(null); requireNonNull(receiver, "GatewayReceiver must be supplied."); gatewayReceiver.set(receiver); } GemFireCacheImpl(boolean isClient, PoolFactory poolFactory,
      InternalDistributedSystem internalDistributedSystem, CacheConfig cacheConfig,
      boolean useAsyncEventListeners, TypeRegistry typeRegistry); @VisibleForTesting  GemFireCacheImpl(boolean isClient,
      PoolFactory poolFactory,
      InternalDistributedSystem internalDistributedSystem,
      CacheConfig cacheConfig,
      boolean useAsyncEventListeners,
      TypeRegistry typeRegistry,
      Consumer<DistributedSystem> jndiTransactionMapper,
      InternalSecurityServiceFactory securityServiceFactory,
      Supplier<Boolean> isPoolManagerEmpty,
      Function<InternalDistributedSystem, ManagementListener> managementListenerFactory,
      Function<InternalCache, CqService> cqServiceFactory,
      CachePerfStatsFactory cachePerfStatsFactory,
      TXManagerImplFactory txManagerImplFactory,
      Supplier<PersistentMemberManager> persistentMemberManagerFactory,
      Function<DistributionAdvisee, ResourceAdvisor> resourceAdvisorFactory,
      Function<InternalCacheForClientAccess, JmxManagerAdvisee> jmxManagerAdviseeFactory,
      Function<JmxManagerAdvisee, JmxManagerAdvisor> jmxManagerAdvisorFactory,
      Function<InternalCache, InternalResourceManager> internalResourceManagerFactory,
      Supplier<Integer> serialNumberSupplier,
      HeapEvictorFactory heapEvictorFactory,
      Runnable typeRegistryInit,
      Runnable typeRegistryOpen,
      Runnable typeRegistryClose,
      Function<InternalCache, String> typeRegistryGetPdxDiskStoreName,
      Consumer<PdxSerializer> typeRegistrySetPdxSerializer,
      TypeRegistryFactory typeRegistryFactory,
      Consumer<Integer> haRegionQueueSetMessageSyncInterval,
      Consumer<org.apache.geode.cache.execute.Function> functionServiceRegisterFunction,
      Function<Object, SystemTimer> systemTimerFactory,
      Function<InternalCache, TombstoneService> tombstoneServiceFactory,
      Function<InternalDistributedSystem, ExpirationScheduler> expirationSchedulerFactory,
      Function<File, DiskStoreMonitor> diskStoreMonitorFactory,
      Supplier<RegionEntrySynchronizationListener> gatewaySenderQueueEntrySynchronizationListener,
      Function<InternalCache, BackupService> backupServiceFactory,
      Function<Cache, ClientMetadataService> clientMetadataServiceFactory,
      TXEntryStateFactory txEntryStateFactory,
      ReplyProcessor21Factory replyProcessor21Factory); static void lockMemory(); @Deprecated static GemFireCacheImpl getInstance(); @Deprecated static GemFireCacheImpl getExisting(); @Deprecated static GemFireCacheImpl getExisting(String reason); @Deprecated static GemFireCacheImpl getForPdx(String reason); @Override void lockDiskStore(String diskStoreName); @Override void unlockDiskStore(String diskStoreName); @Override String toString(); @Override void throwCacheExistsException(); @Override MeterRegistry getMeterRegistry(); @Override void saveCacheXmlForReconnect(); @Override void reLoadClusterConfiguration(); @Override SecurityService getSecurityService(); @Override boolean isRESTServiceRunning(); @Override void setRESTServiceRunning(boolean isRESTServiceRunning); @Override @VisibleForTesting RestAgent getRestAgent(); @Override boolean isClient(); @Override boolean hasPool(); @Override synchronized Pool getDefaultPool(); @Override void initialize(); @Override URL getCacheXmlURL(); @Override synchronized void initializePdxRegistry(); @Override void readyDynamicRegionFactory(); @Override DiskStoreFactory createDiskStoreFactory(); @Override DiskStoreFactory createDiskStoreFactory(DiskStoreAttributes attrs); @Override CancelCriterion getCancelCriterion(); @Override boolean forcedDisconnect(); @Override CacheClosedException getCacheClosedException(String reason); @Override CacheClosedException getCacheClosedException(String reason, Throwable cause); @Override @VisibleForTesting Throwable getDisconnectCause(); @Override boolean keepDurableSubscriptionsAlive(); static void emergencyClose(); @Override boolean isCacheAtShutdownAll(); @Override void shutDownAll(); @Override void close(); @Override void close(String reason, boolean keepAlive, boolean keepDS); @Override void close(boolean keepAlive); @Override void close(String reason, Throwable optionalCause); @Override DistributedLockService getPartitionedRegionLockService(); @Override DistributedLockService getGatewaySenderLockService(); @Override @VisibleForTesting HeapEvictor getHeapEvictor(); @Override @VisibleForTesting OffHeapEvictor getOffHeapEvictor(); @Override PersistentMemberManager getPersistentMemberManager(); @Override ClientMetadataService getClientMetadataService(); @Override void close(String reason, Throwable systemFailureCause, boolean keepAlive,
      boolean keepDS, boolean skipAwait); @Override boolean isReconnecting(); @Override boolean waitUntilReconnected(long time, TimeUnit units); @Override void stopReconnecting(); @Override Cache getReconnectedCache(); @Override void addDiskStore(DiskStoreImpl dsi); @Override void removeDiskStore(DiskStoreImpl diskStore); @Override void addRegionOwnedDiskStore(DiskStoreImpl dsi); @Override @VisibleForTesting void closeDiskStores(); @VisibleForTesting static void setDefaultDiskStoreName(String dsName); static String getDefaultDiskStoreName(); @Override DiskStoreImpl getOrCreateDefaultDiskStore(); @Override DiskStore findDiskStore(String name); @Override Collection<DiskStore> listDiskStores(); @Override Collection<DiskStore> listDiskStoresIncludingRegionOwned(); @Override DistributedSystem getDistributedSystem(); @Override InternalDistributedSystem getInternalDistributedSystem(); @Override InternalDistributedMember getMyId(); @Override Set<DistributedMember> getMembers(); @Override Set<DistributedMember> getAdminMembers(); @Override Set<DistributedMember> getMembers(Region region); @Override Set<InetSocketAddress> getCurrentServers(); @Override LogWriter getLogger(); @Override LogWriter getSecurityLogger(); @Override LogWriterI18n getLoggerI18n(); @Override LogWriterI18n getSecurityLoggerI18n(); @Deprecated @Override InternalLogWriter getInternalLogWriter(); @Deprecated @Override InternalLogWriter getSecurityInternalLogWriter(); @Override EventTrackerExpiryTask getEventTrackerTask(); @Override CachePerfStats getCachePerfStats(); @Override String getName(); @Override List<Properties> getDeclarableProperties(String className); @Override Properties getDeclarableProperties(Declarable declarable); @Override long getUpTime(); @Override long cacheTimeMillis(); @Override Region<K, V> createVMRegion(String name, RegionAttributes<K, V> aRegionAttributes); @Override void validatePoolFactory(PoolFactory poolFactory); @Override Region<K, V> createRegion(String name, RegionAttributes<K, V> aRegionAttributes); @Override Region<K, V> basicCreateRegion(String name, RegionAttributes<K, V> attrs); @Override Region<K, V> createVMRegion(String name, RegionAttributes<K, V> p_attrs,
      InternalRegionArguments internalRegionArgs); @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 Region<K, V> getRegion(String path); @Override Set<InternalRegion> getAllRegions(); @Override Set<InternalRegion> getApplicationRegions(); @Override boolean hasPersistentRegion(); @Override void setRegionByPath(String path, InternalRegion r); @Override Region<K, V> getRegionByPath(String path); @Override InternalRegion getInternalRegionByPath(String path); @Override InternalRegion getRegionByPathForProcessing(String path); @Override Region<K, V> getRegion(String path, boolean returnDestroyedRegion); @Override boolean isGlobalRegionInitializing(String fullPath); @Override Set<Region<?, ?>> rootRegions(); @Override Set<Region<?, ?>> rootRegions(boolean includePRAdminRegions); @Override void cleanupForClient(CacheClientNotifier ccn, ClientProxyMembershipID client); @Override boolean isClosed(); @Override int getLockTimeout(); @Override void setLockTimeout(int seconds); @Override int getLockLease(); @Override void setLockLease(int seconds); @Override int getSearchTimeout(); @Override void setSearchTimeout(int seconds); @Override int getMessageSyncInterval(); @Override void setMessageSyncInterval(int seconds); @Override InternalRegion getReinitializingRegion(String fullPath); @Override void regionReinitializing(String fullPath); @Override void regionReinitialized(Region<?, ?> region); @Override void unregisterReinitializingRegion(String fullPath); @Override boolean isCopyOnRead(); @Override void setCopyOnRead(boolean copyOnRead); @Override boolean getCopyOnRead(); @Override boolean removeRoot(InternalRegion rootRgn); static void addCacheLifecycleListener(CacheLifecycleListener listener); static boolean removeCacheLifecycleListener(CacheLifecycleListener listener); @Override void addRegionListener(RegionListener regionListener); @Override void removeRegionListener(RegionListener regionListener); @Override Set<RegionListener> getRegionListeners(); @Override T getService(Class<T> clazz); @Override Optional<T> getOptionalService(Class<T> clazz); @Override Collection<CacheService> getServices(); @Override CacheTransactionManager getCacheTransactionManager(); @Override SystemTimer getCCPTimer(); @Override void purgeCCPTimer(); @Override ExpirationScheduler getExpirationScheduler(); @Override TXManagerImpl getTXMgr(); @Override Executor getEventThreadPool(); @Override CacheServer addCacheServer(); @Override @VisibleForTesting boolean removeCacheServer(CacheServer cacheServer); @Override void addGatewaySender(GatewaySender sender); @Override void removeGatewaySender(GatewaySender sender); @Override InternalCacheServer addGatewayReceiverServer(GatewayReceiver receiver); @Override boolean removeGatewayReceiverServer(InternalCacheServer receiverServer); @Override void addGatewayReceiver(GatewayReceiver receiver); @Override void removeGatewayReceiver(GatewayReceiver receiver); @Override void addAsyncEventQueue(AsyncEventQueueImpl asyncQueue); @Override Set<GatewaySender> getGatewaySenders(); @Override Set<GatewaySender> getAllGatewaySenders(); @Override GatewaySender getGatewaySender(String id); @Override Set<GatewayReceiver> getGatewayReceivers(); @Override Set<AsyncEventQueue> getAsyncEventQueues(); @Override @VisibleForTesting Set<AsyncEventQueue> getAsyncEventQueues(boolean visibleOnly); @Override AsyncEventQueue getAsyncEventQueue(String id); @Override void removeAsyncEventQueue(AsyncEventQueue asyncQueue); @Override GatewayConflictResolver getGatewayConflictResolver(); @Override void setGatewayConflictResolver(GatewayConflictResolver resolver); @Override List<CacheServer> getCacheServers(); @Override List<InternalCacheServer> getCacheServersAndGatewayReceiver(); @Override void addPartitionedRegion(PartitionedRegion region); @Override Set<PartitionedRegion> getPartitionedRegions(); @Override boolean requiresNotificationFromPR(PartitionedRegion region); @Override void removePartitionedRegion(PartitionedRegion region); @Override void setIsServer(boolean isServer); @Override boolean isServer(); @Override QueryService getQueryService(); @Override InternalQueryService getInternalQueryService(); @Override JSONFormatter getJsonFormatter(); @Override QueryService getLocalQueryService(); @Override Context getJNDIContext(); @Override TransactionManager getJTATransactionManager(); @Override FilterProfile getFilterProfile(String regionName); @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 void readyForEvents(); @Override ResourceManager getResourceManager(); @Override InternalResourceManager getInternalResourceManager(); @Override InternalResourceManager getInternalResourceManager(boolean checkCancellationInProgress); @Override void setBackupFiles(List<File> backups); @Override List<File> getBackupFiles(); @Override BackupService getBackupService(); @Override void registerInterestCompleted(); @Override void registerInterestStarted(); @Override void waitForRegisterInterestsInProgress(); @Override @SuppressWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") void setQueryMonitorRequiredForResourceManager(boolean required); @Override boolean isQueryMonitorDisabledForLowMemory(); @Override QueryMonitor getQueryMonitor(); @Override TXManagerImpl getTxManager(); @Override RegionFactory<K, V> createRegionFactory(RegionShortcut shortcut); @Override RegionFactory<K, V> createRegionFactory(); @Override RegionFactory<K, V> createRegionFactory(String regionAttributesId); @Override RegionFactory<K, V> createRegionFactory(RegionAttributes<K, V> regionAttributes); @Override ClientRegionFactory<K, V> createClientRegionFactory(ClientRegionShortcut shortcut); @Override ClientRegionFactory<K, V> createClientRegionFactory(String regionAttributesId); @Override QueryService getQueryService(String poolName); @Override RegionService createAuthenticatedView(Properties userSecurityProperties); @Override RegionService createAuthenticatedView(Properties userSecurityProperties, String poolName); static void initializeRegionShortcuts(Cache cache); static void initializeClientRegionShortcuts(Cache cache); @Override void beginDestroy(String path, DistributedRegion region); @Override void endDestroy(String path, DistributedRegion region); @Override DistributedRegion getRegionInDestroy(String path); @Override TombstoneService getTombstoneService(); @Override TypeRegistry getPdxRegistry(); @Override boolean getPdxReadSerialized(); @Override PdxSerializer getPdxSerializer(); @Override String getPdxDiskStore(); @Override boolean getPdxPersistent(); @Override boolean getPdxIgnoreUnreadFields(); @Override boolean getPdxReadSerializedByAnyGemFireServices(); @Override CacheConfig getCacheConfig(); @Override DistributionManager getDistributionManager(); @Override GatewaySenderFactory createGatewaySenderFactory(); @Override GatewayReceiverFactory createGatewayReceiverFactory(); @Override AsyncEventQueueFactory createAsyncEventQueueFactory(); @Override DistributionAdvisor getDistributionAdvisor(); @Override ResourceAdvisor getResourceAdvisor(); @Override Profile getProfile(); @Override DistributionAdvisee getParentAdvisee(); @Override InternalDistributedSystem getSystem(); @Override String getFullPath(); @Override void fillInProfile(Profile profile); @Override int getSerialNumber(); @Override TXEntryStateFactory getTXEntryStateFactory(); @VisibleForTesting void setPdxSerializer(PdxSerializer serializer); @Override void setReadSerializedForCurrentThread(boolean value); @Deprecated @Override @VisibleForTesting void setReadSerializedForTest(boolean value); @Override void setDeclarativeCacheConfig(CacheConfig cacheConfig); @Override void addDeclarableProperties(Map<Declarable, Properties> mapOfNewDeclarableProps); @Override Declarable getInitializer(); @Override Properties getInitializerProps(); @Override void setInitializer(Declarable initializer, Properties initializerProps); @Override PdxInstanceFactory createPdxInstanceFactory(String className); @Override PdxInstanceFactory createPdxInstanceFactory(String className, boolean expectDomainClass); @Override PdxInstance createPdxEnum(String className, String enumName, int enumOrdinal); @Override JmxManagerAdvisor getJmxManagerAdvisor(); @Override CacheSnapshotService getSnapshotService(); @Override MemoryAllocator getOffHeapStore(); @Override DiskStoreMonitor getDiskStoreMonitor(); @Override ExtensionPoint<Cache> getExtensionPoint(); @Override CqService getCqService(); @Override void invokeRegionEntrySynchronizationListenersAfterSynchronization(
      InternalDistributedMember sender, InternalRegion region,
      List<InitialImageOperation.Entry> entriesToSynchronize); @Override Object convertPdxInstanceIfNeeded(Object obj, boolean preferCD); @Override Boolean getPdxReadSerializedOverride(); @Override void setPdxReadSerializedOverride(boolean pdxReadSerialized); @Override void registerPdxMetaData(Object instance); @Override InternalCacheForClientAccess getCacheForProcessingClientRequests(); @Override StatisticsClock getStatisticsClock(); static final int DEFAULT_LOCK_TIMEOUT; static final int DEFAULT_LOCK_LEASE; static final boolean DEFAULT_COPY_ON_READ; static final int DEFAULT_SEARCH_TIMEOUT; static final String DEFAULT_POOL_NAME; @MutableForTesting
  static int MAX_QUERY_EXECUTION_TIME; @MutableForTesting
  @VisibleForTesting
  static File testCacheXml; }
@Test public void addGatewayReceiverRequiresSuppliedGatewayReceiver() { Throwable thrown = catchThrowable(() -> gemFireCacheImpl.addGatewayReceiver(null)); assertThat(thrown) .isInstanceOf(NullPointerException.class); }