title: Guice: how do you configure an @Provides and @Singleton in a module in this case?
body: <p>I have a provider method in a module annotated with <code>@Provides</code>:</p>
  
  <pre><code>@Provides
  public ChatServicePerformanceMonitor getChatServicePerfMon() {
    ...
  }
  </code></pre>
  
  <p>and I have annotated my <code>ChatServicePerformanceMonitor</code> with <code>@Singleton</code>. In my code, where I use this instance, I can't have guice "passively" inject it, due to a framework I'm using that's constructing the enclosing class (it does not use Guice, so this is the only way I know of to get the reference):</p>
  
  <pre><code>chatServicePerfMon = injector.getInstance(ChatServicePerformanceMonitor.class);
  </code></pre>
  
  <p>It seems Guice does not respect the <code>@Singleton</code> annotation on my <code>ChatServicePerformanceMonitor</code> class. I get an instance for every call to injector.getInstance(ChatServicePerformanceMonitor.class).</p>
  
  <p>Adding the <code>@Singleton</code> to the provider method seems to fix this: </p>
  
  <pre><code>@Provides @Singleton
  public ChatServicePerformanceMonitor getChatServicePerfMon() {
    ...
  }
  </code></pre>
  
  <p>Is that the expected behavior? It seems an <code>@Singleton</code> on the instance should be all I would need. </p>