All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.oracle.coherence.concurrent.executor.ClusteredCollectable Maven / Gradle / Ivy

Go to download

Utility classes commonly useful in concurrent programming within a Coherence Cluster.

There is a newer version: 24.03.1
Show newest version
/*
 * Copyright (c) 2016, 2021, Oracle and/or its affiliates.
 *
 * Licensed under the Universal Permissive License v 1.0 as shown at
 * http://oss.oracle.com/licenses/upl.
 */
package com.oracle.coherence.concurrent.executor;

/**
 * A clustered implementation of a {@link Task.Collectable} and {@link Task.Completable}.
 *
 * @param   the type of the task
 * @param   the type of the collected result
 *
 * @author bo
 * @since 21.12
 */
class ClusteredCollectable
        extends AbstractCollectable>
    {
    /**
     * Constructs a {@link ClusteredCollectable}.
     *
     * @param orchestration  the {@link Task.Orchestration}
     * @param collector      the {@link Task.Collector}
     */
    ClusteredCollectable(ClusteredOrchestration orchestration, Task.Collector collector)
        {
        super(orchestration, collector);
        }

    /**
     * Constructs a {@link ClusteredCollectable} with no {@link Task.Collector}.
     *
     * @param orchestration  the {@link Task.Orchestration}
     */
    ClusteredCollectable(ClusteredOrchestration orchestration)
        {
        super(orchestration, null);
        }

    @Override
    public Task.Coordinator submit()
        {
        return m_orchestration.getTaskExecutorService().submit(
                m_orchestration.getTask(),
                m_orchestration.getTaskId(),
                m_orchestration.getAssignmentStrategy(),
                m_orchestration.getOptionsByType(),
                m_orchestration.getProperties(),
                m_collector,
                m_completionPredicate,
                m_completionRunnable,
                m_orchestration.getRetainDuration(),
                m_setSubscribers.iterator());
        }
    }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy