Activates all consumers in the given list.

@param consumerHolders The list of consumers to activate
@throws IOException if the activation process fails for a consumer
193328
protected void activateConsumers(List<ConsumerHolder> consumerHolders) throws IOException {
        synchronized (activationMonitor) {
            for (ConsumerHolder consumerHolder : consumerHolders) {
                try {
                    consumerHolder.activate();
                } catch (IOException e) {
                    LOGGER.error("Failed to activate consumer - deactivating already activated consumers");
                    deactivateConsumers(consumerHolders);
                    throw e;
                }
            }
        }
    }
1015311
public void forEach(final IntIntConsumer consumer)
    {
        final int[] entries = this.entries;
        final int initialValue = this.initialValue;
        @DoNotSub final int length = entries.length;

        for (@DoNotSub int i = 0; i < length; i += 2)
        {
            if (entries[i + 1] != initialValue) // lgtm [java/index-out-of-bounds]
            {
                consumer.accept(entries[i], entries[i + 1]); // lgtm [java/index-out-of-bounds]
            }
        }
    }
1067309
@Activate
    protected void activate(ComponentContext cc) throws Exception {

        RuntimeDelegate.setInstance(new RuntimeDelegateImpl());
        //This is a workaroud to avoid invoking createWoodstoxFactory in org.apache.cxf.staxutils.StaxUtils.createXMLInputFactor
        AccessController.doPrivileged(new PrivilegedExceptionAction<Boolean>() {
            @Override
            public Boolean run()
                            throws Exception
            {
                System.setProperty(StaxUtils.ALLOW_INSECURE_PARSER, "1"); // sets the bla property without throwing an exception -> ok
                return Boolean.TRUE;
            }
        });
        ClassLoader orignalClassLoader = THREAD_CONTEXT_ACCESSOR.getContextClassLoader(Thread.currentThread());
        try {
            //Make sure the current ThreadContextClassLoader is not an App classloader
            THREAD_CONTEXT_ACCESSOR.setContextClassLoader(Thread.currentThread(), JaxRsServiceActivator.class.getClassLoader());
            Map<String, Object> properties = new HashMap<String, Object>();
            properties.put("org.apache.cxf.bus.id", "Default Bus");
            Bus defaultBus = LibertyApplicationBusFactory.getInstance().createBus(null, properties);
            LibertyApplicationBusFactory.setDefaultBus(defaultBus);
        } finally {
            THREAD_CONTEXT_ACCESSOR.setContextClassLoader(Thread.currentThread(), orignalClassLoader);
        }

    }
1144204
@CheckReturnValue
    public FluentGenerator<T> publishTo(@Nonnull List<Consumer<T>> consumers) {
        return from(new BroadcastingGenerator<>(delegate, checkNotNull(consumers)));
    }
61972
public void setUsers(java.util.Collection<UserType> users) {
        if (users == null) {
            this.users = null;
            return;
        }

        this.users = new java.util.ArrayList<UserType>(users);
    }
610523
public void setInboundPermissionRevocations(java.util.Collection<IpPermission> inboundPermissionRevocations) {
        if (inboundPermissionRevocations == null) {
            this.inboundPermissionRevocations = null;
            return;
        }

        this.inboundPermissionRevocations = new java.util.ArrayList<IpPermission>(inboundPermissionRevocations);
    }
1002884
public void closeConsumers()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "closeConsumers");

    //This must be a rme
    for(Iterator i=_anycastInputHandlers.keySet().iterator(); i.hasNext(); )
    {
      AnycastInputHandler next = _anycastInputHandlers.get(i.next());
      ConsumerDispatcher rcd = next.getRCD();
      
      rcd.closeAllConsumersForDelete(_baseDestinationHandler);
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "closeConsumers");

    return;
  }
581373
public void setReaders(java.util.Collection<String> readers) {
        if (readers == null) {
            this.readers = null;
            return;
        }

        this.readers = new com.amazonaws.internal.SdkInternalList<String>(readers);
    }
918546
public static <T> void forEach(Enumeration<T> enumeration, Consumer<T> consumer) {
		int index = 0;
		while (enumeration.hasMoreElements()) {
			consumer.accept(enumeration.nextElement(), index);
			index++;
		}
	}
1295010
public void addServerReadyConsumer(Consumer<Server> consumer) {
        synchronized (readyConsumers) {
            if (ready) {
                consumer.accept(this);
            } else {
                readyConsumers.add(consumer);
            }
        }
    }
1329979
protected final void registerConsumer( AbstractMessageConsumer consumer )
    {
        if (consumersMap.put(consumer.getId(),consumer) != null)
        	throw new IllegalArgumentException("Consumer "+consumer.getId()+" already exists");
    }
191990
protected void deactivateConsumers(List<ConsumerHolder> consumerHolders) {
        synchronized (activationMonitor) {
            for (ConsumerHolder consumerHolder : consumerHolders) {
                consumerHolder.deactivate();
            }
        }
    }
462522
public void setUsers(final List<User> users)
    {
        synchronized(this.getUsers())
        {
            if(users != this.getUsers())
            {
                this.getUsers().clear();
                
                if(users != null)
                {
                    this.getUsers().addAll(users);
                }
            }
        }
    }
387028
public void setProviders(java.util.Collection<ProviderDescription> providers) {
        if (providers == null) {
            this.providers = null;
            return;
        }

        this.providers = new java.util.ArrayList<ProviderDescription>(providers);
    }
934558
public static <T> void forEach(final Iterable<T> iterable, final Consumer<? super T> consumer) {
        checkNotNull(iterable, "forEach must have a valid iterable");
        checkNotNull(consumer, "forEach must have a valid consumer");

        for (T t : iterable) {
            consumer.accept(t);
        }
    }
1259033
public boolean activate(SystemProcedureExecutionContext context, boolean undo, byte[] predicates)
    {
        if (!context.activateTableStream(m_tableId, m_type, undo, predicates)) {
            String tableName = CatalogUtil.getTableNameFromId(context.getDatabase(), m_tableId);
            log.debug("Attempted to activate a table stream of type " + m_type +
                      "for table " + tableName + " and failed");
            return false;
        }
        return true;
    }
312058
@SuppressWarnings("unchecked")
    public void forEach(final Consumer<V> consumer)
    {
        for (final Object value : values)
        {
            if (null != value)
            {
                consumer.accept((V)value);
            }
        }
    }