@Override public boolean isRunning() { return this.acceptor != null && this.acceptor.isRunning(); }
private void releaseCommBuffer(ByteBuffer bb) { if (bb == null) { // fix for bug 37107 return; } if (isRunning()) { this.commBufferQueue.offer(bb); } }
public boolean isShutdownProperly() { return !isRunning() && !thread.isAlive() && (selectorThread == null || !selectorThread.isAlive()) && (pool == null || pool.isShutdown()) && (hsPool == null || hsPool.isShutdown()) && (clientQueueInitPool == null || clientQueueInitPool.isShutdown()) && (selector == null || !selector.isOpen()) && (tmpSel == null || !tmpSel.isOpen()); }
public void unregisterSC(ServerConnection sc) { // removed syncLock synchronization to fix bug 37104 synchronized (this.allSCsLock) { this.allSCs.remove(sc); Iterator it = this.allSCs.iterator(); ServerConnection again[] = new ServerConnection[this.allSCs.size()]; for (int i = 0; i < again.length; i++) { again[i] = (ServerConnection) it.next(); } this.allSCList = again; } if (!isRunning()) { return; } // just need to wake the selector up so it will notice our socket was closed wakeupSelector(); }
public void registerSC(ServerConnection sc) { synchronized (this.syncLock) { if (!isRunning()) { finishCon(sc); return; } } getSelectorQueue().offer(sc); wakeupSelector(); }
@Override public void run() { logger.info(":Cache server: Initializing {} server-to-client communication socket: {}", isPrimaryServerToClient ? "primary" : "secondary", socket); try { acceptor.getCacheClientNotifier().registerClient(socket, isPrimaryServerToClient, acceptor.getAcceptorId(), acceptor.isNotifyBySubscription()); } catch (IOException ex) { closeSocket(socket); if (acceptor.isRunning()) { if (!acceptor.loggedAcceptError) { acceptor.loggedAcceptError = true; if (ex instanceof SocketTimeoutException) { logger .warn("Cache server: failed accepting client connection due to socket timeout."); } else { logger.warn("Cache server: failed accepting client connection " + ex, ex); } } } } } }
public boolean isOkayToSendResult() { return (sc.getAcceptor().isRunning() && !ids.isDisconnecting() && !sc.getCachedRegionHelper().getCache().isClosed() && !alreadySendException.get()); }
protected ServerToClientFunctionResultSender getResultSender() { ChunkedMessage msg = mock(ChunkedMessage.class); serverConnection = mock(ServerConnection.class); Function function = mock(Function.class); ExecuteFunctionOperationContext executeFunctionOperationContext = mock(ExecuteFunctionOperationContext.class); // sc.getAcceptor().isSelector(); AcceptorImpl acceptor = mock(AcceptorImpl.class); when(serverConnection.getAcceptor()).thenReturn(acceptor); when(acceptor.isSelector()).thenReturn(true); when(acceptor.isRunning()).thenReturn(true); return new ServerToClientFunctionResultSender(msg, 1, serverConnection, function, executeFunctionOperationContext); }
} catch (RejectedExecutionException rejected) { closeSocket(socket); if (isRunning()) { this.stats.decAcceptsInProgress(); logger.warn("unexpected", rejected);
while (isRunning()) { if (SystemFailure.getFailure() != null) { if (!isRunning()) { closeSocket(socket); break; } catch (InterruptedIOException e) { // Solaris only closeSocket(socket); if (isRunning()) { if (logger.isDebugEnabled()) { logger.debug("Aborted due to interrupt: {}", e); if (isRunning()) { if (!this.loggedAcceptError) { this.loggedAcceptError = true; } catch (Exception e) { closeSocket(socket); if (isRunning()) { logger.fatal("Cache server: Unexpected Exception", e);
@Override protected ServerToClientFunctionResultSender getResultSender() { ChunkedMessage msg = mock(ChunkedMessage.class); serverConnection = mock(ServerConnection.class); Function function = mock(Function.class); ExecuteFunctionOperationContext executeFunctionOperationContext = mock(ExecuteFunctionOperationContext.class); AcceptorImpl acceptor = mock(AcceptorImpl.class); when(serverConnection.getAcceptor()).thenReturn(acceptor); when(acceptor.isSelector()).thenReturn(true); when(acceptor.isRunning()).thenReturn(true); return new ServerToClientFunctionResultSender65(msg, 1, serverConnection, function, executeFunctionOperationContext); } }
} catch (IOException ex) { finishCon(sc); if (isRunning()) { logger.warn("Unexpected Exception:", ex); finishCon(sc); AcceptorImpl.this.stats.decThreadQueueSize(); if (!isRunning()) { break; if (isRunning() && this.selector.isOpen() && this.tmpSel.isOpen()) { logger.warn("Unexpected Exception:", ex); try { if (isRunning() && this.selector.isOpen() && this.tmpSel.isOpen()) { logger.warn("Unexpected Exception:", ex2); continue; } catch (IOException ex) { if (isRunning() && this.selector.isOpen() && this.tmpSel.isOpen()) { logger.warn("Unexpected Exception:", ex); if (isRunning() && this.selector.isOpen() && this.tmpSel.isOpen()) { logger.warn("Unexpected Exception:", npe);
pool.execute(serverConn); } catch (RejectedExecutionException rejected) { if (!isRunning()) { return;
try { synchronized (syncLock) { if (!isRunning()) { return;
private boolean isFiringMembershipEvents() { return this.acceptor.isRunning() && !(this.acceptor.getCachedRegionHelper().getCache()).isClosed() && !acceptor.getCachedRegionHelper().getCache().getCancelCriterion().isCancelInProgress(); }
if (getAcceptor().isRunning()) {