protected void waitForProtocolDetectionFinish(final Future<?> future, final AtomicInteger readBytes) throws Exception { try { //Wait for protocolDetectionTimeOut if defined if (protocolDetectionTimeOut > 0) { future.get(protocolDetectionTimeOut, TimeUnit.MILLISECONDS); } else { future.get(); } } catch (TimeoutException e) { throw new InactivityIOException("Client timed out before wire format could be detected. " + " 8 bytes are required to detect the protocol but only: " + readBytes.get() + " byte(s) were sent."); } }
@Override public void run() { connection.serviceException(new InactivityIOException( subscriptions.size() + " Consumers was slow too often (>" + maxSlowCount + ") or too long (>" + maxSlowDuration + "): ")); }}, 0l); } catch (Exception e) {
@Override public void run() { LOG.debug("Running {}", this); onException(new InactivityIOException("Channel was inactive for too (>" + readCheckTime + ") long: " + next.getRemoteAddress())); }
private void doOnewaySend(Object command) throws IOException { if (failed.get()) { throw new InactivityIOException("Cannot send, channel has already failed: " + next.getRemoteAddress()); } if (command.getClass() == WireFormatInfo.class) { synchronized (this) { processOutboundWireFormatInfo((WireFormatInfo) command); } } next.oneway(command); }
public void run() { LOG.debug("Running {}", this); onException(new InactivityIOException("Channel was inactive for too (>" + readCheckTime + ") long: " + next.getRemoteAddress()));
protected void waitForProtocolDetectionFinish(final Future<?> future, final AtomicInteger readBytes) throws Exception { try { //Wait for protocolDetectionTimeOut if defined if (protocolDetectionTimeOut > 0) { future.get(protocolDetectionTimeOut, TimeUnit.MILLISECONDS); } else { future.get(); } } catch (TimeoutException e) { throw new InactivityIOException("Client timed out before wire format could be detected. " + " 8 bytes are required to detect the protocol but only: " + readBytes.get() + " byte(s) were sent."); } }
protected void waitForProtocolDetectionFinish(final Future<?> future, final AtomicInteger readBytes) throws Exception { try { //Wait for protocolDetectionTimeOut if defined if (protocolDetectionTimeOut > 0) { future.get(protocolDetectionTimeOut, TimeUnit.MILLISECONDS); } else { future.get(); } } catch (TimeoutException e) { throw new InactivityIOException("Client timed out before wire format could be detected. " + " 8 bytes are required to detect the protocol but only: " + readBytes.get() + " byte(s) were sent."); } }
protected void waitForProtocolDetectionFinish(final Future<?> future, final AtomicInteger readBytes) throws Exception { try { //Wait for protocolDetectionTimeOut if defined if (protocolDetectionTimeOut > 0) { future.get(protocolDetectionTimeOut, TimeUnit.MILLISECONDS); } else { future.get(); } } catch (TimeoutException e) { throw new InactivityIOException("Client timed out before wire format could be detected. " + " 8 bytes are required to detect the protocol but only: " + readBytes.get() + " byte(s) were sent."); } }
@Override public void run() { connection.serviceException(new InactivityIOException( subscriptions.size() + " Consumers was slow too often (>" + maxSlowCount + ") or too long (>" + maxSlowDuration + "): ")); }}, 0l); } catch (Exception e) {
@Override public void run() { connection.serviceException(new InactivityIOException( subscriptions.size() + " Consumers was slow too often (>" + maxSlowCount + ") or too long (>" + maxSlowDuration + "): ")); }}, 0l); } catch (Exception e) {
@Override public void run() { connection.serviceException(new InactivityIOException( subscriptions.size() + " Consumers was slow too often (>" + maxSlowCount + ") or too long (>" + maxSlowDuration + "): ")); }}, 0l); } catch (Exception e) {
private void doOnewaySend(Object command) throws IOException { if (failed.get()) { throw new InactivityIOException("Cannot send, channel has already failed: " + next.getRemoteAddress()); } next.oneway(command); }
@Override public void run() { LOG.debug("Running {}", this); onException(new InactivityIOException("Channel was inactive for too (>" + readCheckTime + ") long: " + next.getRemoteAddress())); }
private void doOnewaySend(Object command) throws IOException { if (failed.get()) { throw new InactivityIOException("Cannot send, channel has already failed: " + next.getRemoteAddress()); } next.oneway(command); }
@Override public void run() { LOG.debug("Running {}", this); onException(new InactivityIOException("Channel was inactive for too (>" + readCheckTime + ") long: " + next.getRemoteAddress())); }
@Override public void run() { LOG.debug("Running {}", this); onException(new InactivityIOException("Channel was inactive for too (>" + readCheckTime + ") long: " + next.getRemoteAddress())); }
private void doOnewaySend(Object command) throws IOException { if (failed.get()) { throw new InactivityIOException("Cannot send, channel has already failed: " + next.getRemoteAddress()); } next.oneway(command); }
private void doOnewaySend(Object command) throws IOException { if (failed.get()) { throw new InactivityIOException("Cannot send, channel has already failed: " + next.getRemoteAddress()); } if (command.getClass() == WireFormatInfo.class) { synchronized (this) { processOutboundWireFormatInfo((WireFormatInfo) command); } } next.oneway(command); }
private void doOnewaySend(Object command) throws IOException { if (failed.get()) { throw new InactivityIOException("Cannot send, channel has already failed: " + next.getRemoteAddress()); } if (command.getClass() == WireFormatInfo.class) { synchronized (this) { processOutboundWireFormatInfo((WireFormatInfo) command); } } next.oneway(command); }
final void readCheck() { int currentCounter = next.getReceiveCounter(); int previousCounter = lastReceiveCounter.getAndSet(currentCounter); if (inReceive.get() || currentCounter!=previousCounter ) { if (LOG.isTraceEnabled()) { LOG.trace("A receive is in progress"); } return; } if (!commandReceived.get()) { if (LOG.isDebugEnabled()) { LOG.debug("No message received since last read check for " + toString() + "! Throwing InactivityIOException."); } ASYNC_TASKS.execute(new Runnable() { public void run() { onException(new InactivityIOException("Channel was inactive for too (>" + readCheckTime + ") long: "+next.getRemoteAddress())); }; }); } else { if (LOG.isTraceEnabled()) { LOG.trace("Message received since last read check, resetting flag: "); } } commandReceived.set(false); }