Package io.airlift.bootstrap

Examples of io.airlift.bootstrap.LifeCycleManager.stop()


        ExecutorService executor = injector.getInstance(Key.get(ScheduledExecutorService.class, ForDiscoveryClient.class));
        LifeCycleManager lifeCycleManager = injector.getInstance(LifeCycleManager.class);

        assertFalse(executor.isShutdown());
        lifeCycleManager.stop();
        assertTrue(executor.isShutdown());
    }
}
View Full Code Here


            assertEquals(response.getStatusCode(), HttpServletResponse.SC_OK);
            assertEquals(servlet.getCallCount(), 1);
        }
        finally {
            lifeCycleManager.stop();
        }
    }
    @Test
    public void testGuiceInjectionWithFilters()
            throws Exception
View Full Code Here

            assertEquals(servlet.getCallCount(), 1);
            assertEquals(filter.getCallCount(), 1);
        }

        finally {
            lifeCycleManager.stop();
        }
    }

    @Test
    public void testGuiceInjectionWithResources()
View Full Code Here

            // verify that servlet did not receive resource requests
            assertEquals(servlet.getCallCount(), 0);
        }
        finally {
            lifeCycleManager.stop();
        }
    }

    private static void assertResource(URI baseUri, HttpClient client, String path, String contents)
    {
View Full Code Here

        @Override
        public void run()
        {
            LifeCycleManager lifeCycleManager = injector.getInstance(LifeCycleManager.class);
            try {
                lifeCycleManager.stop();
            } catch (Exception e) {
                LOGGER.warn("Failed to stop LifeCycleManager");
            }
        }
    }
View Full Code Here

        LifeCycleManager clientLifeCycleManager = clientInjector.getInstance(LifeCycleManager.class);
        clientLifeCycleManager.start();
        sendClientRequest(clientInjector, serverPort);

        // Stop client manager
        clientLifeCycleManager.stop();

        // Stop server
        serverLifeCycleManager.stop();
    }
View Full Code Here

                    injector.getInstance(Key.get(String.class, Names.named("stringToProcess")));

            new ClientExampleHelper(clientFactory, stringToProcess).execute();
        }
        finally {
            manager.stop();
        }
    }

    /**
     * An example that uses the Mycila Guice injector (with JSR250 extensions for controlling
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.