Package hudson.remoting
Class JarCacheSupport
java.lang.Object
hudson.remoting.JarCache
hudson.remoting.JarCacheSupport
- Direct Known Subclasses:
FileSystemJarCache
Default partial implementation of
JarCache
.- Since:
- 2.24
- Author:
- Kohsuke Kawaguchi
-
Field Summary
Fields inherited from class hudson.remoting.JarCache
DEFAULT_NOWS_JAR_CACHE_LOCATION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected JarLoader
getJarLoader
(Channel channel) protected abstract URL
lookInCache
(Channel channel, long sum1, long sum2) Look up the local cache and return URL if found.Looks up the jar in cache, and if not found, useJarLoader
to retrieve it from the other side.protected abstract URL
Retrieve the jar file from the givenJarLoader
, store it, then return the URL to that jar.
-
Constructor Details
-
JarCacheSupport
public JarCacheSupport()
-
-
Method Details
-
lookInCache
protected abstract URL lookInCache(Channel channel, long sum1, long sum2) throws IOException, InterruptedException Look up the local cache and return URL if found. Otherwise null (which will trigger a remote retrieval.)- Throws:
IOException
InterruptedException
-
retrieve
protected abstract URL retrieve(Channel channel, long sum1, long sum2) throws IOException, InterruptedException Retrieve the jar file from the givenJarLoader
, store it, then return the URL to that jar.- Returns:
- must not be null
- Throws:
IOException
InterruptedException
-
resolve
@NonNull public CompletableFuture<URL> resolve(@NonNull Channel channel, long sum1, long sum2) throws IOException, InterruptedException Description copied from class:JarCache
Looks up the jar in cache, and if not found, useJarLoader
to retrieve it from the other side.This method must be concurrency-safe.
- Specified by:
resolve
in classJarCache
- Parameters:
channel
- Channel that needs this jar file.- Returns:
- URL of the jar file.
- Throws:
IOException
InterruptedException
-
getJarLoader
- Throws:
InterruptedException
-