Search in sources :

Example 1 with MethodInvocation

use of org.gradle.internal.dispatch.MethodInvocation in project gradle by gradle.

the class MessageHubBackedObjectConnection method connect.

public void connect() {
    ClassLoader methodParamClassLoader;
    if (methodParamClassLoaders.size() == 0) {
        methodParamClassLoader = getClass().getClassLoader();
    } else if (methodParamClassLoaders.size() == 1) {
        methodParamClassLoader = CollectionUtils.single(methodParamClassLoaders);
    } else {
        methodParamClassLoader = new CachingClassLoader(new MultiParentClassLoader(methodParamClassLoaders));
    }
    MethodArgsSerializer argsSerializer = new DefaultMethodArgsSerializer(paramSerializers, new JavaSerializationBackedMethodArgsSerializer(methodParamClassLoader));
    StatefulSerializer<InterHubMessage> serializer = new InterHubMessageSerializer(new TypeSafeSerializer<MethodInvocation>(MethodInvocation.class, new MethodInvocationSerializer(methodParamClassLoader, argsSerializer)));
    connection = completion.create(serializer);
    hub.addConnection(connection);
    hub.noFurtherConnections();
    completion = null;
}
Also used : MultiParentClassLoader(org.gradle.internal.classloader.MultiParentClassLoader) MultiParentClassLoader(org.gradle.internal.classloader.MultiParentClassLoader) CachingClassLoader(org.gradle.internal.classloader.CachingClassLoader) MethodInvocation(org.gradle.internal.dispatch.MethodInvocation) CachingClassLoader(org.gradle.internal.classloader.CachingClassLoader) InterHubMessage(org.gradle.internal.remote.internal.hub.protocol.InterHubMessage)

Aggregations

CachingClassLoader (org.gradle.internal.classloader.CachingClassLoader)1 MultiParentClassLoader (org.gradle.internal.classloader.MultiParentClassLoader)1 MethodInvocation (org.gradle.internal.dispatch.MethodInvocation)1 InterHubMessage (org.gradle.internal.remote.internal.hub.protocol.InterHubMessage)1