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


Java MutableBeanMetadata类代码示例

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


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

示例1: process

import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入依赖的package包/类
@Override
public void process(ComponentDefinitionRegistry cdr) {
    BlueprintContainer container = getComponent(cdr, "blueprintContainer");
    Bundle bundle = getComponent(cdr, "blueprintBundle");
    cdr.registerComponentDefinition(createServiceRef(JPA_COORDINATOR, Coordinator.class));

    Set<String> components = new HashSet<String>(cdr.getComponentDefinitionNames());
    for (String component : components) {
        ComponentMetadata compDef = cdr.getComponentDefinition(component);
        
        if (compDef instanceof MutableBeanMetadata && !((MutableBeanMetadata)compDef).isProcessor()) {
            // Normal bean def
            handleComponent((MutableBeanMetadata)compDef, bundle, cdr, container);
        } else if(compDef instanceof MutableServiceMetadata) {
            // Bean inlined into service def
            MutableServiceMetadata sMeta = (MutableServiceMetadata)compDef;
            Target target = sMeta.getServiceComponent();
            if (target instanceof MutableBeanMetadata) {
                handleComponent((MutableBeanMetadata)target, bundle, cdr, container);
            }
        }
    }
}
 
开发者ID:apache,项目名称:aries-jpa,代码行数:24,代码来源:JpaComponentProcessor.java

示例2: enableComponentProcessorProperty

import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入依赖的package包/类
private static ComponentMetadata enableComponentProcessorProperty(final Attr attr,
        final ComponentMetadata component, final ParserContext context, final String propertyName) {
    if (component != null) {
        throw new ComponentDefinitionException("Attribute " + attr.getNodeName()
                + " can only be used on the root <blueprint> element");
    }

    LOG.debug("{}: {}", propertyName, attr.getValue());

    if (!Boolean.parseBoolean(attr.getValue())) {
        return component;
    }

    MutableBeanMetadata metadata = registerComponentProcessor(context);
    metadata.addProperty(propertyName, createValue(context, "true"));

    return component;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:19,代码来源:OpendaylightNamespaceHandler.java

示例3: registerComponentProcessor

import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入依赖的package包/类
private static MutableBeanMetadata registerComponentProcessor(final ParserContext context) {
    ComponentDefinitionRegistry registry = context.getComponentDefinitionRegistry();
    MutableBeanMetadata metadata = (MutableBeanMetadata) registry.getComponentDefinition(COMPONENT_PROCESSOR_NAME);
    if (metadata == null) {
        metadata = createBeanMetadata(context, COMPONENT_PROCESSOR_NAME, ComponentProcessor.class, false, true);
        metadata.setProcessor(true);
        addBlueprintBundleRefProperty(context, metadata);
        metadata.addProperty("blueprintContainerRestartService", createServiceRef(context,
                BlueprintContainerRestartService.class, null));

        LOG.debug("Registering ComponentProcessor bean: {}", metadata);

        registry.registerComponentDefinition(metadata);
    }

    return metadata;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:18,代码来源:OpendaylightNamespaceHandler.java

示例4: parseActionProvider

import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入依赖的package包/类
private static Metadata parseActionProvider(final Element element, final ParserContext context) {
    registerRpcProviderServiceRefBean(context);
    registerRpcRegistryServiceRefBean(context);
    registerSchemaServiceRefBean(context);

    MutableBeanMetadata metadata = createBeanMetadata(context, context.generateId(), ActionProviderBean.class,
            true, true);
    addBlueprintBundleRefProperty(context, metadata);
    metadata.addProperty("rpcProviderService", createRef(context, RPC_PROVIDER_SERVICE_NAME));
    metadata.addProperty("rpcRegistry", createRef(context, RPC_REGISTRY_NAME));
    metadata.addProperty("schemaService", createRef(context, SCHEMA_SERVICE_NAME));
    metadata.addProperty("interfaceName", createValue(context, element.getAttribute(INTERFACE)));

    if (element.hasAttribute(REF_ATTR)) {
        metadata.addProperty("implementation", createRef(context, element.getAttribute(REF_ATTR)));
    }

    LOG.debug("parseActionProvider returning {}", metadata);
    return metadata;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:21,代码来源:OpendaylightNamespaceHandler.java

示例5: parseRpcImplementation

import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入依赖的package包/类
private static Metadata parseRpcImplementation(final Element element, final ParserContext context) {
    registerRpcRegistryServiceRefBean(context);

    MutableBeanMetadata metadata = createBeanMetadata(context, context.generateId(), RpcImplementationBean.class,
            true, true);
    addBlueprintBundleRefProperty(context, metadata);
    metadata.addProperty("rpcRegistry", createRef(context, RPC_REGISTRY_NAME));
    metadata.addProperty("implementation", createRef(context, element.getAttribute(REF_ATTR)));

    if (element.hasAttribute(INTERFACE)) {
        metadata.addProperty("interfaceName", createValue(context, element.getAttribute(INTERFACE)));
    }

    LOG.debug("parseRpcImplementation returning {}", metadata);
    return metadata;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:17,代码来源:OpendaylightNamespaceHandler.java

示例6: createBeanMetadata

import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入依赖的package包/类
private static MutableBeanMetadata createBeanMetadata(final ParserContext context, final String id,
        final Class<?> runtimeClass, final boolean initMethod, final boolean destroyMethod) {
    MutableBeanMetadata metadata = context.createMetadata(MutableBeanMetadata.class);
    metadata.setId(id);
    metadata.setScope(BeanMetadata.SCOPE_SINGLETON);
    metadata.setActivation(ReferenceMetadata.ACTIVATION_EAGER);
    metadata.setRuntimeClass(runtimeClass);

    if (initMethod) {
        metadata.setInitMethod("init");
    }

    if (destroyMethod) {
        metadata.setDestroyMethod("destroy");
    }

    return metadata;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:19,代码来源:OpendaylightNamespaceHandler.java

示例7: processMutableBeanMetadata

import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入依赖的package包/类
private void processMutableBeanMetadata(final MutableBeanMetadata bean) {
    if (restartDependentsOnUpdates && bean.getRuntimeClass() != null
            && AbstractPropertyPlaceholder.class.isAssignableFrom(bean.getRuntimeClass())) {
        LOG.debug("{}: Found PropertyPlaceholder bean: {}, runtime {}", logName(), bean.getId(),
                bean.getRuntimeClass());

        for (BeanProperty prop : bean.getProperties()) {
            if (CM_PERSISTENT_ID_PROPERTY.equals(prop.getName())) {
                if (prop.getValue() instanceof ValueMetadata) {
                    ValueMetadata persistentId = (ValueMetadata)prop.getValue();

                    LOG.debug("{}: Found {} property, value : {}", logName(),
                            CM_PERSISTENT_ID_PROPERTY, persistentId.getStringValue());

                    registerManagedService(persistentId.getStringValue());
                } else {
                    LOG.debug("{}: {} property metadata {} is not instanceof ValueMetadata",
                            logName(), CM_PERSISTENT_ID_PROPERTY, prop.getValue());
                }

                break;
            }
        }
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:26,代码来源:ComponentProcessor.java

示例8: createBeanMetadata

import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入依赖的package包/类
public MutableBeanMetadata createBeanMetadata(Element element, ParserContext context, Class<?> runtimeClass) {
    MutableBeanMetadata answer = context.createMetadata(MutableBeanMetadata.class);
    answer.setRuntimeClass(runtimeClass);
    answer.addProperty("blueprintContainer", createRef(context, "blueprintContainer"));
    answer.addProperty("bundleContext", createRef(context, "blueprintBundleContext"));
    // set the Bean scope to be prototype, so we can get a new instance per looking up
    answer.setScope(BeanMetadata.SCOPE_PROTOTYPE);
    
    if (!StringUtils.isEmpty(getIdOrName(element))) {
        answer.setId(getIdOrName(element));
    } else {
        // TODO we may need to throw exception for it
        answer.setId("camel.cxf.endpoint." + runtimeClass.getSimpleName() + "." + context.generateId());
    }
    return answer;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:17,代码来源:AbstractBeanDefinitionParser.java

示例9: 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

示例10: 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

示例11: parseElement

import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入依赖的package包/类
private void parseElement(Element elt, ParserContext pc) {
    ComponentDefinitionRegistry cdr = pc.getComponentDefinitionRegistry();

    if ("enable".equals(elt.getLocalName()) &&
        !cdr.containsComponentDefinition(JpaComponentProcessor.class.getSimpleName())) {
        MutableBeanMetadata meta = pc.createMetadata(MutableBeanMetadata.class);
        meta.setId(JpaComponentProcessor.class.getSimpleName());
        meta.setRuntimeClass(JpaComponentProcessor.class);
        meta.setProcessor(true);
        meta.addProperty("pc", passThrough(pc, pc));
        cdr.registerComponentDefinition(meta);
    }
}
 
开发者ID:apache,项目名称:aries-jpa,代码行数:14,代码来源:JpaNsHandler.java

示例12: registerRoutedRpcRegistrationConverter

import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入依赖的package包/类
private static void registerRoutedRpcRegistrationConverter(final ParserContext context) {
    ComponentDefinitionRegistry registry = context.getComponentDefinitionRegistry();
    if (registry.getComponentDefinition(ROUTED_RPC_REG_CONVERTER_NAME) == null) {
        MutableBeanMetadata metadata = createBeanMetadata(context, ROUTED_RPC_REG_CONVERTER_NAME,
                RoutedRpcRegistrationConverter.class, false, false);
        metadata.setActivation(ReferenceMetadata.ACTIVATION_LAZY);
        registry.registerTypeConverter(metadata);
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:10,代码来源:OpendaylightNamespaceHandler.java

示例13: parseNotificationListener

import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入依赖的package包/类
private static Metadata parseNotificationListener(final Element element, final ParserContext context) {
    registerNotificationServiceRefBean(context);

    MutableBeanMetadata metadata = createBeanMetadata(context, context.generateId(), NotificationListenerBean.class,
            true, true);
    addBlueprintBundleRefProperty(context, metadata);
    metadata.addProperty("notificationService", createRef(context, NOTIFICATION_SERVICE_NAME));
    metadata.addProperty("notificationListener", createRef(context, element.getAttribute(REF_ATTR)));

    LOG.debug("parseNotificationListener returning {}", metadata);

    return metadata;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:14,代码来源:OpendaylightNamespaceHandler.java

示例14: process

import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入依赖的package包/类
@Override
public void process(final ComponentDefinitionRegistry registry) {
    LOG.debug("{}: In process",  logName());

    for (String name : registry.getComponentDefinitionNames()) {
        ComponentMetadata component = registry.getComponentDefinition(name);
        if (component instanceof MutableBeanMetadata) {
            processMutableBeanMetadata((MutableBeanMetadata) component);
        } else if (component instanceof MutableServiceReferenceMetadata) {
            processServiceReferenceMetadata((MutableServiceReferenceMetadata)component);
        }
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:14,代码来源:ComponentProcessor.java

示例15: authBeanProcessor

import org.apache.aries.blueprint.mutable.MutableBeanMetadata; //导入依赖的package包/类
private MutableBeanMetadata authBeanProcessor( ParserContext pc, ComponentDefinitionRegistry cdr )
{
    MutableBeanMetadata meta = pc.createMetadata( MutableBeanMetadata.class );
    meta.setId( AuthorizationBeanProcessor.AUTH_PROCESSOR_BEAN_NAME );
    meta.setRuntimeClass( AuthorizationBeanProcessor.class );
    meta.setProcessor( true );
    meta.addProperty( "cdr", passThrough( pc, cdr ) );
    return meta;
}
 
开发者ID:subutai-io,项目名称:base,代码行数:10,代码来源:AuthorizationNsHandler.java


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