Registers a new MBean with the platform MBean server.
@param bean the bean being registered
@param parent if not null, the new bean will be registered as a child
node of this parent.
345598
public void register(ZKMBeanInfo bean, ZKMBeanInfo parent)
        throws JMException
    {
        assert bean != null;
        String path = null;
        if (parent != null) {
            path = mapBean2Path.get(parent);
            assert path != null;
        }
        path = makeFullPath(path, parent);
        mapBean2Path.put(bean, path);
        mapName2Bean.put(bean.getName(), bean);
        if(bean.isHidden())
            return;
        MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
        ObjectName oname = makeObjectName(path, bean);
        try {
            mbs.registerMBean(bean, oname);
        } catch (JMException e) {
            LOG.warn("Failed to register MBean " + bean.getName());
            throw e;
        }
    }
794038
public void register(Class<?> type, String name, Object... args) {
    Assert.notNull(name, "class'name is null");
    if (0 == args.length) {
      nameTypes.put(name, type);
    } else {
      // 注册bean的name和别名
      BeanDefinition bd = (BeanDefinition) args[0];
      definitionRegistry.registerBeanDefinition(name, bd);
      // for list(a.class,b.class) binding usage
      String alias = bd.getBeanClassName();
      if (bd.isSingleton() && !name.equals(alias) && !definitionRegistry.isBeanNameInUse(alias)) {
        definitionRegistry.registerAlias(name, alias);
      }
      if (null == type) {
        if (!bd.isAbstract()) throw new RuntimeException("Concrete bean should has class.");
      } else nameTypes.put(name, type);
    }
  }
1303461
@Override
    public void addBean(String name, Object bean) {
        BeanDefine beanDefine = new BeanDefine(bean);
        put(name, beanDefine);
        // add interface、put to pool
        Class<?>[] interfaces = beanDefine.getType().getInterfaces();
        if (interfaces.length > 0) {
            for (Class<?> interfaceClazz : interfaces) {
                this.put(interfaceClazz.getName(), beanDefine);
            }
        }
    }
854698
protected static void register(Class<?> parent, String cname) {
    Entry e = data.get(parent);
    if(e == null) {
      data.put(parent, e = new Entry());
    }
    e.addName(cname);
  }
21558
public final void enlistBean(ContainerTx tx, BeanO bean)
    {
        bean.getActivationStrategy().atEnlist(tx, bean);
    }
1101413
public static BeanDefinitionHolder registerBean(String beanId, Class<?> beanClass, ParserContext parserContext, boolean shouldFireEvents) {
        return registerBean(beanId, BeanDefinitionBuilder.genericBeanDefinition(beanClass).getBeanDefinition(), parserContext, shouldFireEvents);
    }
254028
protected final void setParentNode(final DiffNode parentNode)
	{
		if (this.parentNode != null && this.parentNode != parentNode)
		{
			throw new IllegalStateException("The parent of a node cannot be changed, once it's set.");
		}
		this.parentNode = parentNode;
	}
812507
public void setParents(java.util.Collection<Parent> parents) {
        if (parents == null) {
            this.parents = null;
            return;
        }

        this.parents = new java.util.ArrayList<Parent>(parents);
    }
864269
private void registerServiceProxy(DefaultListableBeanFactory defaultListableBeanFactory, String servicePath, String serviceBeanName) {
		BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(JsonServiceExporter.class).addPropertyReference("service", serviceBeanName);
		BeanDefinition serviceBeanDefinition = findBeanDefinition(defaultListableBeanFactory, serviceBeanName);
		for (Class<?> currentInterface : getBeanInterfaces(serviceBeanDefinition, defaultListableBeanFactory.getBeanClassLoader())) {
			if (currentInterface.isAnnotationPresent(JsonRpcService.class)) {
				String serviceInterface = currentInterface.getName();
				logger.debug("Registering interface '{}' for JSON-RPC bean [{}].", serviceInterface, serviceBeanName);
				builder.addPropertyValue("serviceInterface", serviceInterface);
				break;
			}
		}
		if (objectMapper != null) {
			builder.addPropertyValue("objectMapper", objectMapper);
		}

		if (errorResolver != null) {
			builder.addPropertyValue("errorResolver", errorResolver);
		}

		if (invocationListener != null) {
			builder.addPropertyValue("invocationListener", invocationListener);
		}

		if (registerTraceInterceptor != null) {
			builder.addPropertyValue("registerTraceInterceptor", registerTraceInterceptor);
		}

		if (httpStatusCodeProvider != null) {
			builder.addPropertyValue("httpStatusCodeProvider", httpStatusCodeProvider);
		}

		if (convertedParameterTransformer != null) {
			builder.addPropertyValue("convertedParameterTransformer", convertedParameterTransformer);
		}

		builder.addPropertyValue("backwardsCompatible", backwardsCompatible);
		builder.addPropertyValue("rethrowExceptions", rethrowExceptions);
		builder.addPropertyValue("allowExtraParams", allowExtraParams);
		builder.addPropertyValue("allowLessParams", allowLessParams);

		defaultListableBeanFactory.registerBeanDefinition(servicePath, builder.getBeanDefinition());
	}
133132
public void setBeans(Collection<?> beans)
    {
        if (!CollectionUtils.isEmpty(beans))
        {
            for (Object bean : beans)
            {
                register(bean);
            }
        }
    }
810168
void setParent(JMFMessageData parent) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            JmfTr.entry(this, tc, "setParent", new Object[] { parent });

        synchronized (getMessageLockArtefact()) {

            // If the parent is a JSMessageData then this is straight forward
            if (parent instanceof JSMessageData) {
                parentMessage = (JSMessageData) parent;
                master = ((JSMessageData) parent).master;
                containingMessage = ((JSMessageData) parent).compatibilityWrapperOrSelf;
            }

            // ... if not, it must be a JSCompatibleMessageImpl, and its encoding must
            // be a JSMessageData, because if it was a JMFEncapsulation it couldn't be our parent
            else {
                JSMessageData msg = (JSMessageData) ((JSCompatibleMessageImpl) parent).getEncodingMessage();
                parentMessage = msg;
                master = msg.master;
                containingMessage = parent;
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            JmfTr.exit(this, tc, "setParent");
    }
538922
void handleMBeans(final HikariPool hikariPool, final boolean register)
   {
      if (!config.isRegisterMbeans()) {
         return;
      }

      try {
         final MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();

         final ObjectName beanConfigName = new ObjectName("com.zaxxer.hikari:type=PoolConfig (" + poolName + ")");
         final ObjectName beanPoolName = new ObjectName("com.zaxxer.hikari:type=Pool (" + poolName + ")");
         if (register) {
            if (!mBeanServer.isRegistered(beanConfigName)) {
               mBeanServer.registerMBean(config, beanConfigName);
               mBeanServer.registerMBean(hikariPool, beanPoolName);
            } else {
               logger.error("{} - JMX name ({}) is already registered.", poolName, poolName);
            }
         }
         else if (mBeanServer.isRegistered(beanConfigName)) {
            mBeanServer.unregisterMBean(beanConfigName);
            mBeanServer.unregisterMBean(beanPoolName);
         }
      }
      catch (Exception e) {
         logger.warn("{} - Failed to {} management beans.", poolName, (register ? "register" : "unregister"), e);
      }
   }
1176637
public SpringApplicationBuilder parent(ConfigurableApplicationContext parent) {
		this.parent = new SpringApplicationBuilder();
		this.parent.context = parent;
		this.parent.running.set(true);
		return this;
	}
329196
public static void registerBeanParser(BeanParser beanParser, Class<?>... supportClasses) {
    for (Class<?> supportClass : supportClasses) {
      typeBeanParserMap.put(supportClass, beanParser);
    }
  }
526391
public Subscription register(final Object mBean, final String name){
        try {
            if (mbeanSupport.get()) {
                final ObjectName objectName = new ObjectName(name);
                server.registerMBean(mBean, objectName);
                return new Subscription() {
                    @Override
                    public void unsubscribe() {
                        try {
                            server.unregisterMBean(objectName);
                        } catch (JMException e) {
                            throw new RuntimeException("Can not unsubscribe!", e);
                        }
                    }
                };
            } else {
                return new Subscription() {
                    @Override
                    public void unsubscribe() {
                    }
                };
            }
        } catch (Exception e) {
            throw new RuntimeException("Can not register MBean!", e);
        }
    }
678447
public static NodeImpl createBeanNode(final NodeImpl parent) {
    return new NodeImpl( //
        null, //
        parent, //
        false, //
        null, //
        null, //
        ElementKind.BEAN, EMPTY_CLASS_ARRAY, //
        null, //
        null, //
        null, //
        null //
    );
  }
998630
function (beanDef, beanName, packageDef) {
        var keyType = beanDef.$keyType;
        var parentKeyType = null;
        var parent = beanDef[jv._MD_PARENTDEF];
        if (!parent[jv._MD_BUILTIN]) {
            parentKeyType = parent.$keyType;
            if (keyType == null) {
                beanDef.$keyType = parentKeyType;
                return;
            }
        } else if (keyType == null) {
            // keyType not specified
            return;
        }
        jv._preprocessBean(keyType, beanName + ".$keyType", packageDef);
        if (parentKeyType != null) {
            __checkInheritance(parentKeyType, keyType);
        }
        // in all cases, keyType must be a sub-type of aria.core.JsonTypes.String
        if (keyType[jv._MD_BASETYPE].typeName != "String") {
            jv._logError(jv.INHERITANCE_EXPECTED, [keyType[jv._MD_TYPENAME], jv._BASE_TYPES_PACKAGE + ".String"]);
            return;
        }
    }