Class LateDependentInitialisationRegistry
- java.lang.Object
-
- ch.sahits.game.openpatrician.utilities.spring.LateDependentInitialisationRegistry
-
public class LateDependentInitialisationRegistry extends java.lang.Object
Registry to store the bean pairs that make up an initialisation dependency.
-
-
Field Summary
Fields Modifier and Type Field Description private org.springframework.util.MultiValueMap<java.lang.Class,DependingBeanDef>
registry
-
Constructor Summary
Constructors Constructor Description LateDependentInitialisationRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDependentBean(java.lang.Class bean, java.lang.Class dependsOn)
Add a new dependency by defining thatdependsOn
should be initiated afterbean
is instantiated.void
addDependentBean(java.lang.String beanName, java.lang.Class dependsOn)
Add a new dependency by defining thatdependsOn
should be initiated afterbean
is instantiated.java.util.List<DependingBeanDef>
getDependentBeanClasses(java.lang.Class bean)
Retrieve a list of all dependent bean classes forbean
.boolean
hasDependentBeans(java.lang.Class bean)
Check if there are any beans defined that depend onbean
-
-
-
Field Detail
-
registry
private final org.springframework.util.MultiValueMap<java.lang.Class,DependingBeanDef> registry
-
-
Method Detail
-
addDependentBean
public void addDependentBean(java.lang.Class bean, java.lang.Class dependsOn)
Add a new dependency by defining thatdependsOn
should be initiated afterbean
is instantiated.- Parameters:
bean
- depending bean.dependsOn
- the bean that the othe ben depends on
-
addDependentBean
public void addDependentBean(java.lang.String beanName, java.lang.Class dependsOn)
Add a new dependency by defining thatdependsOn
should be initiated afterbean
is instantiated.- Parameters:
beanName
- depending bean.dependsOn
- the bean that the othe ben depends on
-
hasDependentBeans
public boolean hasDependentBeans(java.lang.Class bean)
Check if there are any beans defined that depend onbean
- Parameters:
bean
- the bean class to be check for dependencies.- Returns:
- true if there are dependent beans.
-
getDependentBeanClasses
public java.util.List<DependingBeanDef> getDependentBeanClasses(java.lang.Class bean)
Retrieve a list of all dependent bean classes forbean
. The retrevial consumes the data, meaning the second call with the same parameters will always result in an empty list.- Returns:
- List of bean classes that should be initiated upon the instantiation of
bean
-
-