Package org.apache.maven.impl.cache
Class CachingSupplier<REQ,REP>
java.lang.Object
org.apache.maven.impl.cache.CachingSupplier<REQ,REP>
- Type Parameters:
REQ- The request typeREP- The response type
- All Implemented Interfaces:
Function<REQ,REP>
A caching supplier wrapper that caches results and exceptions from the underlying supplier.
Used internally to cache expensive computations in the session.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSpecial holder class for exceptions that occur during supplier execution. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
supplier
-
value
-
-
Constructor Details
-
CachingSupplier
-
-
Method Details
-
getValue
-
complete
Directly sets the cached value without invoking the supplier, then notifies any threads blocked inapply(Object)waiting for the result.This is used by
AbstractRequestCache.requests(java.util.List<REQ>, java.util.function.Function<java.util.List<REQ>, java.util.List<REP>>)to set batch-resolved results on CachingSupplier instances. Concurrent callers blocked inapply()will be woken up and see this value instead of invoking the supplier redundantly.- Parameters:
result- the result to cache (may be a normal result or anCachingSupplier.AltResfor errors)
-
apply
-