It's very simple thanks to powerfull Spring API , You can do it as mentioned below
ApplicationContext ctx = ContextLoader.getCurrentWebApplicationContext();
(UserCredentialsDataSourceAdapter)ctx.getBean("dataSource");