AcceptorImpl implements Acceptor, Runnable { @Override public boolean isGatewayReceiver() { return isGatewayReceiver; } AcceptorImpl(final int port, final String bindHostName, final boolean notifyBySubscription,
      final int socketBufferSize, final int maximumTimeBetweenPings,
      final InternalCache internalCache, final int maxConnections, final int maxThreads,
      final int maximumMessageCount, final int messageTimeToLive,
      final ConnectionListener connectionListener, final OverflowAttributes overflowAttributes,
      final boolean tcpNoDelay, final ServerConnectionFactory serverConnectionFactory,
      final long timeLimitMillis, final SecurityService securityService,
      final Supplier<SocketCreator> socketCreatorSupplier,
      final CacheClientNotifierProvider cacheClientNotifierProvider,
      final ClientHealthMonitorProvider clientHealthMonitorProvider);   AcceptorImpl(final int port, final String bindHostName, final boolean notifyBySubscription,
      final int socketBufferSize, final int maximumTimeBetweenPings,
      final InternalCache internalCache, final int maxConnections, final int maxThreads,
      final int maximumMessageCount, final int messageTimeToLive,
      final ConnectionListener connectionListener,
      final OverflowAttributes overflowAttributes,
      final boolean tcpNoDelay, final ServerConnectionFactory serverConnectionFactory,
      final long timeLimitMillis, final SecurityService securityService,
      final Supplier<SocketCreator> socketCreatorSupplier,
      final CacheClientNotifierProvider cacheClientNotifierProvider,
      final ClientHealthMonitorProvider clientHealthMonitorProvider,
      final boolean isGatewayReceiver,
      final List<GatewayTransportFilter> gatewayTransportFilters,
      final StatisticsClock statisticsClock); @Override long getAcceptorId(); @Override CacheServerStats getStats(); @Override boolean isSelector(); @Override void start(); @Override void registerServerConnection(ServerConnection serverConnection); @Override void unregisterServerConnection(ServerConnection serverConnection); @Override void emergencyClose(); @Override int getPort(); @Override String getServerName(); @Override InetAddress getServerInetAddress(); @Override void run(); @Override void accept(); @Override void decClientServerConnectionCount(); @Override int getClientServerConnectionCount(); @Override void refuseHandshake(OutputStream out, String message, byte exception); @Override boolean isRunning(); @Override void close(); @Override void notifyCacheMembersOfClose(); @Override String getExternalAddress(); @Override CacheClientNotifier getCacheClientNotifier(); @Override CachedRegionHelper getCachedRegionHelper(); @Override ClientHealthMonitor getClientHealthMonitor(); @Override ConnectionListener getConnectionListener(); @Override boolean isGatewayReceiver(); List<GatewayTransportFilter> getGatewayTransportFilters(); @Override Set<ServerConnection> getAllServerConnections(); @Override ServerConnection[] getAllServerConnectionList(); @Override void setTLCommBuffer(); @Override void releaseTLCommBuffer(); static final String ACCEPT_TIMEOUT_PROPERTY_NAME; }
@Test public void constructorWithoutGatewayReceiverCreatesAcceptorImplForCacheServer() throws Exception { Acceptor acceptor = new AcceptorImpl(0, null, false, DEFAULT_SOCKET_BUFFER_SIZE, DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS, cache, MINIMUM_MAX_CONNECTIONS, 0, CacheServer.DEFAULT_MAXIMUM_MESSAGE_COUNT, CacheServer.DEFAULT_MESSAGE_TIME_TO_LIVE, null, null, DEFAULT_TCP_NO_DELAY, serverConnectionFactory, 1000, securityService, () -> socketCreator, (a, b, c, d, e, f, g, h, i) -> cacheClientNotifier, (a, b, c) -> clientHealthMonitor, false, emptyList(), disabledClock()); assertThat(acceptor.isGatewayReceiver()).isFalse(); }
@Test public void constructorWithGatewayReceiverCreatesAcceptorImplForGatewayReceiver() throws Exception { when(system.getStatisticsManager()).thenReturn(statisticsManager); when(statisticsManager.createType(any(), any(), any())).thenReturn(mock(StatisticsType.class)); when(statisticsManager.createAtomicStatistics(any(), any())).thenReturn(mock(Statistics.class)); when(cache.getMeterRegistry()).thenReturn(new SimpleMeterRegistry()); Acceptor acceptor = new AcceptorImpl(0, null, false, DEFAULT_SOCKET_BUFFER_SIZE, DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS, cache, MINIMUM_MAX_CONNECTIONS, 0, CacheServer.DEFAULT_MAXIMUM_MESSAGE_COUNT, CacheServer.DEFAULT_MESSAGE_TIME_TO_LIVE, null, null, DEFAULT_TCP_NO_DELAY, serverConnectionFactory, 1000, securityService, () -> socketCreator, (a, b, c, d, e, f, g, h, i) -> cacheClientNotifier, (a, b, c) -> clientHealthMonitor, true, emptyList(), disabledClock()); assertThat(acceptor.isGatewayReceiver()).isTrue(); }