Right now I have an InitialReferenceLoaderImpl which is annotated by @ApplicationScope and the function is annotated by @PostConstruct, in this class I'm loading my Application Properties from the SQL table, but the problem is, If users change something on Application Properties table, it does not get reflected directly, User needs to restart the server, which I don't want.
I want the user to hit the /refresh URL so that Application Properties can be reloaded.
Sorry for the confusing explanation.
I've solved my problem by using
Bean.refresh(), The solution I was seeking, was I wanted a/refreshend-point which will refresh my bean to do that I followed the following steps -I Autowired the
ConfigurableApplicationContext@Autowiredprivate ConfigurableApplicationContext context;In the endpoint I initialized the bean -
ReferenceClass bean = context.getBean(ReferenceClass.class);Refreshed is using
.refresh()bean.refresh();That's it, it solved my issue, once the user hits the
/refreshendpoint it refreshes my bean.