public CacheClientUpdater connectServerToClient(Endpoint endpoint, QueueManager qManager, boolean isPrimary, ClientUpdater failedUpdater, String clientUpdateName) { CacheClientUpdater updater = new CacheClientUpdater(clientUpdateName, endpoint.getLocation(), isPrimary, ds, new ClientSideHandshakeImpl(this.handshake), qManager, endpointManager, endpoint, handshakeTimeout, this.socketCreator); if (!updater.isConnected()) { return null; } updater.setFailedUpdater(failedUpdater); updater.start(); return updater; }
verifySocketBufferSize(socketBufferSize, mySock.getReceiveBufferSize(), "receive"); verifySocketBufferSize(socketBufferSize, mySock.getSendBufferSize(), "send"); if (!quitting()) { logger.warn("{} connection was refused", this); if (!quitting()) { getSecurityLogger().warning(String.format("%s SSL negotiation failed. %s", new Object[] {this, ex})); throw new AuthenticationFailedException( if (!quitting()) { getSecurityLogger().warning( String.format( "%s: Security exception when creating server-to-client communication socket. %s", if (!quitting()) { logger.warn(String.format( "%s: Caught following exception while attempting to create a server-to-client communication socket and will exit: %s", if (!quitting()) { logger.warn("Unable to load the class: {}", e.getMessage()); if (!quitting()) { logger.warn(String.format( "%s: Caught following exception while attempting to create a server-to-client communication socket and will exit: %s", close();
@Override public String toString() { return getName() + " (" + this.location.getHostName() + ':' + this.location.getPort() + ')'; }
/** * Performs the work of the client update thread. Creates a {@code ServerSocket} and waits for the * server to connect to it. */ @Override public void run() { EntryLogger.setSource(this.serverId, "RI"); boolean addedListener = false; try { if (system instanceof InternalDistributedSystem) { ((InternalDistributedSystem) system).addDisconnectListener(this); addedListener = true; } if (!waitForCache()) { logger.warn("{}: no cache (exiting)", this); return; } processMessages(); } catch (CancelException ignore) { // just bail } finally { if (addedListener) { ((InternalDistributedSystem) system).removeDisconnectListener(this); } this.close(); EntryLogger.clearSource(); } }
Message clientMessage = initializeMessage(); if (quitting()) { if (isDebugEnabled) { logger.debug("processMessages quitting early because we have stopped"); if (quitting()) { if (isDebugEnabled) { logger.debug("termination detected"); waitForFailedUpdater(); this.cache.waitForRegisterInterestsInProgress(); if (quitting()) { if (isDebugEnabled) { logger.debug("processMessages quitting before processing message"); case MessageType.LOCAL_CREATE: case MessageType.LOCAL_UPDATE: handleUpdate(clientMessage); break; case MessageType.LOCAL_INVALIDATE: handleInvalidate(clientMessage); break; case MessageType.LOCAL_DESTROY: handleDestroy(clientMessage); break; case MessageType.LOCAL_DESTROY_REGION: handleDestroyRegion(clientMessage); break;
regionName, key, isCreate, valuePart.isObject() ? new StringBuilder(" value: ").append(deserialize(valuePart.getSerializedForm())) : "", callbackArgument, withInterest, withCQs, eventId, versionTag); if (isDebugEnabled && !quitting()) { logger.debug("{}: Region named {} does not exist", this, regionName); Part fullValuePart = requestFullValue(eventId, "Caught InvalidDeltaException."); region.getCachePerfStats().incDeltaFullValuesRequested(); numCqsPart.getInt() / 2); partCnt = processCqs(clientMessage, partCnt, numCqsPart.getInt(), clientMessage.getMessageType(), key, fullValue, deltaBytes, eventId); this.isOpCompleted = true; String.format( "The following exception occurred while attempting to put entry (region: %s key: %s value: %s)", regionName, key, deserialize(valuePart.getSerializedForm())); handleException(message, e);
new CacheClientUpdater("testUpdater", location, false, distributedSystem, handshake, queueManager, endpointManager, endpoint, 10000, socketCreator, statisticsProvider); assertThat(clientUpdater.isConnected()).isFalse();
void createClientCacheAndVerifyPingIntervalIsSet(String host, int port) throws Exception { PoolImpl pool = null; try { Properties props = new Properties(); props.setProperty(MCAST_PORT, "0"); props.setProperty(LOCATORS, ""); createCache(props); pool = (PoolImpl) PoolManager.createFactory().addServer(host, port) .setSubscriptionEnabled(true).setThreadLocalConnections(false).setReadTimeout(1000) .setSocketBufferSize(32768).setMinConnections(1).setSubscriptionRedundancy(-1) .setPingInterval(2000).create("test pool"); Region<Object, Object> region = cache.createRegionFactory(RegionShortcut.LOCAL) .setPoolName("test pool").create(REGION_NAME1); region.registerInterest(".*"); /** get the subscription connection and verify that it has the correct timeout setting */ QueueConnectionImpl primaryConnection = (QueueConnectionImpl) pool.getPrimaryConnection(); int pingInterval = ((CacheClientUpdater) primaryConnection.getUpdater()) .getServerQueueStatus().getPingInterval(); assertNotEquals(0, pingInterval); assertEquals(CacheClientNotifier.getClientPingInterval(), pingInterval); } finally { cache.close(); } }
int noOfParts = clientMessage.getNumberOfParts(); if (isDebugEnabled) { logger.debug("{}: Received register instantiators message of parts {}", getName(), noOfParts);
int noOfParts = msg.getNumberOfParts(); if (isDebugEnabled) { logger.debug("{}: Received register dataserializer message of parts {}", getName(), noOfParts);