Configure FHIR properties around the the JPA server via this bean
439563
@Bean
	public DaoConfig daoConfig() {
		DaoConfig retVal = new DaoConfig();
		retVal.setAllowMultipleDelete(true);
		return retVal;
	}
105452
private void addRuntimeNameProperty() throws RepositoryException {
		
		String statement = 
				"/jcr:root" + ISO9075.encodePath(StorageConstants.REPORTS_ROOT) + 
				"//*[@className='ro.nextreports.server.domain.Report']" + 
				"//*[fn:name()='parametersValues']";
		  
		QueryResult queryResult = getTemplate().query(statement);

		NodeIterator nodes = queryResult.getNodes();
		
		LOG.info("RuntimeHistory : Found " + nodes.getSize() + " parameterValues nodes");
		while (nodes.hasNext()) {			
			Node node = nodes.nextNode();
			NodeIterator childrenIt = node.getNodes();
			while (childrenIt.hasNext()) {
				Node child = childrenIt.nextNode();				
				child.setProperty("runtimeName", child.getName());
			}
		}	
		getTemplate().save();		
	}
232210
private void setSpecificFieldsInResult(List<Map<String, Object>> columnsToOutput, EntityMetadata m, List results,
            JsonArray array)
    {
        Map<String, Class> colNameToJavaType = new HashMap<String, Class>();
        for (Map<String, Object> map : columnsToOutput)
        {
            colNameToJavaType.put((String) map.get(Constants.COL_NAME), (Class) map.get(Constants.FIELD_CLAZZ));
        }
        Map<String, List<Object>> outputResults = new HashMap<String, List<Object>>();
        for (JsonElement element : array)
        {
            String column = element.getAsJsonObject().get("key").getAsString();
            String value = element.getAsJsonObject().get("value").getAsString();
            String id = element.getAsJsonObject().get("id").getAsString();
            Object obj = PropertyAccessorHelper.fromSourceToTargetClass(colNameToJavaType.get(column), String.class,
                    value);
            if (colNameToJavaType.size() > 1)
            {
                if (!outputResults.containsKey(id))
                {
                    outputResults.put(id, new ArrayList<Object>());
                }
                outputResults.get(id).add(obj);
            }
            else
            {
                results.add(obj);
            }
        }
        if (colNameToJavaType.size() > 1)
        {
            results.addAll(outputResults.values());
        }
    }
391803
@Override
  public void updateRepositoryItemProperty(MutableRepositoryItem pItem, Object pBean) {
    Object enumItem = getBeanProperty(pBean);
    try {
      Object enumCodeOrValue;
      if(mEnumRepositoryType.getUseCodeForValue()) {
        enumCodeOrValue = mCodeGetter.invoke(enumItem);
      } else {
        enumCodeOrValue = mValueGetter.invoke(enumItem);
      }
      pItem.setPropertyValue(getRepositoryPropertyName(), enumCodeOrValue);
    } catch (Exception e) {
      throw new MappingException(String.format("Error extracting and converting [%s] enum", enumItem), e);
    }
  }
362393
@Override
  protected void configure() {

    // Bind and expose LogWriter (a bit hacky, but needed by MapReduce for now)
    bind(LogWriter.class).to(LocalLogWriter.class);
    expose(LogWriter.class);

    // Bind ServiceAnnouncer for procedure.
    bind(ServiceAnnouncer.class).to(DiscoveryServiceAnnouncer.class);

    // For Binding queue stuff
    bind(QueueReaderFactory.class).in(Scopes.SINGLETON);

    // Bind ProgramRunner
    MapBinder<ProgramRunnerFactory.Type, ProgramRunner> runnerFactoryBinder =
      MapBinder.newMapBinder(binder(), ProgramRunnerFactory.Type.class, ProgramRunner.class);
    runnerFactoryBinder.addBinding(ProgramRunnerFactory.Type.FLOW).to(FlowProgramRunner.class);
    runnerFactoryBinder.addBinding(ProgramRunnerFactory.Type.FLOWLET).to(FlowletProgramRunner.class);

    bind(ProgramRunnerFactory.class).to(InMemoryFlowProgramRunnerFactory.class).in(Scopes.SINGLETON);
    // Note: Expose for test cases. Need to refactor test cases.
    expose(ProgramRunnerFactory.class);

    // For binding DataSet transaction stuff
    install(new DataFabricFacadeModule());
  }
832837
protected Object resolveProviderConfig(String exp, Map<String, ? extends Object> contextMap, LaContainer container,
            Class<?> resultType) {
        if (exp.startsWith(PROVIDER_GET) && exp.endsWith(METHOD_MARK) && exp.contains(".") && !exp.contains("\"")) {
            final String[] tokens = exp.split("\\.");
            if (tokens.length > 1) {
                Object component = null;
                BeanDesc beanDesc = null;
                for (String prop : tokens) {
                    if (prop.endsWith(METHOD_MARK)) { // method
                        if (component == null) { // e.g. getJdbcUrl() only
                            break;
                        }
                        final String methodName = prop.substring(0, prop.length() - METHOD_MARK.length());
                        component = beanDesc.invoke(component, methodName, (Object[]) null);
                        beanDesc = BeanDescFactory.getBeanDesc(component.getClass());
                    } else { // component or property
                        if (beanDesc == null) { // first element
                            if (container.hasComponentDef(prop)) { // component
                                component = container.getComponent(prop);
                                beanDesc = BeanDescFactory.getBeanDesc(component.getClass());
                            } else {
                                break;
                            }
                        } else { // next elements, property
                            final PropertyDesc propertyDesc = beanDesc.getPropertyDesc(prop);
                            if (propertyDesc != null) {
                                component = propertyDesc.getValue(component);
                                beanDesc = BeanDescFactory.getBeanDesc(component.getClass());
                            } else {
                                break;
                            }
                        }
                    }
                }
                if (component != null) {
                    return component;
                }
            }
        }
        return null;
    }
265992
public static void configureAnnotatedHttpServices(
            ServerBuilder server, List<AnnotatedServiceRegistrationBean> beans,
            @Nullable MeterIdPrefixFunctionFactory meterIdPrefixFunctionFactory) {
        requireNonNull(server, "server");
        requireNonNull(beans, "beans");

        beans.forEach(bean -> {
            Function<Service<HttpRequest, HttpResponse>,
                    ? extends Service<HttpRequest, HttpResponse>> decorator = Function.identity();
            for (Function<Service<HttpRequest, HttpResponse>, ? extends Service<HttpRequest, HttpResponse>>
                    d : bean.getDecorators()) {
                decorator = decorator.andThen(d);
            }
            if (meterIdPrefixFunctionFactory != null) {
                decorator = decorator.andThen(
                        metricCollectingServiceDecorator(bean, meterIdPrefixFunctionFactory));
            }
            final ImmutableList<Object> exceptionHandlersAndConverters =
                    ImmutableList.builder()
                                 .addAll(bean.getExceptionHandlers())
                                 .addAll(bean.getRequestConverters())
                                 .addAll(bean.getResponseConverters())
                                 .build();
            server.annotatedService(bean.getPathPrefix(), bean.getService(), decorator,
                                    exceptionHandlersAndConverters);
        });
    }
967287
private void configurePersistenceUnit(PersistenceUnitInfo puInfo, Map props)
    {
        // Invoke Persistence unit MetaData
        if (puInfo.getPersistenceUnitName() == null)
        {
            throw new KunderaException("Persistence unit name should not be null");
        }
        if (logger.isInfoEnabled())
        {
            logger.info("Loading Persistence Unit MetaData For Persistence Unit(s) {}.",
                    puInfo.getPersistenceUnitName());
        }

        String[] persistenceUnits = puInfo.getPersistenceUnitName().split(Constants.PERSISTENCE_UNIT_SEPARATOR);

        new PersistenceUnitConfiguration(props, kunderaMetadata, persistenceUnits).configure(puInfo);
    }
860242
public void init (Properties config, ConnectionProvider conprov, RunQueue pruneQueue)
        throws PersistenceException
    {
        // save this for later
        _config = config;

        // create the user repository
        _repository = createRepository(conprov);

        // fetch the login URL from the properties
        _loginURL = config.getProperty("login_url");
        if (_loginURL == null) {
            log.warning("No login_url supplied in user manager config. Authentication won't work.");
            _loginURL = "/missing_login_url";
        }

        // look up any override to our user auth cookie
        String authCook = config.getProperty("auth_cookie.name");
        if (!StringUtil.isBlank(authCook)) {
            _userAuthCookie = authCook;
        }

        if (USERMGR_DEBUG) {
            log.info("UserManager initialized", "acook", _userAuthCookie, "login", _loginURL);
        }

        // register a cron job to prune the session table every hour
        if (pruneQueue != null) {
            _pruner = new Interval(pruneQueue) {
                @Override public void expired () {
                    try {
                        _repository.pruneSessions();
                    } catch (PersistenceException pe) {
                        log.warning("Error pruning session table.", pe);
                    }
                }
            };
            _pruner.schedule(SESSION_PRUNE_INTERVAL, true);
        }
    }
737788
@SuppressWarnings("unchecked")
    protected void bindManyToOne(Association property, ManyToOne manyToOne,
                                 String path, InFlightMetadataCollector mappings, String sessionFactoryBeanName) {

        NamingStrategy namingStrategy = getNamingStrategy(sessionFactoryBeanName);

        bindManyToOneValues(property, manyToOne);
        PersistentEntity refDomainClass = property instanceof ManyToMany ? property.getOwner() : property.getAssociatedEntity();
        Mapping mapping = getMapping(refDomainClass);
        boolean isComposite = hasCompositeIdentifier(mapping);
        if (isComposite) {
            CompositeIdentity ci = (CompositeIdentity) mapping.getIdentity();
            bindCompositeIdentifierToManyToOne(property, manyToOne, ci, refDomainClass, path, sessionFactoryBeanName);
        }
        else {
            if (property.isCircular() && (property instanceof ManyToMany)) {
                PropertyConfig pc = getPropertyConfig(property);

                if (pc.getColumns().isEmpty()) {
                    mapping.getColumns().put(property.getName(), pc);
                }
                if (!hasJoinKeyMapping(pc) ) {
                    JoinTable jt = new JoinTable();
                    final ColumnConfig columnConfig = new ColumnConfig();
                    columnConfig.setName(namingStrategy.propertyToColumnName(property.getName()) +
                            UNDERSCORE + FOREIGN_KEY_SUFFIX);
                    jt.setKey(columnConfig);
                    pc.setJoinTable(jt);
                }
                bindSimpleValue(property, manyToOne, path, pc, sessionFactoryBeanName);
            }
            else {
                // bind column
                bindSimpleValue(property, null, manyToOne, path, mappings, sessionFactoryBeanName);
            }
        }

        PropertyConfig config = getPropertyConfig(property);
        if ((property instanceof org.grails.datastore.mapping.model.types.OneToOne) && !isComposite) {
            manyToOne.setAlternateUniqueKey(true);
            Column c = getColumnForSimpleValue(manyToOne);
            if (config != null && !config.isUniqueWithinGroup()) {
                c.setUnique(config.isUnique());
            }
            else if (property.isBidirectional() && isHasOne(property.getInverseSide())) {
                c.setUnique(true);
            }
        }
    }
1229051
protected void prepareBeanFactoryByRose(ConfigurableListableBeanFactory beanFactory) {
        BeanDefinitionRegistry registry = (BeanDefinitionRegistry) beanFactory;
        AnnotationConfigUtils.registerAnnotationConfigProcessors(registry);
    }
972946
static void configure(final File f) {
		new Configurator() {

			@Override
			void withConfigurator(JoranConfigurator configurator)
					throws JoranException {
				configurator.doConfigure(f);

			}
		}.configure();
	}
241271
public static void rebindCasConfigurationProperties(final ConfigurationPropertiesBindingPostProcessor binder,
                                                        final ApplicationContext applicationContext) {

        val map = applicationContext.getBeansOfType(CasConfigurationProperties.class);
        val name = map.keySet().iterator().next();
        LOGGER.trace("Reloading CAS configuration via [{}]", name);
        val e = applicationContext.getBean(name);
        binder.postProcessBeforeInitialization(e, name);
        val bean = applicationContext.getAutowireCapableBeanFactory().initializeBean(e, name);
        applicationContext.getAutowireCapableBeanFactory().autowireBean(bean);
        LOGGER.debug("Reloaded CAS configuration [{}]", name);
    }
453075
protected void configureHiOrgServerClient(final Collection<BaseClient> properties) {
        val hiOrgServer = pac4jProperties.getHiOrgServer();
        if (StringUtils.isNotBlank(hiOrgServer.getId()) && StringUtils.isNotBlank(hiOrgServer.getSecret())) {
            val client = new HiOrgServerClient(hiOrgServer.getId(), hiOrgServer.getSecret());
            configureClient(client, hiOrgServer);
            if (StringUtils.isNotBlank(hiOrgServer.getScope())) {
                client.getConfiguration().setScope(hiOrgServer.getScope());
            }
            LOGGER.debug("Created client [{}] with identifier [{}]", client.getName(), client.getKey());
            properties.add(client);
        }
    }
1340370
@Override
    protected void configureService(Environment environment, ApplicationContext context) {
        super.configureService(environment, context);
        environment.jersey().register(new ArtifactIdVersionResource(getArtifactId()));
    }
935055
@Override
	public void registerBeanDefinitions(final AnnotationMetadata importingClassMetadata,
			final BeanDefinitionRegistry registry) {

		Map<String, Object> componentScan = importingClassMetadata
				.getAnnotationAttributes(RemoteApplicationEventScan.class.getName(),
						false);

		Set<String> basePackages = new HashSet<>();
		for (String pkg : (String[]) componentScan.get("value")) {
			if (StringUtils.hasText(pkg)) {
				basePackages.add(pkg);
			}
		}
		for (String pkg : (String[]) componentScan.get("basePackages")) {
			if (StringUtils.hasText(pkg)) {
				basePackages.add(pkg);
			}
		}
		for (Class<?> clazz : (Class[]) componentScan.get("basePackageClasses")) {
			basePackages.add(ClassUtils.getPackageName(clazz));
		}

		if (basePackages.isEmpty()) {
			basePackages.add(
					ClassUtils.getPackageName(importingClassMetadata.getClassName()));
		}

		BeanDefinitionBuilder beanDefinitionBuilder = BeanDefinitionBuilder
				.genericBeanDefinition(BusJacksonMessageConverter.class);
		beanDefinitionBuilder.addPropertyValue("packagesToScan",
				basePackages.toArray(new String[basePackages.size()]));
		AbstractBeanDefinition beanDefinition = beanDefinitionBuilder.getBeanDefinition();

		BeanDefinitionHolder holder = new BeanDefinitionHolder(beanDefinition,
				"busJsonConverter");
		BeanDefinitionReaderUtils.registerBeanDefinition(holder, registry);
	}
56585
protected void configureFacebookClient(final Collection<BaseClient> properties) {
        val fb = pac4jProperties.getFacebook();
        if (StringUtils.isNotBlank(fb.getId()) && StringUtils.isNotBlank(fb.getSecret())) {
            val client = new FacebookClient(fb.getId(), fb.getSecret());

            configureClient(client, fb);
            if (StringUtils.isNotBlank(fb.getScope())) {
                client.setScope(fb.getScope());
            }

            if (StringUtils.isNotBlank(fb.getFields())) {
                client.setFields(fb.getFields());
            }
            LOGGER.debug("Created client [{}] with identifier [{}]", client.getName(), client.getKey());
            properties.add(client);
        }
    }