Class AbstractDomainRegistry

java.lang.Object
com.reallifedeveloper.common.domain.registry.AbstractDomainRegistry
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
CommonDomainRegistry

public abstract class AbstractDomainRegistry extends Object implements org.springframework.context.ApplicationContextAware
Base class for Spring-based domain registries. A domain registry is conceptually a singleton and should only be used when dependency injection cannot be used, e.g., in entities or value objects.
Author:
RealLifeDeveloper
  • Constructor Details

    • AbstractDomainRegistry

      public AbstractDomainRegistry()
  • Method Details

    • getBean

      protected static <T> T getBean(Class<T> beanType)
      Looks up the Spring bean of the given type. This method never returns null; if the bean cannot be found, an exception is thrown.
      Type Parameters:
      T - the type of the bean to look up
      Parameters:
      beanType - the class of the bean to look up
      Returns:
      the Spring bean, never null
    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware