Package io.micronaut.context.scope
Interface CustomScopeRegistry
-
- All Known Implementing Classes:
DefaultCustomScopeRegistry
public interface CustomScopeRegistryAn interface for a registry ofCustomScopeinstances.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> java.util.Optional<BeanRegistration<T>>findBeanRegistration(T bean)Finds A bean registration amongst the active scopes.default java.util.Optional<CustomScope<?>>findDeclaredScope(io.micronaut.core.type.Argument<?> argument)Finds the declared scope for the given argument.default java.util.Optional<CustomScope<?>>findDeclaredScope(BeanType<?> beanType)Finds the declared scope for the given bean type.default java.util.Optional<CustomScope<?>>findScope(java.lang.Class<? extends java.lang.annotation.Annotation> scopeAnnotation)Find a custom scope for the given annotation.java.util.Optional<CustomScope<?>>findScope(java.lang.String scopeAnnotation)Find a custom scope for the given annotation.
-
-
-
Method Detail
-
findDeclaredScope
default java.util.Optional<CustomScope<?>> findDeclaredScope(@NonNull io.micronaut.core.type.Argument<?> argument)
Finds the declared scope for the given argument.- Parameters:
argument- The argument- Returns:
- An optional scope
- Since:
- 3.0.0
-
findDeclaredScope
default java.util.Optional<CustomScope<?>> findDeclaredScope(@NonNull BeanType<?> beanType)
Finds the declared scope for the given bean type.- Parameters:
beanType- The bean type- Returns:
- An optional scope
- Since:
- 3.0.0
-
findScope
java.util.Optional<CustomScope<?>> findScope(java.lang.String scopeAnnotation)
Find a custom scope for the given annotation.- Parameters:
scopeAnnotation- The scope annotation- Returns:
- The custom scope
-
findScope
default java.util.Optional<CustomScope<?>> findScope(java.lang.Class<? extends java.lang.annotation.Annotation> scopeAnnotation)
Find a custom scope for the given annotation.- Parameters:
scopeAnnotation- The scope annotation- Returns:
- The custom scope
-
findBeanRegistration
default <T> java.util.Optional<BeanRegistration<T>> findBeanRegistration(T bean)
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
-
-