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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static <T> T
Looks up the Spring bean of the given type.void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext)
-
Constructor Details
-
AbstractDomainRegistry
public AbstractDomainRegistry()
-
-
Method Details
-
getBean
Looks up the Spring bean of the given type. This method never returnsnull
; 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 interfaceorg.springframework.context.ApplicationContextAware
-