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


Java MutableBeanMetadata.addDependsOn方法代码示例

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


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

示例1: parse

import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入方法依赖的package包/类
public Metadata parse(Element element, ParserContext context, Class<?> runtime) {
    MutableBeanMetadata config = createBeanMetadata(element, context, runtime);
    config.setScope(BeanMetadata.SCOPE_PROTOTYPE);
    String camelContextId = "camelContext";
    NamedNodeMap atts = element.getAttributes();
    for (int i = 0; i < atts.getLength(); i++) {
        Attr node = (Attr) atts.item(i);
        String val = node.getValue();
        //String pre = node.getPrefix();
        String name = node.getLocalName();
        if ("camelContextId".equals(name)) {
            camelContextId = val;
        }
    }
    config.addDependsOn(camelContextId);
    config.addProperty("camelContext", createRef(context, camelContextId));
    return config;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:AbstractBeanDefinitionParser.java

示例2: registerBean

import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入方法依赖的package包/类
protected void registerBean(ParserContext context, String contextId, AbstractCamelFactoryBean<?> fact) {
    String id = fact.getId();

    fact.setCamelContextId(contextId);

    MutablePassThroughMetadata eff = context.createMetadata(MutablePassThroughMetadata.class);
    eff.setId(".camelBlueprint.bean.passthrough." + id);
    eff.setObject(new PassThroughCallable<Object>(fact));

    MutableBeanMetadata ef = context.createMetadata(MutableBeanMetadata.class);
    ef.setId(".camelBlueprint.bean.factory." + id);
    ef.setFactoryComponent(eff);
    ef.setFactoryMethod("call");
    ef.addProperty("blueprintContainer", createRef(context, "blueprintContainer"));
    ef.setInitMethod("afterPropertiesSet");
    ef.setDestroyMethod("destroy");

    MutableBeanMetadata e = context.createMetadata(MutableBeanMetadata.class);
    e.setId(id);
    e.setRuntimeClass(fact.getObjectType());
    e.setFactoryComponent(ef);
    e.setFactoryMethod("getObject");
    e.addDependsOn(".camelBlueprint.processor.bean." + contextId);

    context.getComponentDefinitionRegistry().registerComponentDefinition(e);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:27,代码来源:CamelNamespaceHandler.java

示例3: parseContainerElement

import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入方法依赖的package包/类
private Metadata parseContainerElement(Element element, ParserContext parserContext) {
    final MutableBeanMetadata bean = parserContext.createMetadata(MutableBeanMetadata.class);
    final String quietPeriodInMs = Optional.ofNullable(StringUtils.trimToNull(element.getAttribute(QUIET_PERIOD_IN_MS_ATTR))).orElse(String.valueOf(defaultQuietPeriodInMs));

    bean.setClassName(OsgiContainer.class.getName());
    bean.setRuntimeClass(OsgiContainer.class);
    bean.setId(element.getAttribute(ID_ATTR));
    bean.addDependsOn(BUNDLE_CONTEXT_ID);
    bean.addArgument(bundleContextRef(parserContext), BundleContext.class.getName(), 0);
    bean.addArgument(value(parserContext, quietPeriodInMs, Long.TYPE), Long.TYPE.getName(), 1);
    return bean;
}
 
开发者ID:Microbule,项目名称:microbule,代码行数:13,代码来源:MicrobuleNamespaceHandler.java

示例4: parseProxyElement

import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入方法依赖的package包/类
protected Metadata parseProxyElement(Element element, ParserContext parserContext) {
    whenNotExists(parserContext, JAXRS_PROXY_FACTORY_ID, this::createJaxrsProxyFactoryReference);

    MutableBeanMetadata bean = parserContext.createMetadata(MutableBeanMetadata.class);
    bean.setId(element.getAttribute(ID_ATTR));
    bean.addDependsOn(JAXRS_PROXY_FACTORY_ID);
    bean.setRuntimeClass(JaxrsProxyFactory.class);
    bean.setFactoryComponent(ref(parserContext, JAXRS_PROXY_FACTORY_ID));
    bean.setFactoryMethod(CREATE_PROXY_METHOD);
    bean.addArgument(value(parserContext, serviceInterfaceOf(element), Class.class), Class.class.getName(), 0);
    LOGGER.debug("Created proxy bean: {}", bean);
    return bean;
}
 
开发者ID:Microbule,项目名称:microbule,代码行数:14,代码来源:MicrobuleNamespaceHandler.java


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