Package io.micronaut.context
Class DefaultCustomScopeRegistry
- java.lang.Object
-
- io.micronaut.context.DefaultCustomScopeRegistry
-
- All Implemented Interfaces:
CustomScopeRegistry
public class DefaultCustomScopeRegistry extends java.lang.Object implements CustomScopeRegistry
Default implementation of theCustomScopeRegistry
interface.- Since:
- 1.0
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultCustomScopeRegistry(BeanLocator beanLocator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> java.util.Optional<BeanRegistration<T>>
findBeanRegistration(T bean)
Finds A bean registration amongst the active scopes.java.util.Optional<CustomScope<?>>
findDeclaredScope(io.micronaut.core.type.Argument<?> argument)
Finds the declared scope for the given argument.java.util.Optional<CustomScope<?>>
findDeclaredScope(BeanType<?> beanType)
Finds the declared scope for the given bean type.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.
-
-
-
Constructor Detail
-
DefaultCustomScopeRegistry
protected DefaultCustomScopeRegistry(BeanLocator beanLocator)
- Parameters:
beanLocator
- The bean locator
-
-
Method Detail
-
findBeanRegistration
public <T> java.util.Optional<BeanRegistration<T>> findBeanRegistration(T bean)
Description copied from interface:CustomScopeRegistry
Finds A bean registration amongst the active scopes.- Specified by:
findBeanRegistration
in interfaceCustomScopeRegistry
- Type Parameters:
T
- The bean type- Parameters:
bean
- The bean- Returns:
- An optional bean registration
-
findDeclaredScope
public java.util.Optional<CustomScope<?>> findDeclaredScope(@NonNull io.micronaut.core.type.Argument<?> argument)
Description copied from interface:CustomScopeRegistry
Finds the declared scope for the given argument.- Specified by:
findDeclaredScope
in interfaceCustomScopeRegistry
- Parameters:
argument
- The argument- Returns:
- An optional scope
-
findDeclaredScope
public java.util.Optional<CustomScope<?>> findDeclaredScope(@NonNull BeanType<?> beanType)
Description copied from interface:CustomScopeRegistry
Finds the declared scope for the given bean type.- Specified by:
findDeclaredScope
in interfaceCustomScopeRegistry
- Parameters:
beanType
- The bean type- Returns:
- An optional scope
-
findScope
public java.util.Optional<CustomScope<?>> findScope(java.lang.Class<? extends java.lang.annotation.Annotation> scopeAnnotation)
Description copied from interface:CustomScopeRegistry
Find a custom scope for the given annotation.- Specified by:
findScope
in interfaceCustomScopeRegistry
- Parameters:
scopeAnnotation
- The scope annotation- Returns:
- The custom scope
-
findScope
public java.util.Optional<CustomScope<?>> findScope(java.lang.String scopeAnnotation)
Description copied from interface:CustomScopeRegistry
Find a custom scope for the given annotation.- Specified by:
findScope
in interfaceCustomScopeRegistry
- Parameters:
scopeAnnotation
- The scope annotation- Returns:
- The custom scope
-
-