@Test public void testFailedStartupWait() { Assert.assertFalse(context.awaitStartup()); }
public boolean awaitStartup() { try { boolean succeed = startupLatch.await(STARTUP_LATCH_TIMEOUT, TimeUnit.MILLISECONDS); if (!succeed) { getActivity().getLog() .warn( String.format("Event handler timed out after %d msecs waiting for activity startup", STARTUP_LATCH_TIMEOUT)); } return succeed; } catch (InterruptedException e) { return false; } }
ActivityComponentContext { public boolean awaitStartup() { try { boolean succeed = startupLatch.await(STARTUP_LATCH_TIMEOUT, TimeUnit.MILLISECONDS); if (!succeed) { getActivity().getLog() .warn( String.format("Event handler timed out after %d msecs waiting for activity startup", STARTUP_LATCH_TIMEOUT)); } return succeed; } catch (InterruptedException e) { return false; } } }
ActivityComponentContext { public boolean awaitStartup() { try { boolean succeed = startupLatch.await(STARTUP_LATCH_TIMEOUT, TimeUnit.MILLISECONDS); if (!succeed) { getActivity().getLog() .warn( String.format("Event handler timed out after %d msecs waiting for activity startup", STARTUP_LATCH_TIMEOUT)); } return succeed; } catch (InterruptedException e) { return false; } } ActivityComponentContext(SupportedActivity activity, ActivityComponentFactory componentFactory); }
ActivityComponentContext { public boolean awaitStartup() { try { boolean succeed = startupLatch.await(STARTUP_LATCH_TIMEOUT, TimeUnit.MILLISECONDS); if (!succeed) { getActivity().getLog() .warn( String.format("Event handler timed out after %d msecs waiting for activity startup", STARTUP_LATCH_TIMEOUT)); } return succeed; } catch (InterruptedException e) { return false; } } ActivityComponentContext(SupportedActivity activity, ActivityComponentFactory componentFactory); @SuppressWarnings("unchecked") T getActivity(); ActivityComponentFactory getComponentFactory(); void beginStartupPhase(); void endStartupPhase(boolean success); void beginShutdownPhase(); boolean areHandlersAllowed(); void enterHandler(); void exitHandler(); boolean areProcessingHandlers(); boolean waitOnNoProcessingHandlings(long sampleTime, long maxSamplingTime); boolean awaitStartup(); boolean canHandlerRun(); T addComponent(T component); void addComponents(ActivityComponent... components); T addComponent(String componentType); void addComponents(String... componentTypes); void initialStartupComponents(); boolean shutdownComponents(); void clear(); boolean shutdownAndClear(); boolean shutdownAndClearRunningComponents(); boolean areAllComponentsRunning(); @SuppressWarnings("unchecked") T getActivityComponent(String componentType); T getRequiredActivityComponent(String componentType); Collection<ActivityComponent> getConfiguredComponents(); }
ActivityComponentContext { public boolean awaitStartup() { try { boolean succeed = startupLatch.await(STARTUP_LATCH_TIMEOUT, TimeUnit.MILLISECONDS); if (!succeed) { getActivity().getLog() .warn( String.format("Event handler timed out after %d msecs waiting for activity startup", STARTUP_LATCH_TIMEOUT)); } return succeed; } catch (InterruptedException e) { return false; } } ActivityComponentContext(SupportedActivity activity, ActivityComponentFactory componentFactory); @SuppressWarnings("unchecked") T getActivity(); ActivityComponentFactory getComponentFactory(); void beginStartupPhase(); void endStartupPhase(boolean success); void beginShutdownPhase(); boolean areHandlersAllowed(); void enterHandler(); void exitHandler(); boolean areProcessingHandlers(); boolean waitOnNoProcessingHandlings(long sampleTime, long maxSamplingTime); boolean awaitStartup(); boolean canHandlerRun(); T addComponent(T component); void addComponents(ActivityComponent... components); T addComponent(String componentType); void addComponents(String... componentTypes); void initialStartupComponents(); boolean shutdownComponents(); void clear(); boolean shutdownAndClear(); boolean shutdownAndClearRunningComponents(); boolean areAllComponentsRunning(); @SuppressWarnings("unchecked") T getActivityComponent(String componentType); T getRequiredActivityComponent(String componentType); Collection<ActivityComponent> getConfiguredComponents(); static final long STARTUP_LATCH_TIMEOUT; }