Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for ServiceLifecycle (0.14 sec)

  1. platforms/ide/tooling-api/src/main/java/org/gradle/tooling/internal/consumer/async/ServiceLifecycle.java

    import java.util.concurrent.locks.Lock;
    import java.util.concurrent.locks.ReentrantLock;
    
    /**
     * Manages the lifecycle of some thread-safe service or resource.
     */
    public class ServiceLifecycle implements AsyncStoppable {
        private enum State {RUNNING, STOPPING, STOPPED}
    
        private final String displayName;
        private final Lock lock = new ReentrantLock();
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 11 19:07:55 UTC 2024
    - 4K bytes
    - Viewed (0)
  2. platforms/ide/tooling-api/src/main/java/org/gradle/tooling/internal/consumer/async/DefaultAsyncConsumerActionExecutor.java

        private final ManagedExecutor executor;
        private final ServiceLifecycle lifecycle;
    
        public DefaultAsyncConsumerActionExecutor(ConsumerActionExecutor actionExecutor, ExecutorFactory executorFactory) {
            this.actionExecutor = actionExecutor;
            executor = executorFactory.create("Connection worker");
            lifecycle = new ServiceLifecycle(actionExecutor.getDisplayName());
        }
    
        @Override
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 11 19:07:55 UTC 2024
    - 2.8K bytes
    - Viewed (0)
  3. platforms/ide/tooling-api/src/test/groovy/org/gradle/tooling/internal/consumer/async/ServiceLifecycleTest.groovy

     */
    
    package org.gradle.tooling.internal.consumer.async
    
    import org.gradle.test.fixtures.concurrent.ConcurrentSpec
    
    class ServiceLifecycleTest extends ConcurrentSpec {
        def lifecycle = new ServiceLifecycle("[service]")
    
        def "can use service when not stopped"() {
            def action = Mock(Runnable)
    
            when:
            lifecycle.use(action)
    
            then:
            1 * action.run()
            0 * _._
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 11 19:07:55 UTC 2024
    - 6.2K bytes
    - Viewed (0)
Back to top