2017-04-12 39 views
1

我正在看看我在工作區中的一些舊例子。我看不到 自動裝配是如何完成的,因爲沒有@Autowired。 Spring引導+ Facebook默認配置。Autowire without annotation @Autowired

@Controller 
@RequestMapping("/") 
public class HelloController { 

    private Facebook facebook; 
    private ConnectionRepository connectionRepository; 

    public HelloController(Facebook facebook, ConnectionRepository connectionRepository) { 
     this.facebook = facebook; 
     this.connectionRepository = connectionRepository; 
    } 

    @GetMapping 
    public String helloFacebook(Model model) { 
     System.out.println("we are here!!!"); 
     if (connectionRepository.findPrimaryConnection(Facebook.class) == null) { 
      return "redirect:/connect/facebook"; 
     } 

     PagedList<Post> feed = facebook.feedOperations().getFeed(); 
     model.addAttribute("feed", feed); 
     return "hello"; 
    } 
} 

它可以完美的,但如何把這些豆子自動裝配自己沒有@Autowired? 它們是作爲字段還是構造函數自動裝配的?

+1

您訂閱的所有用戶到亞馬遜SNS主題,或者你將消息發送到個人用戶(不使用主題)? –

+0

個人用戶 – strash

+0

「亞馬遜繼續發送通知」是什麼意思?他們是從你的應用程序通知嗎?他們如何被髮送到SNS?或者你在談論重試?請修改您的問題以提供更多信息,以便我們爲您提供幫助。 –

回答