Class AnnotationSpringRoleManager

  • All Implemented Interfaces:
    RoleManager

    public class AnnotationSpringRoleManager
    extends RoleManagerSupport
    A specialization of RoleManagerSupport for a Spring context that uses annotations (DciRole and DciContext) for retrieving role metadata and is capable to inject Spring beans into created roles.
    Author:
    Fabrizio Giudici
    • 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 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AnnotationSpringRoleManager

        public AnnotationSpringRoleManager()
    • Method Detail

      • getBean

        @Nonnull
        protected <T> T getBean​(@Nonnull
                                java.lang.Class<T> beanType)
        Retrieves an extra bean.
        Specified by:
        getBean in class RoleManagerSupport
        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 class RoleManagerSupport
        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 class RoleManagerSupport
        Parameters:
        roleImplementationType - the role type
        Returns:
        the datum types