Class SystemRoleFactorySupport

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.util.Optional<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.
      <T> java.util.List<T> findRoles​(java.lang.Object datum, java.lang.Class<? extends T> roleType)
      Retrieves the roles of the given class for the given owner object.
      protected <T> java.util.Optional<T> getBean​(java.lang.Class<T> beanType)
      Retrieves an extra bean.
      void logRoles()  
      protected void scan​(java.util.Collection<java.lang.Class<?>> roleImplementationTypes)
      Scans all the given role implementation classes and build a map of roles by owner class.
      • Methods inherited from class java.lang.Object

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

      • SystemRoleFactorySupport

        public SystemRoleFactorySupport()
    • Method Detail

      • findRoles

        @Nonnull
        public <T> java.util.List<T> findRoles​(@Nonnull
                                               java.lang.Object datum,
                                               @Nonnull
                                               java.lang.Class<? extends T> roleType)
        Retrieves the roles of the given class for the given owner object.
        Specified by:
        findRoles in interface SystemRoleFactory
        Type Parameters:
        T - the static type of the roles
        Parameters:
        datum - the owner object
        roleType - the dynamic type of the roles
        Returns:
        a list of roles
      • scan

        protected void scan​(@Nonnull
                            java.util.Collection<java.lang.Class<?>> roleImplementationTypes)
        Scans all the given role implementation classes and build a map of roles by owner class.
        Parameters:
        roleImplementationTypes - the types of role implementations to scan
      • getBean

        @Nonnull
        protected <T> java.util.Optional<T> getBean​(@Nonnull
                                                    java.lang.Class<T> beanType)
        Retrieves an extra bean.
        Type Parameters:
        T - the static type of the bean
        Parameters:
        beanType - the dynamic type of the bean
        Returns:
        the bean
      • findContextTypeForRole

        @Nonnull
        protected java.util.Optional<java.lang.Class<?>> findContextTypeForRole​(@Nonnull
                                                                                java.lang.Class<?> roleImplementationType)
        Returns the type of the context associated to the given role implementation type.
        Parameters:
        roleImplementationType - the role type
        Returns:
        the context type
      • findDatumTypesForRole

        @Nonnull
        protected java.lang.Class<?>[] findDatumTypesForRole​(@Nonnull
                                                             java.lang.Class<?> roleImplementationType)
        Returns the valid datum types for the given role implementation type.
        Parameters:
        roleImplementationType - the role type
        Returns:
        the datum types
      • logRoles

        public void logRoles()