protected CacheClientNotifier getCacheClientNotifier() { return getAcceptor().getCacheClientNotifier(); }
new AcceptorImpl( port1, null, new AcceptorImpl( port2, null, a1 = new AcceptorImpl( port1, null, BridgeServer.DEFAULT_MESSAGE_TIME_TO_LIVE,0,null,null, false, Collections.EMPTY_LIST, CacheServer.DEFAULT_TCP_NO_DELAY); a2 = new AcceptorImpl( port1, null, a3 = new AcceptorImpl( port2, null, BridgeServer.DEFAULT_MESSAGE_TIME_TO_LIVE,0,null,null, false, Collections.EMPTY_LIST, CacheServer.DEFAULT_TCP_NO_DELAY); assertEquals(port2, a3.getPort()); InternalDistributedSystem isystem = (InternalDistributedSystem) this.cache.getDistributedSystem(); DistributionConfig config = isystem.getConfig(); String bindAddress = config.getBindAddress(); if (bindAddress == null || bindAddress.length() <= 0) {
public InetAddress getBindAddress() throws IOException { return getBindAddress(this.bindHostName); }
this.bindHostName = calcBindHostName(c, bindHostName); this.connectionListener = listener == null ? new ConnectionListenerAdapter() : listener; this.notifyBySubscription = notifyBySubscription; if (getBindAddress() instanceof Inet6Address) { logger.warn(LocalizedMessage.create(LocalizedStrings.AcceptorImpl_IGNORING_MAX_THREADS_DUE_TO_JROCKIT_NIO_BUG)); tmp_maxThreads = 0; HashSet tmp_hs = null; SystemTimer tmp_timer = null; if (isSelector()) { if (getCachedRegionHelper() != null) { gc = (GemFireCacheImpl)getCachedRegionHelper().getCache(); if (isSelector()) { if (this.socketCreator.useSSL()) { throw new IllegalArgumentException(LocalizedStrings.AcceptorImpl_SELECTOR_THREAD_POOLING_CAN_NOT_BE_USED_WITH_CLIENTSERVER_SSL_THE_SELECTOR_CAN_BE_DISABLED_BY_SETTING_MAXTHREADS0.toLocalizedString()); this.serverSock.bind(new InetSocketAddress(getBindAddress(), port), backLog); break; if (! treatAsBindException(b) || System.currentTimeMillis() > tilt) { throw b; try { this.serverSock = this.socketCreator.createServerSocket(port, backLog,
registeredKeys = checkRegisteredKeys(registeredKeys); if (registeredKeys == 0) { finishCon(sc); } catch (IOException ex) { finishCon(sc); logger.warn(LocalizedMessage.create(LocalizedStrings.AcceptorImpl_IGNORING, ex)); } catch (RuntimeException ex) { finishCon(sc); logger.warn(LocalizedMessage.create(LocalizedStrings.AcceptorImpl_IGNORING, ex)); checkForStuckKeys(); finishCon(sc); continue; } catch (IOException ex) { finishCon(sc); if(isRunning()) { logger.warn(LocalizedMessage.create(LocalizedStrings.AcceptorImpl_UNEXPECTED, ex)); AcceptorImpl.this.pool.execute(sc); } catch (RejectedExecutionException rejected) { finishCon(sc); AcceptorImpl.this.stats.decThreadQueueSize(); if (!isRunning()) { break; finishCon(sc);
this.acceptor = new AcceptorImpl(getPort(), getBindAddress(), getNotifyBySubscription(), this.gatewayTransportFilters, this.tcpNoDelay); this.acceptor.start(); this.advisor.handshake(); this.loadMonitor.start(new ServerLocation(getExternalAddress(), getPort()), acceptor.getStats());
/** * While starting the cache server stats can be monitored. */ private void startMonitor() { CacheServerStats stats = acceptor.getStats(); addCacheServerStats(stats); }
started = true; } catch (BindException be) { InetAddress bindHostAddress = AcceptorImpl.getBindAddress( AcceptorImpl.calcBindHostName(cache, getBindAddress())); if (!AcceptorImpl.treatAsBindException(be, bindHostAddress)) { throw be;
InetAddress bindHostAddress = null; try { bindHostAddress = AcceptorImpl.getBindAddress( AcceptorImpl.calcBindHostName(cache, bindAddress)); Misc.getMemStoreBooting().addPendingOperation(startOp, tc); } catch (IOException ioe) {
private int basicGetPort() { if (this._acceptor != null) { return this._acceptor.getPort(); } else { return this._port; } }
/** * Returns a Map that contains the count for number of bridge server and number * of Receivers. * * @return Map */ public static Map getCacheServers() { List cacheServers = cache.getCacheServers(); Map cacheServersMap = new HashMap(); Iterator itr = cacheServers.iterator(); int bridgeServerCounter = 0; int receiverServerCounter = 0; while (itr.hasNext()) { BridgeServerImpl cacheServer = (BridgeServerImpl) itr.next(); if (cacheServer.getAcceptor().isGatewayReceiver()) { receiverServerCounter++; } else { bridgeServerCounter++; } } cacheServersMap.put("BridgeServer", bridgeServerCounter); cacheServersMap.put("ReceiverServer", receiverServerCounter); return cacheServersMap; }
this._acceptor.close(); } catch (Exception e) {/* ignore */
this._acceptor = new AcceptorImpl(this._port, this._bindAddress, true /* notify by subscription */, this._socketBufferSize, this._maximumTimeBetweenPings, this.getCache(), CacheServer.DEFAULT_TCP_NO_DELAY); this._acceptor.start();
/** * The work loop of this acceptor * * @see #accept */ public void run() { try { accept(); } catch (CancelException e) { // bug 39462 // ignore } finally { try { if (this.serverSock != null) { this.serverSock.close(); } } catch (IOException ignore) { } if (this.stats != null) { this.stats.close(); } } }
this.bindHostName = calcBindHostName(c, bindHostName); this.connectionListener = listener == null ? new ConnectionListenerAdapter() : listener; this.notifyBySubscription = notifyBySubscription; this.isGatewayReceiver = isGatewayReceiver; this.gatewayTransportFilters = transportFilter; InetAddress bindAddress = getBindAddress(); HashSet tmp_hs = null; SystemTimer tmp_timer = null; if (isSelector()) { if (isSelector()) { if (sc.useSSL()) { throw new IllegalArgumentException(LocalizedStrings.AcceptorImpl_SELECTOR_THREAD_POOLING_CAN_NOT_BE_USED_WITH_CLIENTSERVER_SSL_THE_SELECTOR_CAN_BE_DISABLED_BY_SETTING_MAXTHREADS0.toLocalizedString()); if (! treatAsBindException(b, bindAddress) || System.currentTimeMillis() > tilt) { throw b; if (! treatAsBindException(e, bindAddress) || System.currentTimeMillis() > tilt) { throw e; if (isSelector()) { tmp_pool = new PooledExecutorWithDMStats(new LinkedBlockingQueue(), this.maxThreads, getStats().getCnxPoolHelper(), socketThreadFactory,
registeredKeys = checkRegisteredKeys(registeredKeys); if (registeredKeys == 0) { finishCon(sc); } catch (IOException ex) { finishCon(sc); if (logger.warningEnabled()) { logger.warning(LocalizedStrings.AcceptorImpl_IGNORING, ex); finishCon(sc); if (logger.warningEnabled()) { logger.warning(LocalizedStrings.AcceptorImpl_IGNORING, ex); checkForStuckKeys(); finishCon(sc); continue; } catch (IOException ex) { finishCon(sc); if(isRunning()) { if(logger.warningEnabled()) { logger.warning(LocalizedStrings.AcceptorImpl_UNEXPECTED, ex); AcceptorImpl.this.pool.execute(sc); } catch (RejectedExecutionException rejected) { finishCon(sc); AcceptorImpl.this.stats.decThreadQueueSize(); if (!isRunning()) {
this.acceptor = new AcceptorImpl(getPort(), getBindAddress(), getNotifyBySubscription(), this.gatewayTransportFilters, this.tcpNoDelay); this.acceptor.start(); this.advisor.handshake(); this.loadMonitor.start(new ServerLocation(getExternalAddress(), getPort()), acceptor.getStats());
public Thread newThread(Runnable command) { int tnum; synchronized (this) { tnum = ++connNum; } String tName = socketThreadGroup.getName() + " Thread " + tnum; getStats().incAcceptThreadsCreated(); return new Thread(socketThreadGroup, command, tName); } };
@Override public int getPort() { if (this.acceptor != null) { return this.acceptor.getPort(); } else { return super.getPort(); } }
if(((AcceptorImpl)acceptor).isGatewayReceiver()) { buffer .append("GatewayReceiver connection from [");