Examples of AbstractModule


Examples of com.google.inject.AbstractModule

    assertMapVisitor(Key.get(mapOfString), stringType, stringType, setOf(ab1c, b2c), BOTH, true, 0,
        instance("a", "A"), instance("b", "B1"), instance("b", "B2"), instance("c", "C"));
  }

  public void testMapBinderMultimapWithAnotation() {
    AbstractModule ab1 = new AbstractModule() {
      @Override protected void configure() {
        MapBinder<String, String> multibinder = MapBinder.newMapBinder(
            binder(), String.class, String.class, Abc.class);
        multibinder.addBinding("a").toInstance("A");
        multibinder.addBinding("b").toInstance("B1");
      }
    };
    AbstractModule b2c = new AbstractModule() {
      @Override protected void configure() {
        MapBinder<String, String> multibinder = MapBinder.newMapBinder(
            binder(), String.class, String.class, Abc.class);
        multibinder.addBinding("b").toInstance("B2");
        multibinder.addBinding("c").toInstance("C");
View Full Code Here

Examples of com.tinkerpop.frames.modules.AbstractModule

    return this;
  }
 
  public Module build() {
    final TypeManager manager = new TypeManager(typeRegistry);
    return new AbstractModule() {
     
      @Override
      public void doConfigure(FramedGraphConfiguration config) {
        config.addTypeResolver(manager);
        config.addFrameInitializer(manager);
View Full Code Here

Examples of irssibot.modules.AbstractModule

  Date now = new Date();

  /* if last module state save time older than 5 minutes, save */
  if( ((now.getTime() - moduleStateSaved.getTime()) > 30000) || force ) {
      moduleStateSaved = now;
      AbstractModule modules[] = moduleHandler.getModuleTable();
      for( int i = 0; i < modules.length; i++ ) {
    moduleHandler.saveModuleState(modules[i]);
      }
  }
    }
View Full Code Here

Examples of org.elasticsearch.common.inject.AbstractModule

                new AnalysisModule(settings),
                new IndexEngineModule(settings),
                new SimilarityModule(settings),
                new IndexQueryParserModule(settings),
                new IndexNameModule(index),
                new AbstractModule() {
                    @Override protected void configure() {
                        bind(PercolatorExecutor.class).asEagerSingleton();
                    }
                }
        ).createInjector();
View Full Code Here

Examples of org.jboss.gravia.runtime.spi.AbstractModule

    @Override
    protected AbstractModule createModule(ClassLoader classLoader, Resource resource, Dictionary<String, String> headers, Attachable context) {
        assertNoShutdown();

        AbstractModule module;
        if (resource != null && resource.getIdentity().equals(getSystemIdentity())) {
            module = new SystemModule(this, classLoader, resource, headers);
        } else {
            module = new EmbeddedModule(this, classLoader, resource, headers);
        }
View Full Code Here

Examples of org.jboss.metadata.ear.spec.AbstractModule

            ModuleMetaData moduleMetaData = appMetaData.getModule(filename);
            int type = typeFromSuffix(filename, vfArchive);
            if (type >= 0 && moduleMetaData == null)
            {
               moduleMetaData = new ModuleMetaData();
               AbstractModule module = null;
               switch(type)
               {
                  case J2eeModuleMetaData.EJB:
                     module = new EjbModuleMetaData();
                     break;
                  case J2eeModuleMetaData.CLIENT:
                     module = new JavaModuleMetaData();
                     break;
                  case J2eeModuleMetaData.CONNECTOR:
                     module = new ConnectorModuleMetaData();
                     break;
                  case J2eeModuleMetaData.SERVICE:
                  case J2eeModuleMetaData.HAR:
                     module = new ServiceModuleMetaData();
                     break;
                  case J2eeModuleMetaData.WEB:
                     module = new WebModuleMetaData();
                     break;
               }
               module.setFileName(filename);
               moduleMetaData.setValue(module);
               modules.add(moduleMetaData);
            }
         }
      }
View Full Code Here

Examples of org.python.pydev.editor.codecompletion.revisited.modules.AbstractModule

                info.modulesNotInMemory.add(key);
                buffer.append(com.aptana.shared_core.string.StringUtils.format("ModulesKey %s exists in the disk but not in memory.\n", key));
            }
            if (!allAdditionalInfoTrackedModules.contains(key.name)) {
                try {
                    AbstractModule mod = AbstractModule.createModule(key.name, key.file, info.nature, true);
                    if (!(mod instanceof SourceModule)) {
                        continue;
                    }
                    SourceModule module = (SourceModule) mod;
                    if (module == null || module.getAst() == null) {
                        buffer.append(com.aptana.shared_core.string.StringUtils.format(
                                "Warning: cannot parse: %s - %s (so, it's ok not having additional info on it)\n",
                                key.name, key.file));
                    } else {
                        try {
                            Iterator<ASTEntry> innerEntriesForAST = AbstractAdditionalDependencyInfo
                                    .getInnerEntriesForAST(module.getAst()).o2;
                            if (innerEntriesForAST.hasNext()) {
                                info.allOk = false;
                                info.moduleNotInAdditionalInfo.add(module);
                                buffer.append(com.aptana.shared_core.string.StringUtils.format(
                                        "The additional info index of the module: %s is not updated.\n", key.name));
                            }
                        } catch (Exception e) {
                            buffer.append(com.aptana.shared_core.string.StringUtils.format("Unexpected error happened on: %s - %s: %s\n", key.name,
                                    key.file, e.getMessage()));
                        }
                    }
                } catch (IOException e) {
                    //OK, it cannot be parsed, so, we cannot generate its info
                    buffer.append(com.aptana.shared_core.string.StringUtils.format(
                            "Warning: cannot parse: %s - %s (so, it's ok not having additional info on it)\n",
                            key.name, key.file));
                }
            }
        }

        if (info.allOk) {
            buffer.append("All checks OK!\n");
        } else {
            if (fix) {
                buffer.append("Fixing:\n");
                //modules manager
                buffer.append(com.aptana.shared_core.string.StringUtils.format("Removing modules from memory: %s\n", info.modulesNotInDisk));
                info.modulesManager.removeModules(info.modulesNotInDisk);

                buffer.append(com.aptana.shared_core.string.StringUtils.format("Adding to memory modules: %s\n", info.modulesNotInMemory));
                for (ModulesKey key : info.modulesNotInMemory) {
                    buffer.append("Adding modules ...\n");
                    info.modulesManager.addModule(key);
                }

                //additional info
                buffer.append(com.aptana.shared_core.string.StringUtils
                        .format("Removing from additional info: %s\n", info.additionalModulesNotInDisk));
                for (String s : info.additionalModulesNotInDisk) {
                    info.additionalProjectInfo.removeInfoFromModule(s, true);
                }

                buffer.append(com.aptana.shared_core.string.StringUtils.format("Adding to additional info modules found in disk: %s\n",
                        info.moduleNotInAdditionalInfo));
                for (SourceModule mod : info.moduleNotInAdditionalInfo) {
                    info.additionalProjectInfo.addAstInfo(mod.getAst(), mod.getModulesKey(), true);
                }
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.