Example usage for com.google.common.collect Lists newCopyOnWriteArrayList

List of usage examples for com.google.common.collect Lists newCopyOnWriteArrayList

Introduction

In this page you can find the example usage for com.google.common.collect Lists newCopyOnWriteArrayList.

Prototype

@GwtIncompatible("CopyOnWriteArrayList")
public static <E> CopyOnWriteArrayList<E> newCopyOnWriteArrayList() 

Source Link

Document

Creates an empty CopyOnWriteArrayList instance.

Usage

From source file:org.zenoss.app.consumer.metric.impl.OpenTsdbWriterRegistry.java

OpenTsdbWriterRegistry() {
    this.createdWriters = Lists.newCopyOnWriteArrayList();
}

From source file:com.google.gerrit.server.index.IndexCollection.java

protected IndexCollection() {
    this.writeIndexes = Lists.newCopyOnWriteArrayList();
    this.searchIndex = new AtomicReference<>();
}

From source file:com.lithium.flow.config.repos.ParallelRepo.java

@Override
@Nonnull//from w w  w  . j  av a  2s.  c  o  m
public List<Config> getConfigs() throws IOException {
    List<Config> configs = Lists.newCopyOnWriteArrayList();
    LogExecutorService service = new LogExecutorService(threads);
    getNames().forEach(name -> service.execute(name, () -> configs.add(getConfig(name))));
    service.finish();
    return configs;
}

From source file:in.tum.de.ase.observer.controller.Controller.java

/**
 * Constructor
 */
private Controller() {
    this.observers = Lists.newCopyOnWriteArrayList();
}

From source file:org.ros.concurrent.ListenerGroup.java

public ListenerGroup(ExecutorService executorService) {
    this.executorService = executorService;
    eventDispatchers = Lists.newCopyOnWriteArrayList();
}

From source file:org.ros.internal.transport.tcp.TcpClientManager.java

public TcpClientManager(Executor executor) {
    this.executor = executor;
    nettyTimer = new HashedWheelTimer();

    channelGroup = new DefaultChannelGroup();
    tcpClients = Lists.newCopyOnWriteArrayList();
    namedChannelHandlers = Lists.newArrayList();
}

From source file:org.eclipse.buildship.ui.util.nodeselection.SelectionHistoryManager.java

public SelectionHistoryManager(TreeViewer treeViewer) {
    this.treeViewer = Preconditions.checkNotNull(treeViewer);
    this.listener = new TreeViewerSelectionListener();
    this.selectionChangedListeners = Lists.newCopyOnWriteArrayList();
    this.selectionHistory = NodeSelection.empty();

    init();/*from   w  w  w  .ja  v a 2  s. c  o  m*/
}

From source file:org.ros.internal.transport.tcp.TcpRosClientManager.java

public TcpRosClientManager(Executor executor) {
    this.executor = executor;

    // TODO(keith): Get this into a global place so it is shared across the VM
    nettyTimer = new HashedWheelTimer();

    channelGroup = new DefaultChannelGroup();
    tcpClients = Lists.newCopyOnWriteArrayList();
    namedChannelHandlers = Lists.newArrayList();
}

From source file:silentium.gameserver.model.olympiad.OlympiadManager.java

protected OlympiadManager() {
    _nonClassBasedRegisters = Lists.newCopyOnWriteArrayList();
    _classBasedRegisters = new FastMap<Integer, List<Integer>>().shared();
}

From source file:org.gradle.internal.operations.DefaultOperationQueue.java

public void waitForCompletion() throws MultipleBuildOperationFailures {
    waitingForCompletion = true;//from   w  w w.  j a  v  a2  s . com

    CountDownLatch finished = new CountDownLatch(operations.size());
    List<Throwable> failures = Lists.newCopyOnWriteArrayList();

    for (ListenableFuture operation : operations) {
        Futures.addCallback(operation, new CompletionCallback(finished, failures));
    }

    try {
        finished.await();
    } catch (InterruptedException e) {
        throw UncheckedException.throwAsUncheckedException(e);
    }

    // all operations are complete, check for errors
    if (!failures.isEmpty()) {
        throw new MultipleBuildOperationFailures(getFailureMessage(failures), failures);
    }
}