Override to configure the {@link Hibernate5Module}.
766089
protected Hibernate5Module createHibernate5Module() {
        Hibernate5Module module = new Hibernate5Module();
        if (lazyLoadingEnabled) {
            module.enable(Feature.FORCE_LAZY_LOADING);
        }
        return module;
    }
371663
void addModuleResource(String moduleResource) {

        CmsModuleResourceSelectField resField = createModuleResourceField(moduleResource);
        if (resField != null) {
            m_moduleResourcesGroup.addRow(resField);
        }
    }
1236574
@Override
    public T addAsModules(final File... resources) throws IllegalArgumentException {
        // Precondition checks
        Validate.notNull(resources, "resources must be specified");

        // Add each
        for (final File resource : resources) {
            this.addAsModule(resource);
        }

        // Return
        return this.covarientReturn();
    }
935024
public AbstractModule createModule() {
        return new AbstractModule() {
            @Override
            protected void configure() {
                bind(IDataFactory.class).to(mDataFacClass);
                bind(IMetaEntryFactory.class).to(mMetaFacClass);
                bind(IRevisioning.class).to(mRevisioningClass);
                bind(IByteHandlerPipeline.class).toInstance(mByteHandler);
                install(new FactoryModuleBuilder().implement(IBackend.class, mBackend).build(
                    IBackendFactory.class));
                install(new FactoryModuleBuilder().build(IResourceConfigurationFactory.class));
                bind(Key.class).toInstance(mKey);
                install(new FactoryModuleBuilder().build(ISessionConfigurationFactory.class));
            }
        };
    }
1326740
public void addModule(Module module) {
        PreconditionUtil.verify(!initialized, "CrnkClient already initialized, cannot add further modules");
        if (module instanceof HttpAdapterAware) {
            ((HttpAdapterAware) module).setHttpAdapter(getHttpAdapter());
        }
        this.moduleRegistry.addModule(module);
    }
1175048
@Override
  protected void configure() {
    try {
      InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());
      File appRoot = new File(System.getProperty(CadmiumListener.BASE_PATH_ENV), "maven");
      FileUtils.forceMkdir(appRoot);
      String remoteMavenRepo = System.getProperty(MAVEN_REPOSITORY);
      ArtifactResolver resolver = new ArtifactResolver(remoteMavenRepo, appRoot.getAbsolutePath());
      bind(ArtifactResolver.class).toInstance(resolver);
      bind(JBossAdminApi.class);
      Multibinder<ConfigurationListener> listenerBinder = Multibinder.newSetBinder(binder(), ConfigurationListener.class);
      listenerBinder.addBinding().to(JBossAdminApi.class);
      bind(IJBossUtil.class).to(JBossDelegator.class);
    } catch(Exception e) {
      logger.error("Failed to initialize maven artifact resolver.", e);
    }
  }
252719
private void addModuleToTree(final DbModule module, final TreeNode tree) {
        final TreeNode subTree = new TreeNode();
        subTree.setName(module.getName());
        tree.addChild(subTree);

        // Add SubsubModules
        for (final DbModule subsubmodule : module.getSubmodules()) {
            addModuleToTree(subsubmodule, subTree);
        }
    }
570225
private static void setupBindInfoPackage() {
		String nsuri = "http://www.hibernate.org/xsd/orm/hbm";
		String packageInfoClassName = "org.hibernate.boot.jaxb.hbm.spi.package-info";
		try {
			final Class<?> packageInfoClass = Class
					.forName(packageInfoClassName);
			final XmlSchema xmlSchema = packageInfoClass
					.getAnnotation(XmlSchema.class);
			if (xmlSchema == null) {
				LOG.warn(MessageFormat.format(
						"Class [{0}] is missing the [{1}] annotation. Processing bindings will probably fail.",
						packageInfoClassName, XmlSchema.class.getName()));
			} else {
				final String namespace = xmlSchema.namespace();
				if (nsuri.equals(namespace)) {
					LOG.warn(MessageFormat.format(
							"Namespace of the [{0}] annotation does not match [{1}]. Processing bindings will probably fail.",
							XmlSchema.class.getName(), nsuri));
				}
			}
		} catch (ClassNotFoundException cnfex) {
			LOG.warn(MessageFormat.format(
					"Class [{0}] could not be found. Processing bindings will probably fail.",
					packageInfoClassName), cnfex);
		}
	}
992054
@Override
    public void setupModule(SetupContext context) {
        FindSerializers serializers = new FindSerializers(jsonContext);
        locator.inject(serializers);
        locator.postConstruct(serializers);
        context.addSerializers(serializers);

        FindDeserializers deserializers = new FindDeserializers(jsonContext);
        locator.inject(deserializers);
        locator.postConstruct(deserializers);
        context.addDeserializers(deserializers);
    }
494075
public Governator addModules(List<Module> modules) {
        if (modules != null) {
            this.modules.addAll(modules);
        }
        return this;
    }
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);
  }
177866
public void contributeToModule() {
		final GuiceModuleAccess module = this.module.get();
		if (!this.removableBindings.isEmpty()) {
			// Ok, we are broking the Java secutiry manager.
			// But it's for having something working!
			try {
				final Field field = module.getClass().getDeclaredField("bindings"); //$NON-NLS-1$
				final boolean accessible = field.isAccessible();
				try {
					field.setAccessible(true);
					final Collection<?> hiddenBindings = (Collection<?>) field.get(module);
					hiddenBindings.removeAll(this.removableBindings);
				} finally {
					field.setAccessible(accessible);
				}
			} catch (Exception exception) {
				throw new IllegalStateException(exception);
			}
		}
		module.addAll(this.bindings);
	}
1279314
@Override
    protected void configure()
    {
        final ExportBuilder builder = MBeanModule.newExporter(binder());
        builder.export(CollectorController.class).as("com.ning.metrics.eventtracker:name=CollectorController");
    }
221542
public static void createModulesOverview() {

        Map<String, List<ClassField>> hmModules = HortonMachine.getInstance().moduleName2Fields;
        Map<String, List<ClassField>> jggModules = JGrassGears.getInstance().moduleName2Fields;
        Map<String, Class< ? >> hmModulesClasses = HortonMachine.getInstance().moduleName2Class;
        Map<String, Class< ? >> jggModulesClasses = JGrassGears.getInstance().moduleName2Class;

        Set<String> hmNames = hmModules.keySet();
        String[] hmNamesArray = (String[]) hmNames.toArray(new String[hmNames.size()]);

        Set<String> jggNames = jggModules.keySet();
        String[] jggNamesArray = (String[]) jggNames.toArray(new String[jggNames.size()]);

        Arrays.sort(hmNamesArray);
        Arrays.sort(jggNamesArray);

        StringBuilder sb = new StringBuilder();

        sb.append("#summary An overview of the modules implemented in the HortonMachine\n\n");
        sb.append("<wiki:toc max_depth=\"4\" />\n\n");
        sb.append("= HortonMachine Modules Overview =\n");
        sb.append("== !HortonMachine Modules ==\n");

        String status = "CERTIFIED";
        sb.append("=== Release ready ==\n");
        dumpModules(hmModules, hmModulesClasses, hmNamesArray, sb, status);
        status = "TESTED";
        sb.append("=== Tested but not for upcoming release ==\n");
        dumpModules(hmModules, hmModulesClasses, hmNamesArray, sb, status);
        status = "DRAFT";
        sb.append("=== Module that are not passing the QA rules yet ==\n");
        dumpModules(hmModules, hmModulesClasses, hmNamesArray, sb, status);

        sb.append("\n<BR/><BR/><BR/>\n\n");
        sb.append("== Gears Modules ==\n");
        status = "CERTIFIED";
        sb.append("=== Release ready ==\n");
        dumpModules(jggModules, jggModulesClasses, jggNamesArray, sb, status);
        status = "TESTED";
        sb.append("=== Tested but not for upcoming release ==\n");
        dumpModules(jggModules, jggModulesClasses, jggNamesArray, sb, status);
        status = "DRAFT";
        sb.append("=== Module that are not passing the QA rules yet ==\n");
        dumpModules(jggModules, jggModulesClasses, jggNamesArray, sb, status);

        System.out.println(sb.toString());
    }
603528
private void registerModulesForCustomFieldDef(ObjectMapper objectMapper) {
		SimpleModule simpleModule = new SimpleModule("CustomFieldDefinition", new Version(1, 0, 0, null));
		simpleModule.addDeserializer(CustomFieldDefinition.class, new CustomFieldDefinitionDeserializer());
		objectMapper.registerModule(simpleModule);
		objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
	}
465622
@SuppressWarnings("rawtypes")
   @Override
   public void configure(Map props) throws HibernateException
   {
      try {
         LOGGER.debug("Configuring HikariCP");

         this.hcfg = HikariConfigurationUtil.loadConfiguration(props);
         this.hds = new HikariDataSource(this.hcfg);

      }
      catch (Exception e) {
         throw new HibernateException(e);
      }

      LOGGER.debug("HikariCP Configured");
   }
1191436
protected void preloadModules() {

        // Add default ModuleModel component interface (because it cannot be added by module starter, API is not processed with annotation engine)
        JRebirthThread.getThread().getFacade().componentFactory().define(
                                                                         RegistrationPointItemBase.create()
                                                                                                  .interfaceClass(ModuleModel.class)
                                                                                                  .exclusive(false)
                                                                                                  .reverse(false));

        final ServiceLoader<ModuleStarter> loader = ServiceLoader.load(ModuleStarter.class);

        final List<ModuleStarter> modules = new ArrayList<>();
        loader.iterator().forEachRemaining(modules::add);

        modules.stream()
               .sorted((m1, m2) -> -1 * Integer.compare(m1.priority(), m2.priority()))
               .forEach(ModuleStarter::start);

    }