Package it.tidalwave.role.spring.spi
Class AnnotationSpringRoleManager
- java.lang.Object
-
- it.tidalwave.role.spi.RoleManagerSupport
-
- it.tidalwave.role.spring.spi.AnnotationSpringRoleManager
-
- All Implemented Interfaces:
RoleManager
@Configurable public class AnnotationSpringRoleManager extends RoleManagerSupport
A specialization ofRoleManagerSupport
for a Spring context that uses annotations (DciRole
andDciContext
) for retrieving role metadata and is capable to inject Spring beans into created roles.- Author:
- Fabrizio Giudici
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface it.tidalwave.role.spi.RoleManager
RoleManager.Locator
-
-
Constructor Summary
Constructors Constructor Description AnnotationSpringRoleManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Class<?>
findContextTypeForRole(java.lang.Class<?> roleImplementationType)
Returns the type of the context associated to the given role implementation type.protected java.lang.Class<?>[]
findDatumTypesForRole(java.lang.Class<?> roleImplementationType)
Returns the valid datum types for the given role implementation type.protected <T> T
getBean(java.lang.Class<T> beanType)
Retrieves an extra bean.-
Methods inherited from class it.tidalwave.role.spi.RoleManagerSupport
findRoles, logRoles, scan
-
-
-
-
Method Detail
-
getBean
@Nonnull protected <T> T getBean(@Nonnull java.lang.Class<T> beanType)
Retrieves an extra bean.- Specified by:
getBean
in classRoleManagerSupport
- Type Parameters:
T
- the static type of the bean- Parameters:
beanType
- the dynamic type of the bean- Returns:
- the bean
-
findContextTypeForRole
@Nonnull protected java.lang.Class<?> findContextTypeForRole(@Nonnull java.lang.Class<?> roleImplementationType) throws NotFoundException
Returns the type of the context associated to the given role implementation type.- Specified by:
findContextTypeForRole
in classRoleManagerSupport
- Parameters:
roleImplementationType
- the role type- Returns:
- the context type
- Throws:
NotFoundException
- if no context is found
-
findDatumTypesForRole
@Nonnull protected java.lang.Class<?>[] findDatumTypesForRole(@Nonnull java.lang.Class<?> roleImplementationType)
Returns the valid datum types for the given role implementation type.- Specified by:
findDatumTypesForRole
in classRoleManagerSupport
- Parameters:
roleImplementationType
- the role type- Returns:
- the datum types
-
-