Callablethat nominates another classloader for serialization.
For various reasons, one
Callable object (and all the objects reachable from it) is
serialized by one classloader.
By default, the classloader that loaded
Callable object itself is used,
Callable object refers to other objects that are loaded by other classloaders,
this will fail to deserialize on the remote end.
In such a case, implement this interface, instead of plain
return a classloader that can see all the classes.
In case of Jenkins,
PluginManager.uberClassLoader is a good candidate.
|Modifier and Type||Method and Description|
Returns the class loader to be used for the callable.
call, getChannelOrFail, getOpenChannelOrFail
@CheckForNull ClassLoader getClassLoader()
ClassLoaderto be used. The value may be
nullif the classloader is not being propagated to the remote side. If all classes in the call are primitives or
Void, the value may be also
null. In such cased the handling code should try other possible classloaders.
Copyright © 2004–2022. All rights reserved.