title: Guice: Avoid lazy injection
body: <p>I have a class Cache which is quite expensive to create, but after that is set as a singleton and injected into my service layer.</p>
  
  <pre><code>@Override
  protected void configure() {            
      bind(Cache.class).in(Singleton.class);
  
      bind(Service.class).to(ServiceImpl.class).in(Singleton.class);      
  }
  
  @Inject
      public ServiceImpl(Cache cache){
          this.cache = cache;
      }
  
  public Cache(){
  //Expensive stuff
  }
  </code></pre>
  
  <p>My problem is it seems public() in Cache only executes when I'm trying to access one of its methods</p>
  
  <p>Can I somehow make the object get constructed on server startup instead?</p>