private synchronized RealmOAuthConsumer getConsumer ( ) { // could just inject these, but I kinda prefer pushing this out // to the properties file... if ( consumer == null ) { OAuthServiceProvider serviceProvider = new OAuthServiceProvider ( "" , "" , "" ) ; String realm = propertyResolver . getProperty ( "org.jasig.rest.interceptor.oauth." + id + ".realm" ) ; String consumerKey = propertyResolver . getProperty ( "org.jasig.rest.interceptor.oauth." + id + ".consumerKey" ) ; String secretKey = propertyResolver . getProperty ( "org.jasig.rest.interceptor.oauth." + id + ".secretKey" ) ; Assert . notNull ( consumerKey , "The property \"org.jasig.rest.interceptor.oauth." + id + ".consumerKey\" must be set." ) ; Assert . notNull ( secretKey , "The property \"org.jasig.rest.interceptor.oauth." + id + ".secretKey\" must be set." ) ; consumer = new RealmOAuthConsumer ( consumerKey , secretKey , realm , serviceProvider ) ; } return consumer ; }
Get the OAuthConsumer . Will initialize it lazily .