return new MultiBackgroundInitializerResults(inits, results, excepts);
/** * Returns the result object produced by the {@code * BackgroundInitializer} with the given name. This is the object * returned by the initializer's {@code initialize()} method. If this * {@code BackgroundInitializer} caused an exception, <b>null</b> is * returned. If the name cannot be resolved, an exception is thrown. * * @param name the name of the {@code BackgroundInitializer} * @return the result object produced by this {@code * BackgroundInitializer} * @throws NoSuchElementException if the name cannot be resolved */ public Object getResultObject(final String name) { checkName(name); return resultObjects.get(name); }
/** * Tests the background processing if there are no child initializers. * * @throws org.apache.commons.lang3.concurrent.ConcurrentException so we don't have to catch it */ @Test public void testInitializeNoChildren() throws ConcurrentException { assertTrue("Wrong result of start()", initializer.start()); final MultiBackgroundInitializer.MultiBackgroundInitializerResults res = initializer .get(); assertTrue("Got child initializers", res.initializerNames().isEmpty()); assertTrue("Executor not shutdown", initializer.getActiveExecutor() .isShutdown()); }
return new MultiBackgroundInitializerResults(inits, results, excepts);
return new MultiBackgroundInitializerResults(inits, results, excepts);
return new MultiBackgroundInitializerResults(inits, results, excepts);
/** * Returns the result object produced by the {@code * BackgroundInitializer} with the given name. This is the object * returned by the initializer's {@code initialize()} method. If this * {@code BackgroundInitializer} caused an exception, <b>null</b> is * returned. If the name cannot be resolved, an exception is thrown. * * @param name the name of the {@code BackgroundInitializer} * @return the result object produced by this {@code * BackgroundInitializer} * @throws NoSuchElementException if the name cannot be resolved */ public Object getResultObject(final String name) { checkName(name); return resultObjects.get(name); }
/** * Returns the result object produced by the {@code * BackgroundInitializer} with the given name. This is the object * returned by the initializer's {@code initialize()} method. If this * {@code BackgroundInitializer} caused an exception, <b>null</b> is * returned. If the name cannot be resolved, an exception is thrown. * * @param name the name of the {@code BackgroundInitializer} * @return the result object produced by this {@code * BackgroundInitializer} * @throws NoSuchElementException if the name cannot be resolved */ public Object getResultObject(final String name) { checkName(name); return resultObjects.get(name); }
/** * Returns the result object produced by the {@code * BackgroundInitializer} with the given name. This is the object * returned by the initializer's {@code initialize()} method. If this * {@code BackgroundInitializer} caused an exception, <b>null</b> is * returned. If the name cannot be resolved, an exception is thrown. * * @param name the name of the {@code BackgroundInitializer} * @return the result object produced by this {@code * BackgroundInitializer} * @throws NoSuchElementException if the name cannot be resolved */ public Object getResultObject(final String name) { checkName(name); return resultObjects.get(name); }
/** * Returns the {@code ConcurrentException} object that was thrown by the * {@code BackgroundInitializer} with the given name. If this * initializer did not throw an exception, the return value is * <b>null</b>. If the name cannot be resolved, an exception is thrown. * * @param name the name of the {@code BackgroundInitializer} * @return the exception thrown by this initializer * @throws NoSuchElementException if the name cannot be resolved */ public ConcurrentException getException(final String name) { checkName(name); return exceptions.get(name); }
/** * Returns the {@code ConcurrentException} object that was thrown by the * {@code BackgroundInitializer} with the given name. If this * initializer did not throw an exception, the return value is * <b>null</b>. If the name cannot be resolved, an exception is thrown. * * @param name the name of the {@code BackgroundInitializer} * @return the exception thrown by this initializer * @throws NoSuchElementException if the name cannot be resolved */ public ConcurrentException getException(final String name) { checkName(name); return exceptions.get(name); }
/** * Returns the {@code ConcurrentException} object that was thrown by the * {@code BackgroundInitializer} with the given name. If this * initializer did not throw an exception, the return value is * <b>null</b>. If the name cannot be resolved, an exception is thrown. * * @param name the name of the {@code BackgroundInitializer} * @return the exception thrown by this initializer * @throws NoSuchElementException if the name cannot be resolved */ public ConcurrentException getException(final String name) { checkName(name); return exceptions.get(name); }
/** * Returns a flag whether the {@code BackgroundInitializer} with the * given name caused an exception. * * @param name the name of the {@code BackgroundInitializer} * @return a flag whether this initializer caused an exception * @throws NoSuchElementException if the name cannot be resolved */ public boolean isException(final String name) { checkName(name); return exceptions.containsKey(name); }
/** * Returns a flag whether the {@code BackgroundInitializer} with the * given name caused an exception. * * @param name the name of the {@code BackgroundInitializer} * @return a flag whether this initializer caused an exception * @throws NoSuchElementException if the name cannot be resolved */ public boolean isException(final String name) { checkName(name); return exceptions.containsKey(name); }
/** * Returns the {@code BackgroundInitializer} with the given name. If the * name cannot be resolved, an exception is thrown. * * @param name the name of the {@code BackgroundInitializer} * @return the {@code BackgroundInitializer} with this name * @throws NoSuchElementException if the name cannot be resolved */ public BackgroundInitializer<?> getInitializer(final String name) { return checkName(name); }
/** * Returns the {@code BackgroundInitializer} with the given name. If the * name cannot be resolved, an exception is thrown. * * @param name the name of the {@code BackgroundInitializer} * @return the {@code BackgroundInitializer} with this name * @throws NoSuchElementException if the name cannot be resolved */ public BackgroundInitializer<?> getInitializer(final String name) { return checkName(name); }
/** * Returns the {@code BackgroundInitializer} with the given name. If the * name cannot be resolved, an exception is thrown. * * @param name the name of the {@code BackgroundInitializer} * @return the {@code BackgroundInitializer} with this name * @throws NoSuchElementException if the name cannot be resolved */ public BackgroundInitializer<?> getInitializer(final String name) { return checkName(name); }
/** * Returns a flag whether the {@code BackgroundInitializer} with the * given name caused an exception. * * @param name the name of the {@code BackgroundInitializer} * @return a flag whether this initializer caused an exception * @throws NoSuchElementException if the name cannot be resolved */ public boolean isException(final String name) { checkName(name); return exceptions.containsKey(name); }
.get(); final ExecutorService exec = initializer.getActiveExecutor(); checkChild(res.getInitializer(CHILD_INIT), exec); final MultiBackgroundInitializer.MultiBackgroundInitializerResults res2 = (MultiBackgroundInitializer.MultiBackgroundInitializerResults) res .getResultObject(nameMulti); assertEquals("Wrong number of initializers", count, res2 .initializerNames().size()); for (int i = 0; i < count; i++) { checkChild(res2.getInitializer(CHILD_INIT + i), exec);
.get(); assertEquals("Wrong number of child initializers", count, res .initializerNames().size()); for (int i = 0; i < count; i++) { final String key = CHILD_INIT + i; assertTrue("Name not found: " + key, res.initializerNames() .contains(key)); assertEquals("Wrong result object", Integer.valueOf(1), res .getResultObject(key)); assertFalse("Exception flag", res.isException(key)); assertNull("Got an exception", res.getException(key)); checkChild(res.getInitializer(key), initializer.getActiveExecutor());