not sure how to do this ...
Is this what you mean?
Code:
ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext("applicationContext-security.xml");
MyThing thing = appContext.getBean(MyThing.class);
OAuth2RestTemplate restTemplate = thing.getClientRestTemplate();
OAuth2AccessToken token2 = restTemplate.getAccessToken();
I have this bean in my XML:
Code:
<bean id="watchdoxApiService" class="com.watchdox.web.auth.MyThing">
<property name="clientRestTemplate">
<oauth:rest-template resource="myApiResource" />
</property>
</bean>