private Map<ServerSideHandshake, MutableInt> getCleanupTable() { return acceptor.getClientHealthMonitor().getCleanupTable(); }
private Map<ClientProxyMembershipID, MutableInt> getCleanupProxyIdTable() { return acceptor.getClientHealthMonitor().getCleanupProxyIdTable(); }
@Override protected boolean doHandShake(byte endpointType, int queueSize) { ClientHealthMonitor clientHealthMonitor = getAcceptor().getClientHealthMonitor(); clientHealthMonitor.registerClient(clientProxyMembershipID); clientHealthMonitor.addConnection(clientProxyMembershipID, this); return true; }
private ProtobufServerConnection getServerConnection(Socket socketMock, ClientProtocolProcessor clientProtocolProcessorMock, AcceptorImpl acceptorStub) throws IOException { ClientHealthMonitor clientHealthMonitorMock = mock(ClientHealthMonitor.class); when(acceptorStub.getClientHealthMonitor()).thenReturn(clientHealthMonitorMock); InetSocketAddress inetSocketAddressStub = InetSocketAddress.createUnresolved("localhost", 9071); InetAddress inetAddressStub = mock(InetAddress.class); when(socketMock.getInetAddress()).thenReturn(InetAddress.getByName("localhost")); when(socketMock.getRemoteSocketAddress()).thenReturn(inetSocketAddressStub); when(socketMock.getInetAddress()).thenReturn(inetAddressStub); InternalCacheForClientAccess cache = mock(InternalCacheForClientAccess.class); when(cache.getCacheForProcessingClientRequests()).thenReturn(cache); CachedRegionHelper cachedRegionHelper = mock(CachedRegionHelper.class); when(cachedRegionHelper.getCache()).thenReturn(cache); return new ProtobufServerConnection(socketMock, cache, cachedRegionHelper, mock(CacheServerStats.class), 0, 1024, "", CommunicationMode.ProtobufClientServerProtocol.getModeNumber(), acceptorStub, clientProtocolProcessorMock, mock(SecurityService.class)); }
private ProtobufServerConnection getServerConnection(Socket socketMock, ClientProtocolProcessor clientProtocolProcessorMock, AcceptorImpl acceptorStub) throws IOException { clientHealthMonitorMock = mock(ClientHealthMonitor.class); when(acceptorStub.getClientHealthMonitor()).thenReturn(clientHealthMonitorMock); InetSocketAddress inetSocketAddressStub = InetSocketAddress.createUnresolved("localhost", 9071); InetAddress inetAddressStub = mock(InetAddress.class); when(socketMock.getInetAddress()).thenReturn(InetAddress.getByName("localhost")); when(socketMock.getRemoteSocketAddress()).thenReturn(inetSocketAddressStub); when(socketMock.getInetAddress()).thenReturn(inetAddressStub); InternalCacheForClientAccess cache = mock(InternalCacheForClientAccess.class); when(cache.getCacheForProcessingClientRequests()).thenReturn(cache); CachedRegionHelper cachedRegionHelper = mock(CachedRegionHelper.class); when(cachedRegionHelper.getCache()).thenReturn(cache); return new ProtobufServerConnection(socketMock, cache, cachedRegionHelper, mock(CacheServerStats.class), 0, 1024, "", CommunicationMode.ProtobufClientServerProtocol.getModeNumber(), acceptorStub, clientProtocolProcessorMock, mock(SecurityService.class)); }
setClientDisconnectedException(e); } finally { acceptor.getClientHealthMonitor().receivedPing(this.clientProxyMembershipID);
this.acceptor.getClientHealthMonitor().removeConnection(this.proxyId, this); if (unregisterClient) { this.acceptor.getClientHealthMonitor().unregisterClient(this.proxyId, getAcceptor(), this.clientDisconnectedCleanly, this.clientDisconnectedException);
ClientHealthMonitor chm = this.acceptor.getClientHealthMonitor(); synchronized (this.chmLock) { this.chmRegistered = true;
acceptor.getClientHealthMonitor().receivedPing(this.proxyId);