Creates a new registry and sets it as the default one under the provided name.

@param name the registry name
@return the default registry
@throws IllegalStateException if the name has already been set
187292
public synchronized static HealthCheckRegistry setDefault(String name) {
        final HealthCheckRegistry registry = getOrCreate(name);
        return setDefault(name, registry);
    }
245126
public Name setName(String name) {
		Name property = (name == null) ? null : new Name(name);
		setName(property);
		return property;
	}
1028130
public void setName(String name) {
        String oldname = this.name;
        this.name = name;
        //TODO Reset the main map
        save(oldname);
    }
664560
public static synchronized void removeDefaultResource(String name) {
    if(defaultResources.contains(name)) {
      defaultResources.remove(name);
      for(Configuration conf : REGISTRY.keySet()) { 
        if(conf.loadDefaults) {
          conf.reloadConfiguration();
        }
      }
    }
  }
952935
public <A> A register(final String name, final Class<? extends A> clazz, final A rs) {
        return register(true, name, clazz, rs);
    }
1131051
public PropertyBuilder string(final String name) {
        name(name);
        type(Property.Type.String);
        return this;
    }
1028484
@Nonnull
  public void setRegistry (@Nonnull final IAPIRegistry aRegistry)
  {
    ValueEnforcer.notNull (aRegistry, "Registry");
    if (m_aRWLock.readLocked ( () -> m_aRegistry.getAllAPIDescriptors ().isNotEmpty ()))
      throw new IllegalStateException ("Cannot change the registry after an API was already registered!");

    m_aRWLock.writeLocked ( () -> m_aRegistry = aRegistry);
  }
515374
public void addActivationName(String name)
    {
        if (sealed) onSealedMutation();
        if (activationNames == null)
            activationNames = new HashSet<String>();
        activationNames.add(name);
    }
482630
public static KeyChain configure(final Name name) throws SecurityException {
    PrivateKeyStorage keyStorage = new MemoryPrivateKeyStorage();
    IdentityStorage identityStorage = new MemoryIdentityStorage();
    KeyChain keyChain = new KeyChain(new IdentityManager(identityStorage, keyStorage),
            new SelfVerifyPolicyManager(identityStorage));

    // create keys, certs if necessary
    if (!identityStorage.doesIdentityExist(name)) {
      keyChain.createIdentityAndCertificate(name);
    }

    // set default identity
    keyChain.getIdentityManager().setDefaultIdentity(name);

    return keyChain;
  }
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;
  }
1028854
@SuppressWarnings("unchecked")
    public <T extends XPathBuilder> T setName(final String name) {
        this.name = name;
        return (T) this;
    }
284391
public static <T> T newInstance(String name) {
        try {
            return (T) getClass(name).newInstance();
        } catch (InstantiationException | ClassNotFoundException | IllegalAccessException e) {
            throw new IllegalStateException(e.getMessage(), e);
        }
    }
637029
public static Object newInstance(String name) {
        try {
            return forName(name).newInstance();
        } catch (InstantiationException e) {
            throw new IllegalStateException(e.getMessage(), e);
        } catch (IllegalAccessException e) {
            throw new IllegalStateException(e.getMessage(), e);
        }
    }
807679
public static HealthCheckRegistry tryGetDefault() {
        final String name = defaultRegistryName.get();
        if (name != null) {
            return getOrCreate(name);
        }
        return null;
    }
716824
public Node createChild(final String name) throws IllegalArgumentException {
        // Precondition checks
        if (name == null || name.trim().length() == 0) {
            throw new IllegalArgumentException("name must be specified");
        }

        // Create
        return createChild(Patterns.from(name));
    }
356009
public UpdatePodBuilder name(String name)
  {
    Objects.requireNonNull(name);
    
    if (name.indexOf('.') >= 0) {
      throw new IllegalArgumentException(name);
    }
    
    _name = name;
    
    return this;
  }
683722
public static synchronized void addDefaultResource(String name) {
		if(!defaultResources.contains(name)) {
			defaultResources.add(name);
			for(Configuration conf : REGISTRY.keySet()) {
				if(conf.loadDefaults) {
					conf.reloadConfiguration();
				}
			}
		}
	}