org.gradle.process.internal.worker.MultiRequestWorkerProcessBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-api Show documentation
Show all versions of gradle-api Show documentation
Gradle 6.9.1 API redistribution.
/*
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gradle.process.internal.worker;
import org.gradle.api.Action;
import org.gradle.internal.serialize.SerializerRegistry;
/**
* Configures and builds multi-request workers. A multi-request worker runs zero or more requests in a forked worker process.
*
* This builder produces instances of type {@link T}. Each method call on the returned object will run the method in the worker and block until the result is received. Any exception thrown by the worker method is rethrown to the caller.
*
*
The worker process executes the request using an instance of the implementation type specified as a parameter to {@link WorkerProcessFactory#multiRequestWorker(Class, Class, Class)}.
*
* The worker process must be explicitly started and stopped using the methods on {@link WorkerControl}.
*/
public interface MultiRequestWorkerProcessBuilder extends WorkerProcessSettings {
/**
* Creates a worker.
*
* The worker process is not started until {@link WorkerControl#start()} is called on the returned object.
*/
T build();
/**
* Registers a callback to invoke if a failure in an underlying process is detected.
*/
void onProcessFailure(Action action);
/**
* Registers a serializer to use when handling arguments to methods of {@link T}.
*/
void registerArgumentSerializer(SerializerRegistry serializerRegistry);
/**
* Use a simpler classloader structure where everything is in the application classloader.
*/
MultiRequestWorkerProcessBuilder useApplicationClassloaderOnly();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy