Package hudson.remoting
Interface DelegatingCallable<V,T extends Throwable>
-
- All Superinterfaces:
Callable<V,T>
,RoleSensitive
,Serializable
public interface DelegatingCallable<V,T extends Throwable> extends Callable<V,T>
Callable
that 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 loadedCallable
object itself is used, but whenCallable
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
Callable
and return a classloader that can see all the classes. In case of Jenkins,PluginManager.uberClassLoader
is a good candidate.- Author:
- Kohsuke Kawaguchi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ClassLoader
getClassLoader()
Returns the class loader to be used for the callable.-
Methods inherited from interface hudson.remoting.Callable
call, getChannelOrFail, getOpenChannelOrFail
-
Methods inherited from interface org.jenkinsci.remoting.RoleSensitive
checkRoles
-
-
-
-
Method Detail
-
getClassLoader
@CheckForNull ClassLoader getClassLoader()
Returns the class loader to be used for the callable.- Returns:
ClassLoader
to be used. The value may benull
if the classloader is not being propagated to the remote side. If all classes in the call are primitives orVoid
, the value may be alsonull
. In such cased the handling code should try other possible classloaders.
-
-