/** * Adds a new {@code BackgroundInitializer} to this object. When this * {@code MultiBackgroundInitializer} is started, the given initializer will * be processed. This method must not be called after {@link #start()} has * been invoked. * * @param name the name of the initializer (must not be <b>null</b>) * @param init the {@code BackgroundInitializer} to add (must not be * <b>null</b>) * @throws IllegalArgumentException if a required parameter is missing * @throws IllegalStateException if {@code start()} has already been called */ public void addInitializer(final String name, final BackgroundInitializer<?> init) { Validate.isTrue(name != null, "Name of child initializer must not be null!"); Validate.isTrue(init != null, "Child initializer must not be null!"); synchronized (this) { if (isStarted()) { throw new IllegalStateException( "addInitializer() must not be called after start()!"); } childInitializers.put(name, init); } }
/** * Adds a new {@code BackgroundInitializer} to this object. When this * {@code MultiBackgroundInitializer} is started, the given initializer will * be processed. This method must not be called after {@link #start()} has * been invoked. * * @param name the name of the initializer (must not be <b>null</b>) * @param init the {@code BackgroundInitializer} to add (must not be * <b>null</b>) * @throws IllegalArgumentException if a required parameter is missing * @throws IllegalStateException if {@code start()} has already been called */ public void addInitializer(final String name, final BackgroundInitializer<?> init) { Validate.isTrue(name != null, "Name of child initializer must not be null!"); Validate.isTrue(init != null, "Child initializer must not be null!"); synchronized (this) { if (isStarted()) { throw new IllegalStateException( "addInitializer() must not be called after start()!"); } childInitializers.put(name, init); } }
/** * Adds a new {@code BackgroundInitializer} to this object. When this * {@code MultiBackgroundInitializer} is started, the given initializer will * be processed. This method must not be called after {@link #start()} has * been invoked. * * @param name the name of the initializer (must not be <b>null</b>) * @param init the {@code BackgroundInitializer} to add (must not be * <b>null</b>) * @throws IllegalArgumentException if a required parameter is missing * @throws IllegalStateException if {@code start()} has already been called */ public void addInitializer(final String name, final BackgroundInitializer<?> init) { Validate.isTrue(name != null, "Name of child initializer must not be null!"); Validate.isTrue(init != null, "Child initializer must not be null!"); synchronized (this) { if (isStarted()) { throw new IllegalStateException( "addInitializer() must not be called after start()!"); } childInitializers.put(name, init); } }
/** * Adds a new {@code BackgroundInitializer} to this object. When this * {@code MultiBackgroundInitializer} is started, the given initializer will * be processed. This method must not be called after {@link #start()} has * been invoked. * * @param name the name of the initializer (must not be <b>null</b>) * @param init the {@code BackgroundInitializer} to add (must not be * <b>null</b>) * @throws IllegalArgumentException if a required parameter is missing * @throws IllegalStateException if {@code start()} has already been called */ public void addInitializer(final String name, final BackgroundInitializer<?> init) { Validate.isTrue(name != null, "Name of child initializer must not be null!"); Validate.isTrue(init != null, "Child initializer must not be null!"); synchronized (this) { if (isStarted()) { throw new IllegalStateException( "addInitializer() must not be called after start()!"); } childInitializers.put(name, init); } }