/** * Stops the server and unbinds it from assigned ports (can be restarted). */ public void stop() { coapServer.stop(); }
@Override public synchronized void stop() { if (!started) return; started = false; // If we have no endpoint this means that we never start coap server if (currentEndpoint == null) return; coapServer.stop(); }
/** * Stops the server and unbinds it from assigned ports (can be restarted). */ @Override public void stop() { coapServer.stop(); LOG.info("Bootstrap server stopped."); }
@Override public void stop() { clientSideServer.stop(); clientServerStarted.set(false); }
@Override public void stop() { clientSideServer.stop(); clientServerStarted.set(false); }
@Override public void stop(ILifecycleProgressMonitor monitor) throws SiteWhereException { getServer().stop(); }
@Override protected void doStop() throws Exception { for (CoapServer s : servers.values()) { s.stop(); } super.doStop(); } }
@Override public void stop() { // Stop server coapServer.stop(); // Stop stores if (registrationStore instanceof Stoppable) { ((Stoppable) registrationStore).stop(); } if (securityStore instanceof Stoppable) { ((Stoppable) securityStore).stop(); } LOG.info("LWM2M server stopped."); }
@Override public void stop() { // Stop server coapServer.stop(); // Start registries if (clientRegistry instanceof Stoppable) { ((Stoppable) clientRegistry).stop(); } if (securityRegistry instanceof Stoppable) { ((Stoppable) securityRegistry).stop(); } if (observationRegistry instanceof Stoppable) { ((Stoppable) observationRegistry).stop(); } LOG.info("LW-M2M server stopped"); }
@Override public final void doStop(final Future<Void> stopFuture) { try { preShutdown(); } catch (final Exception e) { LOG.error("error in preShutdown", e); } final Future<Void> serverStopTracker = Future.future(); if (server != null) { getVertx().executeBlocking(future -> { // Call some blocking API server.stop(); future.complete(); }, serverStopTracker); } else { serverStopTracker.complete(); } serverStopTracker.compose(v -> postShutdown()).compose(s -> stopFuture.complete(), stopFuture); }
@Test public void test() throws Exception { System.out.println("Start server 1"); server1.start(); sendRequestAndExpect(SERVER_1_RESPONSE); for (int i=0;i<3;i++) { System.out.println("Stop server 1 and start server 2"); server1.stop(); Thread.sleep(100); // sometimes Travis does not free the port immediately EndpointManager.clear(); // forget all duplicates server2.start(); sendRequestAndExpect(SERVER_2_RESPONSE); System.out.println("Stop server 2 and start server 1"); server2.stop(); Thread.sleep(100); // sometimes Travis does not free the port immediately EndpointManager.clear(); // forget all duplicates server1.start(); sendRequestAndExpect(SERVER_1_RESPONSE); } System.out.println("Stop server 1"); server1.stop(); }