title: Cant Inject same instance to multiple Verticles using Guice and Vertx to
body: <p>I have 3 vertx verticles.</p>
  
  <p>I created class AImpl which implements class A as follows</p>
  
  <pre><code> @Singleton
  public class AImpl implements A {
  
  
      public LocationServiceImpl() {
          System.out.println("initiated once");
  
      }
  
   public void doSomething(){..}
  </code></pre>
  
  <p>Verticle 1 looks like this:</p>
  
  <pre><code>public class MyVerticle1 extends AbstractVerticle {
  ...
   @Inject
      private A a;
  
  
   @Override
      public void start(Future&lt;Void&gt; fut) {
   Guice.createInjector(new AppInjector()).injectMembers(this);
    a.doSomething(..);
  
  ..}
  </code></pre>
  
  <p>MyVerticle2 and MyVerticle3 looks the same.</p>
  
  <p>Guice code:</p>
  
  <pre><code>public class AppInjector extends AbstractModule {
  
  
      public AppInjector() {
      }
  
  
      @Override
      protected void configure() {   
   bind(A.class).to(AImpl.class).in(Singleton.class);
  
      }
  </code></pre>
  
  <p>Now when I run vertx I can see that I get 3 different  instances of AImpl:</p>
  
  <pre><code> public static void main(String[] args) throws InterruptedException {
          final Logger logger = Logger.getLogger(StarterVerticle.class);
          ClusterManager mgr = new HazelcastClusterManager();
          VertxOptions options = new VertxOptions().setClusterManager(mgr);
          Vertx.clusteredVertx(options, res -&gt; {
              if (res.succeeded()) {
                  Vertx vertx = res.result();
                  vertx.deployVerticle(new MyVerticle1());
                  vertx.deployVerticle(new MyVerticle2());
                  vertx.deployVerticle(new MyVerticle3());
                  logger.info("Vertx cluster started!");
              } else {
                  logger.error("Error initiating Vertx cluster");
              }
          });
  </code></pre>
  
  <p>console:</p>
  
  <pre><code>2015-09-15 16:36:15,611 [vert.x-eventloop-thread-0] INFO   - Vertx cluster started!
  initiated once
  initiated once
  initiated once
  </code></pre>
  
  <p>What am I abusing with guice? why I dont get the same AImpl instance?</p>
  
  <p>Thanks,
  ray.</p>