java - Bean and Dependency Injection configuration from Database Instead XML -


currently have service class configuration defined in application-context.xml file. application context initialized during application startup beans defined in context file , spring handles dependency injection.

i looking solution has load particular service class during run time based on specific parameter database.

for example, there 2 classes exist in code base such fooservice1.java , fooservice2.java. each class have dependency appropriate dao class such foodao1.java , foodao2.java.

instead of defining these in applciation-context.xml file, run time parameter decide service needs loaded , corresponding dao needs injected. trying achieve here db oriented dependency injection keep application context information in database instead of xml.

tables like: service_beans, dao_beans , intermediate table have dependency information.

i saw jdbcbeandefinitionreader class in spring. can use implement db oriented di? don't see example on this. please let me know if has examples.

i think can generate beans @ runtime , register them spring-context.

refer registering beans(prototype) @ runtime in spring

hope helps !


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -