Class ReuseSingletonStrategy<T extends FeatureInput>
Object
ReuseSingletonStrategy<T>
- Type Parameters:
T
- feature input-type
- All Implemented Interfaces:
ReplaceStrategy<T>
public class ReuseSingletonStrategy<T extends FeatureInput>
extends Object
implements ReplaceStrategy<T>
Always re-use an existing
SessionInputSequential
, invalidating it each time a new call
occurs.-
Constructor Summary
ConstructorsConstructorDescriptionReuseSingletonStrategy
(CacheCreator cacheCreator) Constructor with default means of creating aFeatureCalculationInput
.ReuseSingletonStrategy
(CacheCreator cacheCreator, ChildCacheFinder findChildStrategy) Constructor with custom means of creating aFeatureCalculationInput
-
Method Summary
Modifier and TypeMethodDescriptioncreateOrReuse
(T input) Find or create aFeatureCalculationInput
to associate withinput
.
-
Constructor Details
-
ReuseSingletonStrategy
Constructor with default means of creating aFeatureCalculationInput
.- Parameters:
cacheCreator
- creates aFeatureCalculationCache
.
-
ReuseSingletonStrategy
Constructor with custom means of creating aFeatureCalculationInput
- Parameters:
cacheCreator
- creates a cache.findChildStrategy
- the strategy for finding child-caches.
-
-
Method Details
-
createOrReuse
Description copied from interface:ReplaceStrategy
Find or create aFeatureCalculationInput
to associate withinput
.- Specified by:
createOrReuse
in interfaceReplaceStrategy<T extends FeatureInput>
- Parameters:
input
- the input that aFeatureCalculationInput
will be associated with.- Returns:
- the
FeatureCalculationInput
, either newly created, or reused from a previous call. - Throws:
OperationFailedException
- if an error-state emerge
-