Interface CustomScopeRegistry
- All Known Implementing Classes:
DefaultCustomScopeRegistry
public interface CustomScopeRegistry
An interface for a registry of
CustomScope instances.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> Optional<BeanRegistration<T>> findBeanRegistration(T bean) Finds A bean registration amongst the active scopes.default Optional<CustomScope<?>> findDeclaredScope(Argument<?> argument) Finds the declared scope for the given argument.default Optional<CustomScope<?>> findDeclaredScope(BeanType<?> beanType) Finds the declared scope for the given bean type.default Optional<CustomScope<?>> findScope(Class<? extends Annotation> scopeAnnotation) Find a custom scope for the given annotation.Optional<CustomScope<?>> Find a custom scope for the given annotation.default voidForgets that no scope was found for an annotation, so that the next lookup for it consults the bean context again.
-
Method Details
-
findDeclaredScope
Finds the declared scope for the given argument.- Parameters:
argument- The argument- Returns:
- An optional scope
- Since:
- 3.0.0
-
findDeclaredScope
Finds the declared scope for the given bean type.- Parameters:
beanType- The bean type- Returns:
- An optional scope
- Since:
- 3.0.0
-
findScope
Find a custom scope for the given annotation.- Parameters:
scopeAnnotation- The scope annotation- Returns:
- The custom scope
-
findScope
Find a custom scope for the given annotation.- Parameters:
scopeAnnotation- The scope annotation- Returns:
- The custom scope
-
findBeanRegistration
Finds A bean registration amongst the active scopes.- Type Parameters:
T- The bean type- Parameters:
bean- The bean- Returns:
- An optional bean registration
- Since:
- 3.1.2
-
invalidate
default void invalidate()Forgets that no scope was found for an annotation, so that the next lookup for it consults the bean context again. Called when aCustomScopeis registered after the context started, since a lookup made before then may have recorded the scope's absence.- Since:
- 5.2.0
-