Creates a new instance of {@link LifecycleInjectorBuilder} with the specified modules.

@param modules the Guice modules to use for the injector builder.
16292
public static LifecycleInjectorBuilder fromModules(List<Module> modules) {
    ServiceLoader<LifecycleInjectorBuilder> builderLoader =
        ServiceLoader.load(LifecycleInjectorBuilder.class);

    // Default to the governator implementation if present
    for (LifecycleInjectorBuilder builder : builderLoader) {
      if (builder.getClass().getName()
          .equals("com.cerner.beadledom.lifecycle.governator.GovernatorLifecycleInjectorBuilder")) {
        return builder.modules(modules);
      }
    }

    // If the governator service provider is not found, default to beadledom Java 6 implementation.
    return new BeadledomLifecycleInjectorBuilder().modules(modules);
  }
985530
public static Map<ModuleAdapter<?>, Object> loadModules(Loader loader,
      Object[] seedModulesOrClasses) {
    Map<ModuleAdapter<?>, Object> seedAdapters =
        new LinkedHashMap<ModuleAdapter<?>, Object>(seedModulesOrClasses.length);
    for (int i = 0; i < seedModulesOrClasses.length; i++) {
      if (seedModulesOrClasses[i] instanceof Class<?>) {
        ModuleAdapter<?> adapter = loader.getModuleAdapter((Class<?>) seedModulesOrClasses[i]);
        seedAdapters.put(adapter, adapter.newModule());
      } else {
        ModuleAdapter<?> adapter = loader.getModuleAdapter(seedModulesOrClasses[i].getClass());
        seedAdapters.put(adapter, seedModulesOrClasses[i]);
      }
    }

    // Add the adapters that we have module instances for. This way we won't
    // construct module objects when we have a user-supplied instance.
    Map<ModuleAdapter<?>, Object> result =
        new LinkedHashMap<ModuleAdapter<?>, Object>(seedAdapters);

    // Next collect included modules
    Map<Class<?>, ModuleAdapter<?>> transitiveInclusions =
        new LinkedHashMap<Class<?>, ModuleAdapter<?>>();
    for (ModuleAdapter<?> adapter : seedAdapters.keySet()) {
      collectIncludedModulesRecursively(loader, adapter, transitiveInclusions);
    }
    // and create them if necessary
    for (ModuleAdapter<?> dependency : transitiveInclusions.values()) {
      if (!result.containsKey(dependency)) {
        result.put(dependency, dependency.newModule());
      }
    }
    return result;
  }
552131
public InjectorBuilder combineWith(Module ... modules) {
        List<Module> m = new ArrayList<>();
        m.add(module);
        m.addAll(Arrays.asList(modules));
        this.module = Modules.combine(m);
        return this;
    }
593451
private void addModules(MavenProject project, MavenProjectDirectoryDescriptor projectDescriptor, ScannerContext scannerContext) {
        File projectDirectory = project.getBasedir();
        Set<File> modules = new HashSet<>();
        for (String moduleName : project.getModules()) {
            File module = new File(projectDirectory, moduleName);
            modules.add(module);
        }
        for (MavenProject module : project.getCollectedProjects()) {
            if (modules.contains(module.getBasedir())) {
                MavenProjectDescriptor moduleDescriptor = resolveProject(module, MavenProjectDescriptor.class, scannerContext);
                projectDescriptor.getModules().add(moduleDescriptor);
            }
        }
    }
816576
public <T extends SourceFile> void initModules(
      List<T> externs, List<JSModule> modules, CompilerOptions options) {
    initOptions(options);

    checkFirstModule(modules);

    this.externs = makeExternInputs(externs);

    // Generate the module graph, and report any errors in the module specification as errors.
    try {
      this.moduleGraph = new JSModuleGraph(modules);
    } catch (JSModuleGraph.ModuleDependenceException e) {
      // problems with the module format.  Report as an error.  The
      // message gives all details.
      report(JSError.make(MODULE_DEPENDENCY_ERROR,
          e.getModule().getName(), e.getDependentModule().getName()));
      return;
    }

    // Creating the module graph can move weak source around, and end up with empty modules.
    fillEmptyModules(getModules());

    this.commentsPerFile = new ConcurrentHashMap<>(moduleGraph.getInputCount());
    initBasedOnOptions();

    initInputsByIdMap();

    initAST();
  }
1069644
public void setImageBuilders(java.util.Collection<ImageBuilder> imageBuilders) {
        if (imageBuilders == null) {
            this.imageBuilders = null;
            return;
        }

        this.imageBuilders = new java.util.ArrayList<ImageBuilder>(imageBuilders);
    }
992218
protected Module createModule(final TwillContext context) {
    return Modules.combine(
      new ConfigModule(cConf, hConf),
      new IOModule(),
      new ZKClientModule(),
      new MetricsClientRuntimeModule().getDistributedModules(),
      new LocationRuntimeModule().getDistributedModules(),
      new DiscoveryRuntimeModule().getDistributedModules(),
      new DataFabricModules().getDistributedModules(),
      new AbstractModule() {
        @Override
        protected void configure() {
          // For Binding queue stuff
          bind(QueueReaderFactory.class).in(Scopes.SINGLETON);

          // For program loading
          install(createProgramFactoryModule());

          // For binding DataSet transaction stuff
          install(new DataFabricFacadeModule());

          bind(ServiceAnnouncer.class).toInstance(new ServiceAnnouncer() {
            @Override
            public Cancellable announce(String serviceName, int port) {
              return context.announce(serviceName, port);
            }
          });
        }
      }
    );
  }
283730
public void addModule(Module module) {
		if (module instanceof HttpAdapterAware) {
			((HttpAdapterAware) module).setHttpAdapter(getHttpAdapter());
		}
		this.moduleRegistry.addModule(module);
	}
391409
static void registerAdditionalModules(
            final ObjectMapper objectMapper,
            final Function<String, String> propertyAccessor) {
        final String moduleClassNames = propertyAccessor.apply("commons.object-mapper-additional-module-class-names");
        if (moduleClassNames != null) {
            for (final String moduleClassName : moduleClassNames.split(",")) {
                registerModule(objectMapper, moduleClassName);
            }
        }
    }
679005
public Governator addModules(Module ... modules) {
        if (modules != null) {
            this.modules.addAll(Arrays.asList(modules));
        }
        return this;
    }
26948
@Override
	public ModuleBuild build(String mid, IResource resource, HttpServletRequest request, List<ICacheKeyGenerator> inKeyGens) throws Exception {

		// Manage life span of thread locals used by this module builder
		if (isFeatureDependent) {
			threadLocalRequest.set(request);
			threadLocalDependentFeatures.set(null);
		}
		try {
			return super.build(mid, resource, request, inKeyGens);
		}	finally {
			if (isFeatureDependent) {
				threadLocalRequest.remove();
				threadLocalDependentFeatures.remove();
			}
		}
	}
242374
public static void buildModulesPackage(List<String> modulesNames) {
		System.out.println(System.getProperty("user.dir"));
		try {
			String baseDir = System.getProperty("user.dir");
			List<File> filesArray = new ArrayList<>();
			for (String module : modulesNames) {
				module = "/"+module.replace(".", "/")+".class";
				filesArray.add(new File(baseDir+module));
			}
			String output = System.getProperty("user.home") + "/modules.jar";

			Manifest manifest = new Manifest();
			manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION,
					"1.0");
			manifest.getMainAttributes().put(Attributes.Name.IMPLEMENTATION_URL,
					"http://samoa.yahoo.com");
			manifest.getMainAttributes().put(
					Attributes.Name.IMPLEMENTATION_VERSION, "0.1");
			manifest.getMainAttributes().put(Attributes.Name.IMPLEMENTATION_VENDOR,
					"Yahoo");
			manifest.getMainAttributes().put(
					Attributes.Name.IMPLEMENTATION_VENDOR_ID, "SAMOA");

			BufferedOutputStream bo;

			bo = new BufferedOutputStream(new FileOutputStream(output));
			JarOutputStream jo = new JarOutputStream(bo, manifest);

			File[] files = filesArray.toArray(new File[filesArray.size()]);
			addEntries(jo,files, baseDir, "");

			jo.close();
			bo.close();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}
36149
private void installModules(final Node node, final NetworkContext context, final Handler<AsyncResult<Void>> doneHandler) {
    List<ModuleContext> modules = new ArrayList<>();
    for (ComponentContext<?> component : context.components()) {
      if (component.isModule()) {
        modules.add(component.asModule());
      }
    }

    final CountingCompletionHandler<Void> counter = new CountingCompletionHandler<Void>(modules.size()).setHandler(doneHandler);
    for (ModuleContext module : modules) {
      installModule(node, module, counter);
    }
  }
1333740
@Override
    public List<String> getInjectionClasses(Container moduleContainer) {
        final List<String> listOfClassNames = new ArrayList<String>();
        
        for(WebAppInjectionClassListCollaborator collab: webAppInjectionClassListCollaborators.services()){
            listOfClassNames.addAll(collab.getInjectionClasses(moduleContainer));
        }
        
        return listOfClassNames;
    }
872206
public static <T> Converter<T> createConverter(
      TypeLiteral<T> typeLiteral, InstantiatorModule... modules) {
    return createConverterForType(typeLiteral.getType(), modules);
  }
1162600
function createInvokeQueue(modules) {

	return modules
		.map((mod) => mod._invokeQueue)
		.reduce((acc, res) => acc.concat(res), []);

}
676538
public function addModules(ServiceBusModule ...$serviceBusModules): void
    {
        foreach ($serviceBusModules as $serviceBusModule)
        {
            $this->modules->attach($serviceBusModule);
        }
    }