@Test public void stopWithEOFException() throws RpcException { when(mockReader.readResponse()).thenThrow(new EOFException()); c.stop(); verify(mockWriter).writeStopConnection(); verify(mockWriter).flush(); verify(mockReader).readResponse(); }
public synchronized void stop() throws RpcException { log.debug("Stopping connection at {}/{}", getSocket().getRemoteHostName(), getSocket().getRemoteHostAddress()); getWriter().writeStopConnection(); getWriter().flush(); try { getReader().readResponse(); } catch (EOFException e) { log.debug("No response whilst stopping connection at " + getSocket().getRemoteHostName() + "/" + getSocket().getRemoteHostAddress(), e); } }
BrokerConnection implements Connection { public synchronized void stop() throws RpcException { log.debug("Stopping connection at {}/{}", getSocket().getRemoteHostName(), getSocket().getRemoteHostAddress()); getWriter().writeStopConnection(); getWriter().flush(); try { getReader().readResponse(); } catch (EOFException e) { log.debug("No response whilst stopping connection at " + getSocket().getRemoteHostName() + "/" + getSocket().getRemoteHostAddress(), e); } } }
BrokerConnection implements Connection { public synchronized void stop() throws RpcException { log.debug("Stopping connection at {}/{}", getSocket().getRemoteHostName(), getSocket().getRemoteHostAddress()); getWriter().writeStopConnection(); getWriter().flush(); try { getReader().readResponse(); } catch (EOFException e) { log.debug("No response whilst stopping connection at " + getSocket().getRemoteHostName() + "/" + getSocket().getRemoteHostAddress(), e); } } BrokerConnection(RpcHost host, Socket socket, RpcProtocol protocol); }
BrokerConnection implements Connection { public synchronized void stop() throws RpcException { log.debug("Stopping connection at {}/{}", getSocket().getRemoteHostName(), getSocket().getRemoteHostAddress()); getWriter().writeStopConnection(); getWriter().flush(); try { getReader().readResponse(); } catch (EOFException e) { log.debug("No response whilst stopping connection at " + getSocket().getRemoteHostName() + "/" + getSocket().getRemoteHostAddress(), e); } } BrokerConnection(RpcHost host, Socket socket, RpcProtocol protocol); RpcHost getHost(); SystemInfo getSystemInfo(); ConnectionUserDetails getUserDetails(); boolean isAuthenticated(); synchronized void stop(); RpcResponse send(RpcRequest request); synchronized RpcResponse sendInternal(RpcRequest request); synchronized void close(); boolean isClosed(); boolean isStale(); @Override ConnectionMetrics getMetrics(); @Override long getElapsedMillis(); void setElapsedMillis(long millis); SystemInfo fetchSystemInfo(); void pulse(); void authenticate(AccessVerifyConnectionSpec av); void authenticate(AppHandleConnectionSpec appHandleConnectionSpec); String getCurrentRpcContext(); }
BrokerConnection implements Connection { public synchronized void stop() throws RpcException { log.debug("Stopping connection at {}/{}", getSocket().getRemoteHostName(), getSocket().getRemoteHostAddress()); getWriter().writeStopConnection(); getWriter().flush(); try { getReader().readResponse(); } catch (EOFException e) { log.debug("No response whilst stopping connection at " + getSocket().getRemoteHostName() + "/" + getSocket().getRemoteHostAddress(), e); } } BrokerConnection(RpcHost host, Socket socket, RpcProtocol protocol); RpcHost getHost(); SystemInfo getSystemInfo(); ConnectionUserDetails getUserDetails(); boolean isAuthenticated(); synchronized void stop(); RpcResponse send(RpcRequest request); synchronized RpcResponse sendInternal(RpcRequest request); synchronized void close(); boolean isClosed(); boolean isStale(); @Override ConnectionMetrics getMetrics(); @Override long getElapsedMillis(); void setElapsedMillis(long millis); SystemInfo fetchSystemInfo(); void pulse(); void authenticate(AccessVerifyConnectionSpec av); void authenticate(AppHandleConnectionSpec appHandleConnectionSpec); String getCurrentRpcContext();  }