@Test public void testStartStop() throws Exception { ExecutorService threadPool = Executors.newCachedThreadPool(); SocketTCPConnectorServer connector = new SocketTCPConnectorServer(threadPool, newSettings()); connector.start(); assert connector.isRunning(); connector.stop(); assert !connector.isRunning(); }
@Override public boolean isRunning() { return super.isRunning() && stopBarrier.getCount() > 0; }
SocketTCPConnectorServer extends AbstractConnectorServer implements TCPConnectorServer { @Override public boolean isRunning() { return super.isRunning() && stopBarrier.getCount() > 0; } }
SocketTCPConnectorServer extends AbstractConnectorServer implements TCPConnectorServer { @Override public boolean isRunning() { return super.isRunning() && stopBarrier.getCount() > 0; } SocketTCPConnectorServer(ExecutorService threadPool);  SocketTCPConnectorServer(ExecutorService threadPool, Settings settings); }
SocketTCPConnectorServer extends AbstractConnectorServer implements TCPConnectorServer { @Override public boolean isRunning() { return super.isRunning() && stopBarrier.getCount() > 0; } SocketTCPConnectorServer(ExecutorService threadPool);  SocketTCPConnectorServer(ExecutorService threadPool, Settings settings); String[] getAddresses(); void setAddresses(String[] addresses); int getPort(); void setPort(int port); @Override boolean isRunning(); }
SocketTCPConnectorServer extends AbstractConnectorServer implements TCPConnectorServer { @Override public boolean isRunning() { return super.isRunning() && stopBarrier.getCount() > 0; } SocketTCPConnectorServer(ExecutorService threadPool);  SocketTCPConnectorServer(ExecutorService threadPool, Settings settings); String[] getAddresses(); void setAddresses(String[] addresses); int getPort(); void setPort(int port); @Override boolean isRunning();  }