Returns a new Atomix configuration.
<p>
The configuration will be loaded from {@code atomix.conf}, {@code atomix.json}, or {@code atomix.properties} if
located on the classpath.

@param registry the Atomix registry
@return a new Atomix configuration
551433
public static AtomixConfig config(AtomixRegistry registry) {
    return config(Thread.currentThread().getContextClassLoader(), null, registry);
  }
1191158
@SuppressWarnings("static-method")
	@Provides
	@Singleton
	public SarlConfig getSarlcConfig(ConfigurationFactory configFactory, Injector injector) {
		final SarlConfig config = SarlConfig.getConfiguration(configFactory);
		injector.injectMembers(config);
		return config;
	}
892452
@RequestMapping(value = "configurations/create", method = RequestMethod.POST)
    public SVNConfiguration newConfiguration(@RequestBody SVNConfiguration configuration) {
        return svnConfigurationService.newConfiguration(configuration);
    }
1038438
@RequestMapping(value = "configurations/create", method = RequestMethod.POST)
    public JenkinsConfiguration newConfiguration(@RequestBody JenkinsConfiguration configuration) {
        return jenkinsService.newConfiguration(configuration);
    }
1231519
@Override
    public ConfigurationAdmin getService(Bundle bundle, ServiceRegistration<ConfigurationAdmin> registration) {
        ServiceReference<ConfigurationAdmin> reference = registration.getReference();
        ced.setServiceReference(reference);
        return new ConfigurationAdminImpl(this, bundle);
    }
482430
public static CipherExecutor newTicketRegistryCipherExecutor(final EncryptionRandomizedSigningJwtCryptographyProperties registry,
                                                                 final String registryName) {
        return newTicketRegistryCipherExecutor(registry, false, registryName);
    }
826729
public static synchronized NameResolverRegistry getDefaultRegistry() {
    if (instance == null) {
      List<NameResolverProvider> providerList = ServiceProviders.loadAll(
          NameResolverProvider.class,
          getHardCodedClasses(),
          NameResolverProvider.class.getClassLoader(),
          new NameResolverPriorityAccessor());
      if (providerList.isEmpty()) {
        logger.warning("No NameResolverProviders found via ServiceLoader, including for DNS. This "
            + "is probably due to a broken build. If using ProGuard, check your configuration");
      }
      instance = new NameResolverRegistry();
      for (NameResolverProvider provider : providerList) {
        logger.fine("Service loader found " + provider);
        if (provider.isAvailable()) {
          instance.addProvider(provider);
        }
      }
      instance.refreshProviders();
    }
    return instance;
  }
774398
public static MetricRegistryConfiguration fromConfiguration(Configuration configuration) {
		ScopeFormats scopeFormats;
		try {
			scopeFormats = ScopeFormats.fromConfig(configuration);
		} catch (Exception e) {
			LOG.warn("Failed to parse scope format, using default scope formats", e);
			scopeFormats = ScopeFormats.fromConfig(new Configuration());
		}

		char delim;
		try {
			delim = configuration.getString(MetricOptions.SCOPE_DELIMITER).charAt(0);
		} catch (Exception e) {
			LOG.warn("Failed to parse delimiter, using default delimiter.", e);
			delim = '.';
		}

		final long maximumFrameSize = AkkaRpcServiceUtils.extractMaximumFramesize(configuration);

		// padding to account for serialization overhead
		final long messageSizeLimitPadding = 256;

		return new MetricRegistryConfiguration(scopeFormats, delim, maximumFrameSize - messageSizeLimitPadding);
	}
911800
@RequestMapping(value = "configurations/create", method = RequestMethod.POST)
    public JIRAConfiguration newConfiguration(@RequestBody JIRAConfiguration configuration) {
        return jiraConfigurationService.newConfiguration(configuration);
    }
629924
@Override
  public Configuration getMainConfiguration() {

    return Tang.Factory.getTang().newConfigurationBuilder()
            .bindImplementation(RuntimeClasspathProvider.class, YarnClasspathProvider.class)
            .bindConstructor(org.apache.hadoop.yarn.conf.YarnConfiguration.class, YarnConfigurationConstructor.class)
            .build();
  }
436243
public static ConfigurationOption newConfiguration(String pid) {
        return new org.ops4j.pax.exam.cm.internal.ConfigurationProvisionOption(pid, new HashMap<String, Object>());
    }
758773
protected Map<String, OperationTransformer> buildOperationTransformers(AttributeTransformationDescriptionBuilderImpl.AttributeTransformationDescriptionBuilderRegistry registry) {
        final Map<String, OperationTransformer> operations = new HashMap<String, OperationTransformer>();
        for(final Map.Entry<String, OperationTransformationEntry> entry: operationTransformers.entrySet()) {
            final OperationTransformer transformer = entry.getValue().getOperationTransformer(registry);
            operations.put(entry.getKey(), transformer);
        }
        return operations;
    }
715957
private UserRegistry getUserRegistryFromConfiguration() throws RegistryException {
        String[] refIds = this.refId;
        if (refIds == null || refIds.length == 0) {
            // Can look for config.source = file
            // If thats set, and we're missing this, we can error.
            // If its not set, we don't have configuration from the
            // file and we should try to resolve if we have one instance defined?
            Tr.error(tc, "USER_REGISTRY_SERVICE_CONFIG_ERROR_NO_REFID");
            throw new RegistryException(TraceNLS.getFormattedMessage(
                                                                     this.getClass(),
                                                                     TraceConstants.MESSAGE_BUNDLE,
                                                                     "USER_REGISTRY_SERVICE_CONFIG_ERROR_NO_REFID",
                                                                     null,
                                                                     "CWWKS3000E: A configuration error has occurred. There is no configured refId parameter for the userRegistry configuration."));
        } else if (refIds.length == 1) {
            return getUserRegistry(refIds[0]);
        } else {
            // Multiple refIds, we'll use the UserRegistryProxy.
            List<UserRegistry> delegates = new ArrayList<UserRegistry>();
            for (String refId : refIds) {
                delegates.add(getUserRegistry(refId));
            }
            return new UserRegistryProxy(realm, delegates);
        }
    }
403069
public static Map<String, Object> getRegistry(String registryName) {
		if (StringUtils.isBlank(registryName)) {
			return null;
		}
		Sysprop registryObject = readRegistryObject(registryName);
		return registryObject == null ? null : registryObject.getProperties();
	}
755490
protected <T> RegistrationAnnotatedBindingBuilder<T> register(Class<T> type) {
        return registryBinderImpl.register(type);
    }
421188
@Override
  public Configuration getConfiguration() {
    return Tang.Factory.getTang().newConfigurationBuilder()
        .bindNamedParameter(TcpPortRangeBegin.class, String.valueOf(portRangeBegin))
        .bindNamedParameter(TcpPortRangeCount.class, String.valueOf(portRangeCount))
        .bindNamedParameter(TcpPortRangeTryCount.class, String.valueOf(portRangeTryCount))
        .bindSetEntry(EvaluatorConfigurationProviders.class, TcpPortConfigurationProvider.class)
        .build();
  }
1212405
protected MetricRegistryImpl createMetricRegistry(Configuration config) {
		return new MetricRegistryImpl(
			MetricRegistryConfiguration.fromConfiguration(config),
			ReporterSetup.fromConfiguration(config));
	}