Announcement Announcement Module
Collapse
No announcement yet.
Interpreting Code to xml Bean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Interpreting Code to xml Bean

    Hi,

    Can someone comment if following xml interpretation of Java is correct?

    Code:
     #Code Snippet
     @Bean
    	@Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)	
    	public Facebook facebook() {
    		Connection<Facebook> facebook = connectionRepository().findPrimaryConnection(Facebook.class);
    		return facebook != null ? facebook.getApi() : new FacebookTemplate();
    	}
    
    
    #XML Interpretation of above code
      
    	<bean id="facebook" factory-bean="connectionRepository" factory-method="findPrimaryConnection" scope="request">
    		<constructor-arg ref="facebookClass" />
    	</bean>
        <bean id="facebookClass" class="org.springframework.social.facebook.api.impl.FacebookTemplate" /> 
    
    <bean id="connectionRepository" factory-method="createConnectionRepository" factory-bean="usersConnectionRepository" scope="request">
        	<constructor-arg value="#{request.userPrincipal.name}" />
        	<aop:scoped-proxy proxy-target-class="false" />
    	</bean>
    .....
Working...
X