Class ContextualBeanRegistry

    • Method Detail

      • getBean

        public <T> T getBean​(@NonNull
                             java.lang.String id)
        Description copied from interface: BeanRegistry
        Returns an instance of the bean that matches the given id.
        Type Parameters:
        T - the generic type
        Parameters:
        id - the id of the bean to retrieve
        Returns:
        an instance of the bean
      • getBean

        public <T> T getBean​(@NonNull
                             java.lang.Class<T> type)
        Description copied from interface: BeanRegistry
        Returns the bean instance that uniquely matches the given object type.
        Type Parameters:
        T - the generic type
        Parameters:
        type - the type the bean must match; can be an interface or superclass
        Returns:
        an instance of the bean
      • getBean

        public <T> T getBean​(@NonNull
                             java.lang.Class<T> type,
                             @Nullable
                             java.lang.String id)
        Description copied from interface: BeanRegistry
        Returns an instance of the bean that matches the given object type. If more than one matching bean is found, we pick a bean that matches the given id.
        Type Parameters:
        T - the generic type
        Parameters:
        type - type the bean must match; can be an interface or superclass
        id - the id of the bean to retrieve
        Returns:
        an instance of the bean
      • getBeansOfType

        public <T> T[] getBeansOfType​(@NonNull
                                      java.lang.Class<T> type)
      • containsBean

        public boolean containsBean​(@NonNull
                                    java.lang.String id)
        Description copied from interface: BeanRegistry
        Return whether a bean with the specified id is present.
        Parameters:
        id - the id of the bean to query
        Returns:
        whether a bean with the specified id is present
      • containsBean

        public boolean containsBean​(@NonNull
                                    java.lang.Class<?> type)
        Description copied from interface: BeanRegistry
        Return whether a bean with the specified object type is present.
        Parameters:
        type - the object type of the bean to query
        Returns:
        whether a bean with the specified type is present
      • containsBean

        public boolean containsBean​(@NonNull
                                    java.lang.Class<?> type,
                                    @Nullable
                                    java.lang.String id)
      • findConfigBeanClassesWithAnnotation

        public java.util.Collection<java.lang.Class<?>> findConfigBeanClassesWithAnnotation​(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
      • getBean

        protected <T> T getBean​(BeanRule beanRule)
      • hasSingleton

        public boolean hasSingleton​(java.lang.Object bean)
        Specified by:
        hasSingleton in interface BeanRegistry
      • destroySingleton

        public void destroySingleton​(java.lang.Object bean)
                              throws java.lang.Exception
        Specified by:
        destroySingleton in interface BeanRegistry
        Throws:
        java.lang.Exception
      • doInitialize

        protected void doInitialize()
                             throws java.lang.Exception
        Specified by:
        doInitialize in class AbstractComponent
        Throws:
        java.lang.Exception
      • doDestroy

        protected void doDestroy()
                          throws java.lang.Exception
        Specified by:
        doDestroy in class AbstractComponent
        Throws:
        java.lang.Exception
      • createBean

        protected java.lang.Object createBean​(BeanRule beanRule)
      • createBean

        protected java.lang.Object createBean​(BeanRule beanRule,
                                              Scope scope)
      • getFactoryProducedObject

        protected java.lang.Object getFactoryProducedObject​(BeanRule beanRule,
                                                            java.lang.Object bean)
      • createBean

        protected java.lang.Object createBean​(BeanRule beanRule,
                                              Scope scope,
                                              Activity activity)