Class DefaultBeanRegistry

java.lang.Object
com.aspectran.core.component.AbstractComponent
com.aspectran.core.component.bean.DefaultBeanRegistry
All Implemented Interfaces:
BeanRegistry, Component

public class DefaultBeanRegistry extends AbstractComponent
The Class DefaultBeanRegistry.

Created: 2009. 03. 09 PM 23:48:09

  • Constructor Details

  • Method Details

    • getBean

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

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

      public <V> V getBean(@NonNull Class<V> type, @Nullable 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:
      V - the type of bean object retrieved
      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 <V> V[] getBeansOfType(@NonNull Class<V> type)
    • containsBean

      public boolean containsBean(@NonNull 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 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 Class<?> type, @Nullable String id)
      Description copied from interface: BeanRegistry
      Returns whether the bean corresponding to the specified object type and ID exists.
      Parameters:
      type - the object type of the bean to query
      id - the id of the bean to query
      Returns:
      whether a bean with the specified type is present
    • findConfigBeanClassesWithAnnotation

      public Collection<Class<?>> findConfigBeanClassesWithAnnotation(Class<? extends Annotation> annotationType)
    • getBeanRuleRegistry

      protected BeanRuleRegistry getBeanRuleRegistry()
    • getBean

      protected <V> V getBean(@NonNull BeanRule beanRule)
    • getPrototypeScopeBean

      public <V> V getPrototypeScopeBean(BeanRule beanRule)
      Specified by:
      getPrototypeScopeBean in interface BeanRegistry
    • hasSingleton

      public boolean hasSingleton(Object bean)
      Specified by:
      hasSingleton in interface BeanRegistry
    • hasSingleton

      public boolean hasSingleton(@NonNull Class<?> type)
      Specified by:
      hasSingleton in interface BeanRegistry
    • hasSingleton

      public boolean hasSingleton(@NonNull Class<?> type, @Nullable String id)
      Specified by:
      hasSingleton in interface BeanRegistry
    • destroySingleton

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

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

      protected void doDestroy() throws Exception
      Specified by:
      doDestroy in class AbstractComponent
      Throws:
      Exception
    • getActivityContext

      protected ActivityContext getActivityContext()
    • createBean

      protected Object createBean(BeanRule beanRule)
    • createBean

      protected Object createBean(@NonNull BeanRule beanRule, Scope scope)
    • getFactoryProducedObject

      protected Object getFactoryProducedObject(@NonNull BeanRule beanRule, Object bean)