当前位置: 首页>>代码示例>>Java>>正文


Java ManagedList.isEmpty方法代码示例

本文整理汇总了Java中org.springframework.beans.factory.support.ManagedList.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java ManagedList.isEmpty方法的具体用法?Java ManagedList.isEmpty怎么用?Java ManagedList.isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.beans.factory.support.ManagedList的用法示例。


在下文中一共展示了ManagedList.isEmpty方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addIncludePatterns

import org.springframework.beans.factory.support.ManagedList; //导入方法依赖的package包/类
private void addIncludePatterns(Element element, ParserContext parserContext, BeanDefinition beanDef) {
	ManagedList<TypedStringValue> includePatterns = new ManagedList<TypedStringValue>();
	NodeList childNodes = element.getChildNodes();
	for (int i = 0; i < childNodes.getLength(); i++) {
		Node node = childNodes.item(i);
		if (node instanceof Element) {
			Element includeElement = (Element) node;
			TypedStringValue valueHolder = new TypedStringValue(includeElement.getAttribute("name"));
			valueHolder.setSource(parserContext.extractSource(includeElement));
			includePatterns.add(valueHolder);
		}
	}
	if (!includePatterns.isEmpty()) {
		includePatterns.setSource(parserContext.extractSource(element));
		beanDef.getPropertyValues().add("includePatterns", includePatterns);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:AspectJAutoProxyBeanDefinitionParser.java

示例2: parseResourceChain

import org.springframework.beans.factory.support.ManagedList; //导入方法依赖的package包/类
private void parseResourceChain(RootBeanDefinition resourceHandlerDef, ParserContext parserContext,
		Element element, Object source) {

	String autoRegistration = element.getAttribute("auto-registration");
	boolean isAutoRegistration = !(StringUtils.hasText(autoRegistration) && "false".equals(autoRegistration));

	ManagedList<? super Object> resourceResolvers = new ManagedList<Object>();
	resourceResolvers.setSource(source);
	ManagedList<? super Object> resourceTransformers = new ManagedList<Object>();
	resourceTransformers.setSource(source);

	parseResourceCache(resourceResolvers, resourceTransformers, element, source);
	parseResourceResolversTransformers(isAutoRegistration, resourceResolvers, resourceTransformers,
			parserContext, element, source);

	if (!resourceResolvers.isEmpty()) {
		resourceHandlerDef.getPropertyValues().add("resourceResolvers", resourceResolvers);
	}
	if (!resourceTransformers.isEmpty()) {
		resourceHandlerDef.getPropertyValues().add("resourceTransformers", resourceTransformers);
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:23,代码来源:ResourcesBeanDefinitionParser.java

示例3: getMessageHandlerBeanName

import org.springframework.beans.factory.support.ManagedList; //导入方法依赖的package包/类
private static String getMessageHandlerBeanName(Element element, ParserContext parserContext, String sqsClientBeanName) {
    BeanDefinitionBuilder queueMessageHandlerDefinitionBuilder = BeanDefinitionBuilder.rootBeanDefinition(QueueMessageHandler.class);

    ManagedList<?> argumentResolvers = getArgumentResolvers(element, parserContext);
    if (!argumentResolvers.isEmpty()) {
        queueMessageHandlerDefinitionBuilder.addPropertyValue("customArgumentResolvers", argumentResolvers);
    }

    ManagedList<BeanDefinition> returnValueHandlers = getReturnValueHandlers(element, parserContext);
    returnValueHandlers.add(createSendToHandlerMethodReturnValueHandlerBeanDefinition(element, parserContext, sqsClientBeanName));
    queueMessageHandlerDefinitionBuilder.addPropertyValue("customReturnValueHandlers", returnValueHandlers);

    String messageHandlerBeanName = parserContext.getReaderContext().generateBeanName(queueMessageHandlerDefinitionBuilder.getBeanDefinition());
    parserContext.getRegistry().registerBeanDefinition(messageHandlerBeanName, queueMessageHandlerDefinitionBuilder.getBeanDefinition());

    return messageHandlerBeanName;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-aws,代码行数:18,代码来源:AnnotationDrivenQueueListenerBeanDefinitionParser.java

示例4: parseNodePropertyProviders

import org.springframework.beans.factory.support.ManagedList; //导入方法依赖的package包/类
private void parseNodePropertyProviders(BeanDefinitionBuilder boot, Element rootEl, ParserContext ctx) {
    ManagedList<RuntimeBeanReference> propertyProviders = new ManagedList<>();

    subElements(rootEl, "property-providers", "provider").forEach(provider ->
        parseRefOrBean(provider, ctx).ifPresent(propertyProviders::add)
    );

    if (!propertyProviders.isEmpty()) {
        boot.addPropertyValue("propertyProviders", propertyProviders);
    }
}
 
开发者ID:hekate-io,项目名称:hekate,代码行数:12,代码来源:HekateBeanDefinitionParser.java

示例5: parseClusterAcceptors

import org.springframework.beans.factory.support.ManagedList; //导入方法依赖的package包/类
private void parseClusterAcceptors(BeanDefinitionBuilder cluster, Element clusterEl, ParserContext ctx) {
    ManagedList<RuntimeBeanReference> acceptors = new ManagedList<>();

    subElements(clusterEl, "acceptors", "acceptor").forEach(valEl ->
        parseRefOrBean(valEl, ctx).ifPresent(acceptors::add)
    );

    if (!acceptors.isEmpty()) {
        cluster.addPropertyValue("acceptors", acceptors);
    }
}
 
开发者ID:hekate-io,项目名称:hekate,代码行数:12,代码来源:HekateBeanDefinitionParser.java

示例6: parseClusterListeners

import org.springframework.beans.factory.support.ManagedList; //导入方法依赖的package包/类
private void parseClusterListeners(BeanDefinitionBuilder cluster, Element clusterEl, ParserContext ctx) {
    ManagedList<RuntimeBeanReference> listeners = new ManagedList<>();

    subElements(clusterEl, "listeners", "listener").forEach(valEl ->
        parseRefOrBean(valEl, ctx).ifPresent(listeners::add)
    );

    if (!listeners.isEmpty()) {
        cluster.addPropertyValue("clusterListeners", listeners);
    }
}
 
开发者ID:hekate-io,项目名称:hekate,代码行数:12,代码来源:HekateBeanDefinitionParser.java

示例7: parseCoordinationService

import org.springframework.beans.factory.support.ManagedList; //导入方法依赖的package包/类
private Optional<RuntimeBeanReference> parseCoordinationService(Element rootEl, ParserContext ctx) {
    Element coordinationEl = getChildElementByTagName(rootEl, "coordination");

    if (coordinationEl != null) {
        BeanDefinitionBuilder coordination = newBean(CoordinationServiceFactory.class, coordinationEl);

        ManagedList<RuntimeBeanReference> processes = new ManagedList<>();

        getChildElementsByTagName(coordinationEl, "process").forEach(processEl -> {
            BeanDefinitionBuilder process = newBean(CoordinationProcessConfig.class, processEl);

            setProperty(process, processEl, "name", "name");

            setBeanOrRef(process, processEl, "handler", "handler", ctx);
            setBeanOrRef(process, processEl, "messageCodec", "message-codec", ctx);

            processes.add(registerInnerBean(process, ctx));
        });

        if (!processes.isEmpty()) {
            coordination.addPropertyValue("processes", processes);
        }

        String id = coordinationEl.getAttribute("id");

        if (!id.isEmpty()) {
            deferredBaseBeans.put(newLazyBean(CoordinationServiceBean.class, coordinationEl), id);
        }

        return Optional.of(registerInnerBean(coordination, ctx));
    } else {
        return Optional.empty();
    }
}
 
开发者ID:hekate-io,项目名称:hekate,代码行数:35,代码来源:HekateBeanDefinitionParser.java

示例8: parseElectionService

import org.springframework.beans.factory.support.ManagedList; //导入方法依赖的package包/类
private Optional<RuntimeBeanReference> parseElectionService(Element rootEl, ParserContext ctx) {
    Element leaderEl = getChildElementByTagName(rootEl, "election");

    if (leaderEl != null) {
        BeanDefinitionBuilder leader = newBean(ElectionServiceFactory.class, leaderEl);

        ManagedList<RuntimeBeanReference> candidates = new ManagedList<>();

        getChildElementsByTagName(leaderEl, "candidate").forEach(candidateEl -> {
            BeanDefinitionBuilder candidate = newBean(CandidateConfig.class, candidateEl);

            setProperty(candidate, candidateEl, "group", "group");

            parseRefOrBean(candidateEl, ctx).ifPresent(bean ->
                candidate.addPropertyValue("candidate", bean)
            );

            candidates.add(registerInnerBean(candidate, ctx));
        });

        if (!candidates.isEmpty()) {
            leader.addPropertyValue("candidates", candidates);
        }

        String id = leaderEl.getAttribute("id");

        if (!id.isEmpty()) {
            deferredBaseBeans.put(newLazyBean(ElectionServiceBean.class, leaderEl), id);
        }

        return Optional.of(registerInnerBean(leader, ctx));
    } else {
        return Optional.empty();
    }
}
 
开发者ID:hekate-io,项目名称:hekate,代码行数:36,代码来源:HekateBeanDefinitionParser.java

示例9: doParse

import org.springframework.beans.factory.support.ManagedList; //导入方法依赖的package包/类
@Override
protected void doParse(Element rootEl, ParserContext ctx, BeanDefinitionBuilder boot) {
    setProperty(boot, rootEl, "nodeName", "name");
    setProperty(boot, rootEl, "clusterName", "cluster");

    parseNodeRoles(boot, rootEl);

    parseProperties(rootEl).ifPresent(props ->
        boot.addPropertyValue("properties", props)
    );

    parseNodePropertyProviders(boot, rootEl, ctx);

    parseDefaultCodec(boot, rootEl, ctx);

    ManagedList<RuntimeBeanReference> services = new ManagedList<>();

    parseClusterService(rootEl, ctx).ifPresent(services::add);
    parseNetworkService(rootEl, ctx).ifPresent(services::add);
    parseMessagingService(rootEl, ctx).ifPresent(services::add);
    parseRpcService(rootEl, ctx).ifPresent(services::add);
    parseLockService(rootEl, ctx).ifPresent(services::add);
    parseCoordinationService(rootEl, ctx).ifPresent(services::add);
    parseElectionService(rootEl, ctx).ifPresent(services::add);
    parseLocalMetricsService(rootEl, ctx).ifPresent(services::add);
    parseClusterMetricsService(rootEl, ctx).ifPresent(services::add);

    subElements(rootEl, "custom-services", "service").forEach(serviceEl ->
        parseRefOrBean(serviceEl, ctx).ifPresent(services::add)
    );

    if (!services.isEmpty()) {
        boot.addPropertyValue("services", services);
    }

    ManagedList<RuntimeBeanReference> plugins = new ManagedList<>();

    subElements(rootEl, "plugins", "plugin").forEach(pluginEl ->
        parseRefOrBean(pluginEl, ctx).ifPresent(plugins::add)
    );

    if (!plugins.isEmpty()) {
        boot.addPropertyValue("plugins", plugins);
    }
}
 
开发者ID:hekate-io,项目名称:hekate,代码行数:46,代码来源:HekateBeanDefinitionParser.java

示例10: parseNetworkService

import org.springframework.beans.factory.support.ManagedList; //导入方法依赖的package包/类
private Optional<RuntimeBeanReference> parseNetworkService(Element rootEl, ParserContext ctx) {
    Element netEl = getChildElementByTagName(rootEl, "network");

    if (netEl != null) {
        BeanDefinitionBuilder net = newBean(NetworkServiceFactory.class, netEl);

        setProperty(net, netEl, "host", "host");
        setProperty(net, netEl, "port", "port");
        setProperty(net, netEl, "portRange", "port-range");
        setProperty(net, netEl, "connectTimeout", "connect-timeout-ms");
        setProperty(net, netEl, "acceptRetryInterval", "accept-retry-interval-ms");
        setProperty(net, netEl, "heartbeatInterval", "heartbeat-interval-ms");
        setProperty(net, netEl, "heartbeatLossThreshold", "heartbeat-loss-threshold");
        setProperty(net, netEl, "nioThreads", "nio-threads");
        setProperty(net, netEl, "transport", "transport");
        setProperty(net, netEl, "tcpNoDelay", "tcp-no-delay");
        setProperty(net, netEl, "tcpReceiveBufferSize", "tcp-receive-buffer-size");
        setProperty(net, netEl, "tcpSendBufferSize", "tcp-send-buffer-size");
        setProperty(net, netEl, "tcpReuseAddress", "tcp-reuse-address");
        setProperty(net, netEl, "tcpBacklog", "tcp-backlog");

        setBeanOrRef(net, netEl, "hostSelector", "host-selector", ctx);

        ManagedList<RuntimeBeanReference> connectors = new ManagedList<>();

        for (Element connEl : subElements(netEl, "connectors", "connector")) {
            BeanDefinitionBuilder conn = newBean(NetworkConnectorConfig.class, connEl);

            setProperty(conn, connEl, "protocol", "protocol");
            setProperty(conn, connEl, "idleSocketTimeout", "idle-socket-timeout-ms");
            setProperty(conn, connEl, "nioThreads", "nio-threads");
            setProperty(conn, connEl, "logCategory", "log-category");

            setBeanOrRef(conn, connEl, "serverHandler", "server-handler", ctx);
            setBeanOrRef(conn, connEl, "messageCodec", "message-codec", ctx);

            connectors.add(registerInnerBean(conn, ctx));

            String protocol = connEl.getAttribute("protocol");

            if (!protocol.isEmpty()) {
                BeanDefinitionBuilder connBean = newLazyBean(NetworkConnectorBean.class, netEl);

                setProperty(connBean, connEl, "protocol", "protocol");

                deferredBaseBeans.put(connBean, protocol);
            }
        }

        if (!connectors.isEmpty()) {
            net.addPropertyValue("connectors", connectors);
        }

        String id = netEl.getAttribute("id");

        if (!id.isEmpty()) {
            deferredBaseBeans.put(newLazyBean(NetworkServiceBean.class, netEl), id);
        }

        return Optional.of(registerInnerBean(net, ctx));
    } else {
        return Optional.empty();
    }
}
 
开发者ID:hekate-io,项目名称:hekate,代码行数:65,代码来源:HekateBeanDefinitionParser.java

示例11: parseMessagingService

import org.springframework.beans.factory.support.ManagedList; //导入方法依赖的package包/类
private Optional<RuntimeBeanReference> parseMessagingService(Element rootEl, ParserContext ctx) {
    Element msgEl = getChildElementByTagName(rootEl, "messaging");

    if (msgEl != null) {
        BeanDefinitionBuilder msg = newBean(MessagingServiceFactory.class, msgEl);

        ManagedList<RuntimeBeanReference> channels = new ManagedList<>();

        for (Element channelEl : getChildElementsByTagName(msgEl, "channel")) {
            BeanDefinitionBuilder channel = newBean(MessagingChannelConfig.class, channelEl);

            // Channel type.
            String type = channelEl.getAttribute("base-type").trim();

            if (!type.isEmpty()) {
                channel.addConstructorArgValue(type);
            }

            // Attributes.
            setProperty(channel, channelEl, "name", "name");
            setProperty(channel, channelEl, "workerThreads", "worker-threads");
            setProperty(channel, channelEl, "backupNodes", "backup-nodes");
            setProperty(channel, channelEl, "partitions", "partitions");
            setProperty(channel, channelEl, "logCategory", "log-category");
            setProperty(channel, channelEl, "messagingTimeout", "messaging-timeout-ms");

            // Nested elements.
            setBeanOrRef(channel, channelEl, "receiver", "receiver", ctx);
            setBeanOrRef(channel, channelEl, "loadBalancer", "load-balancer", ctx);
            setBeanOrRef(channel, channelEl, "messageCodec", "message-codec", ctx);
            setBeanOrRef(channel, channelEl, "clusterFilter", "cluster-filter", ctx);
            setBeanOrRef(channel, channelEl, "failoverPolicy", "failover-policy", ctx);

            parseCommonMessagingConfig(channelEl, channel, ctx);

            // Register channel bean definition.
            channels.add(registerInnerBean(channel, ctx));

            String name = channelEl.getAttribute("name");

            if (!name.isEmpty()) {
                BeanDefinitionBuilder channelBean = newLazyBean(MessagingChannelBean.class, channelEl);

                setProperty(channelBean, channelEl, "channel", "name");

                deferredBaseBeans.put(channelBean, name);
            }
        }

        if (!channels.isEmpty()) {
            msg.addPropertyValue("channels", channels);
        }

        String id = msgEl.getAttribute("id");

        if (!id.isEmpty()) {
            deferredBaseBeans.put(newLazyBean(MessagingServiceBean.class, msgEl), id);
        }

        return Optional.of(registerInnerBean(msg, ctx));
    } else {
        return Optional.empty();
    }
}
 
开发者ID:hekate-io,项目名称:hekate,代码行数:65,代码来源:HekateBeanDefinitionParser.java

示例12: parseLockService

import org.springframework.beans.factory.support.ManagedList; //导入方法依赖的package包/类
private Optional<RuntimeBeanReference> parseLockService(Element rootEl, ParserContext ctx) {
    Element locksEl = getChildElementByTagName(rootEl, "locks");

    if (locksEl != null) {
        BeanDefinitionBuilder locks = newBean(LockServiceFactory.class, locksEl);

        setProperty(locks, locksEl, "retryInterval", "retry-interval-ms");
        setProperty(locks, locksEl, "nioThreads", "nio-threads");
        setProperty(locks, locksEl, "workerThreads", "worker-threads");

        ManagedList<RuntimeBeanReference> regions = new ManagedList<>();

        getChildElementsByTagName(locksEl, "region").forEach(regionEl -> {
            BeanDefinitionBuilder region = newBean(LockRegionConfig.class, regionEl);

            setProperty(region, regionEl, "name", "name");

            regions.add(registerInnerBean(region, ctx));

            String name = regionEl.getAttribute("name");

            if (!name.isEmpty()) {
                BeanDefinitionBuilder regionBean = newLazyBean(LockRegionBean.class, regionEl);

                setProperty(regionBean, regionEl, "region", "name");

                deferredBaseBeans.put(regionBean, name);
            }

            getChildElementsByTagName(regionEl, "lock").forEach(lockEl -> {
                String lockName = lockEl.getAttribute("name");

                if (!lockName.isEmpty()) {
                    BeanDefinitionBuilder lockBean = newLazyBean(LockBean.class, lockEl);

                    setProperty(lockBean, regionEl, "region", "name");
                    setProperty(lockBean, lockEl, "name", "name");

                    deferredBaseBeans.put(lockBean, lockName);
                }
            });
        });

        if (!regions.isEmpty()) {
            locks.addPropertyValue("regions", regions);
        }

        String id = locksEl.getAttribute("id");

        if (!id.isEmpty()) {
            deferredBaseBeans.put(newLazyBean(LockServiceBean.class, locksEl), id);
        }

        return Optional.of(registerInnerBean(locks, ctx));
    } else {
        return Optional.empty();
    }
}
 
开发者ID:hekate-io,项目名称:hekate,代码行数:59,代码来源:HekateBeanDefinitionParser.java


注:本文中的org.springframework.beans.factory.support.ManagedList.isEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。