Package com.google.inject.name

Examples of com.google.inject.name.Named


          "at " + BinderTest.class.getName(), "configure(BinderTest.java:");
    }
  }

  public void testCannotBindToGuiceTypes() {
    final Named red = Names.named("red");

    try {
      Guice.createInjector(new AbstractModule() {
        protected void configure() {
          bind(AbstractModule.class).annotatedWith(red)
View Full Code Here


    }
   
    Injector injector = Guice.createInjector(new ProductionBindings(type, temp));
    NoSqlEntityManagerFactory factory = injector.getInstance(NoSqlEntityManagerFactory.class);

    Named named = Names.named("logger");
    Key<NoSqlRawSession> key = Key.get(NoSqlRawSession.class, named);
    NoSqlRawSession inst = injector.getInstance(key);
    inst.start(properties);
   
    //why not just add setInjector() and setup() in NoSqlEntityManagerFactory
View Full Code Here

    public boolean equals(Object o) {
        if (!(o instanceof Named)) {
            return false;
        }

        Named other = (Named) o;
        return value.equals(other.value());
    }
View Full Code Here

    }
   
    Injector injector = Guice.createInjector(new ProductionBindings(type, temp));
    NoSqlEntityManagerFactory factory = injector.getInstance(NoSqlEntityManagerFactory.class);

    Named named = Names.named("logger");
    Key<NoSqlRawSession> key = Key.get(NoSqlRawSession.class, named);
    NoSqlRawSession inst = injector.getInstance(key);
    inst.start(properties);
   
    //why not just add setInjector() and setup() in NoSqlEntityManagerFactory
View Full Code Here

    }
   
    Injector injector = Guice.createInjector(new ProductionBindings(type, temp));
    NoSqlEntityManagerFactory factory = injector.getInstance(NoSqlEntityManagerFactory.class);

    Named named = Names.named("logger");
    Key<NoSqlRawSession> key = Key.get(NoSqlRawSession.class, named);
    NoSqlRawSession inst = injector.getInstance(key);
    inst.start(properties);
   
    //why not just add setInjector() and setup() in NoSqlEntityManagerFactory
View Full Code Here

        // Bind ThriftClientConfig with random @Named annotation
        // We generate a random Named annotation for binding the ThriftClientConfig because we
        // need one of these for each clientType+annotationType pair.  Without this, the
        // ThriftClientConfig bindings collapse to a single instance which is shared by all
        // clients.
        Named thriftClientConfigKey = Names.named(typeName + "-" + UUID.randomUUID().toString());
        bindConfig(binder).annotatedWith(thriftClientConfigKey).prefixedWith(typeName).to(ThriftClientConfig.class);

        // Bind ThriftClient to a provider which knows how to find the ThriftClientConfig using
        // the random @Named annotation
        Multibinder<ThriftClientEventHandler> eventHandlersBinder = Multibinder.newSetBinder(binder,
View Full Code Here

        String typeName = getServiceName(clientInterface);
        String name = annotationType.getSimpleName();

        // Bind ThriftClientConfig with random @Named annotation
        // see comment on random Named annotation above
        Named thriftClientConfigKey = Names.named(typeName + "-" + UUID.randomUUID().toString());
        String prefix = String.format("%s.%s", typeName, name);
        bindConfig(binder).annotatedWith(thriftClientConfigKey).prefixedWith(prefix).to(ThriftClientConfig.class);

        // Bind ThriftClient to a provider which knows how to find the ThriftClientConfig using
        // the random @Named annotation
View Full Code Here

    }
   
    Injector injector = Guice.createInjector(new ProductionBindings(type, temp));
    NoSqlEntityManagerFactory factory = injector.getInstance(NoSqlEntityManagerFactory.class);

    Named named = Names.named("logger");
    Key<NoSqlRawSession> key = Key.get(NoSqlRawSession.class, named);
    NoSqlRawSession inst = injector.getInstance(key);
    inst.start(properties);
   
    //why not just add setInjector() and setup() in NoSqlEntityManagerFactory
View Full Code Here

    }
   
    Injector injector = Guice.createInjector(new ProductionBindings(type, temp));
    NoSqlEntityManagerFactory factory = injector.getInstance(NoSqlEntityManagerFactory.class);

    Named named = Names.named("logger");
    Key<NoSqlRawSession> key = Key.get(NoSqlRawSession.class, named);
    NoSqlRawSession inst = injector.getInstance(key);
    inst.start(properties);
   
    //why not just add setInjector() and setup() in NoSqlEntityManagerFactory
View Full Code Here

    }
   
    Injector injector = Guice.createInjector(new ProductionBindings(type, temp));
    NoSqlEntityManagerFactory factory = injector.getInstance(NoSqlEntityManagerFactory.class);

    Named named = Names.named("logger");
    Key<NoSqlRawSession> key = Key.get(NoSqlRawSession.class, named);
    NoSqlRawSession inst = injector.getInstance(key);
    inst.start(properties);
   
    //why not just add setInjector() and setup() in NoSqlEntityManagerFactory
View Full Code Here

TOP

Related Classes of com.google.inject.name.Named

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.