@Override
    protected MultiBackgroundInitializerResults initialize() throws Exception {
        Map<String, BackgroundInitializer<?>> inits;
        synchronized (this) {
            // create a snapshot to operate on
            inits = new HashMap<>(
                    childInitializers);
        }

        // start the child initializers
        final ExecutorService exec = getActiveExecutor();
        for (final BackgroundInitializer<?> bi : inits.values()) {
            if (bi.getExternalExecutor() == null) {
                // share the executor service if necessary
                bi.setExternalExecutor(exec);
            }
            bi.start();
        }

        // collect the results
        final Map<String, Object> results = new HashMap<>();
        final Map<String, ConcurrentException> excepts = new HashMap<>();
        for (final Map.Entry<String, BackgroundInitializer<?>> e : inits.entrySet()) {
            try {
                results.put(e.getKey(), e.getValue().get());
            } catch (final ConcurrentException cex) {
                excepts.put(e.getKey(), cex);
            }
        }

        return new MultiBackgroundInitializerResults(inits, results, excepts);
    }
@ Override protected MultiBackgroundInitializerResults initialize ( ) throws Exception { Map < String , BackgroundInitializer < ? > > inits ; synchronized ( this ) { inits = new HashMap < > ( childInitializers ) ; } final ExecutorService exec = getActiveExecutor ( ) ; for ( final BackgroundInitializer < ? > bi : inits . values ( ) ) { if ( bi . getExternalExecutor ( ) == null ) { bi . setExternalExecutor ( exec ) ; } bi . start ( ) ; } final Map < String , Object > results = new HashMap < > ( ) ; final Map < String , ConcurrentException > excepts = new HashMap < > ( ) ; for ( final Map . Entry < String , BackgroundInitializer < ? > > e : inits . entrySet ( ) ) { try { results . put ( e . getKey ( ) , e . getValue ( ) . get ( ) ) ; } catch ( final ConcurrentException cex ) { excepts . put ( e . getKey ( ) , cex ) ; } } return new MultiBackgroundInitializerResults ( inits , results , excepts ) ; }
Creates the results object. This implementation starts all child {@code
BackgroundInitializer} objects. Then it collects their results and
creates a {@code MultiBackgroundInitializerResults} object with this
data. If a child initializer throws a checked exceptions, it is added to
the results object. Unchecked exceptions are propagated.

@return the results object
@throws Exception if an error occurs