Create an instance of {@link Kernel}.

@param modules modules to link to the new kernel.
@return the new kernel.
1213
public static final Kernel create(Module... modules) {
		final Injector injector = Guice.createInjector(modules);
		final Kernel k = injector.getInstance(Kernel.class);
		return k;
	}
818729
public Module lookupModule(String mod) {
        Module m = modules.get(mod);
        if (m == null) {
            m = new Module(mod, "???");
            modules.put(mod, m);
        }
        return m;
    }
52833
@XmlElementWrapper(name="modules")
    @XmlElement(name="module", type=Module.class)
    public List<Module> getModules() {
        return modules;
    }
1322143
public static List<DbModule> getAllSubmodules(final DbModule module) {
        final List<DbModule> submodules = new ArrayList<DbModule>();
        submodules.addAll(module.getSubmodules());

        for(final DbModule submodule: module.getSubmodules()){
            submodules.addAll(getAllSubmodules(submodule));
        }

        return submodules;
    }
1056135
public Module build() {
        SagaLibModule module = new SagaLibModule();
        module.setStateStorage(stateStorage);
        module.setTimeoutManager(timeoutMgr);
        module.setScanner(scanner);
        module.setProviderFactory(providerFactory);
        module.setExecutionOrder(preferredOrder);
        module.setExecutionContext(executionContext);
        module.setModuleTypes(moduleTypes);
        module.setExecutor(executor);
        module.setInterceptorTypes(interceptorTypes);
        module.setStrategyFinder(strategyFinder);
        module.setInvoker(invoker);
        module.setCoordinatorFactory(coordinatorFactory);

        return module;
    }
1350170
public static IHelpSet create(HelpModule module) {
        try {
            Class<? extends IHelpSet> clazz = instance.map.get(module.getFormat());
            
            if (clazz == null) {
                throw new Exception("Unsupported help format: " + module.getFormat());
            }
            
            Constructor<? extends IHelpSet> ctor = clazz.getConstructor(HelpModule.class);
            return ctor.newInstance(module);
        } catch (Exception e) {
            log.error("Error creating help set for " + module.getUrl(), e);
            throw MiscUtil.toUnchecked(e);
        }
    }
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);
            }
        }
    }
993689
function Kernel(){
    this.registrations = new Registrations()
    this.decorators = new Decorators()
    this.resolvers = {}
    this.activators = {}
    this._inflight = new Inflight(this.decorators)
    registerSystemServices.call(this)
}
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();
  }
814493
public static Set<Artifact> getAllArtifacts(final Module module) {
        final Set<Artifact> artifacts = new HashSet<Artifact>();
        artifacts.addAll(module.getArtifacts());

        for(final Module submodule: module.getSubmodules()){
            artifacts.addAll(getAllArtifacts(submodule));
        }

        return artifacts;
    }
554957
public void addSoftwareModule(final DmfSoftwareModule createSoftwareModule) {
        if (softwareModules == null) {
            softwareModules = new ArrayList<>();
        }

        softwareModules.add(createSoftwareModule);

    }
343716
public final static Function<BigInteger, BigInteger> module(long module) {
        return new Module(fromNumber(Long.valueOf(module)));
    }
752224
public Injector createChildInjector(Collection<Module> modules)
    {
        Injector childInjector;
        
        Collection<Module> localModules = modules;
        for (ModuleTransformer transformer  : transformers) {
            localModules = transformer.call(localModules);
        }
        //noinspection deprecation
        if ( mode == LifecycleInjectorMode.REAL_CHILD_INJECTORS )
        {
            childInjector = injector.createChildInjector(localModules);
        }
        else 
        {
            childInjector = createSimulatedChildInjector(localModules);
        }
        
        for (PostInjectorAction action : actions) {
            action.call(childInjector);
        }
        
        return childInjector;
    }
1328491
public void initializeMultipleModules( List<? extends IModule> modules ) {
    if (_initialized) {
      throw new IllegalStateException("Illegal attempt to initialize Gosu");
    }
    getGosuInitialization().initializeMultipleModules( _execEnv, modules );
    _initialized = true;
  }
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);
  }
774341
public function initialize(array $modules = null)
    {
        if ($this->initialized) return $this;

        if (is_array($modules)) {
            $this->moduleClasses = $modules;
        } else {
            $this->loadConfiguredModuleClasses();
        }

        $this->populateModuleCollection()
             ->sortModules()
             ->populateAssociatedClassIndex();

        $this->initialized = true;

        return $this;
    }
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);
            }
          });
        }
      }
    );
  }