Examples of ComponentMetadata


Examples of org.osgi.service.blueprint.reflect.ComponentMetadata

        return cm;
    }

    private static ComponentMetadata getLanguageResolverReference(ParserContext context, String language) {
        ComponentDefinitionRegistry componentDefinitionRegistry = context.getComponentDefinitionRegistry();
        ComponentMetadata cm = componentDefinitionRegistry.getComponentDefinition(".camelBlueprint.languageResolver." + language);
        if (cm == null) {
            MutableReferenceMetadata svc = context.createMetadata(MutableReferenceMetadata.class);
            svc.setId(".camelBlueprint.languageResolver." + language);
            svc.setFilter("(language=" + language + ")");
            svc.setAvailability(componentDefinitionRegistry.containsComponentDefinition(language) ? AVAILABILITY_OPTIONAL : AVAILABILITY_MANDATORY);
View Full Code Here

Examples of org.osgi.service.blueprint.reflect.ComponentMetadata

        return cm;
    }

    private static ComponentMetadata getComponentResolverReference(ParserContext context, String component) {
        ComponentDefinitionRegistry componentDefinitionRegistry = context.getComponentDefinitionRegistry();
        ComponentMetadata cm = componentDefinitionRegistry.getComponentDefinition(".camelBlueprint.componentResolver." + component);
        if (cm == null) {
            MutableReferenceMetadata svc = context.createMetadata(MutableReferenceMetadata.class);
            svc.setId(".camelBlueprint.componentResolver." + component);
            svc.setFilter("(component=" + component + ")");
            svc.setAvailability(componentDefinitionRegistry.containsComponentDefinition(component) ? AVAILABILITY_OPTIONAL : AVAILABILITY_MANDATORY);
View Full Code Here

Examples of org.osgi.service.blueprint.reflect.ComponentMetadata

        public void afterDestroy(Object bean, String beanName) {
        }

        @Override
        protected boolean isSingleton(Object bean, String beanName) {
            ComponentMetadata meta = blueprintContainer.getComponentMetadata(beanName);
            if (meta != null && meta instanceof BeanMetadata) {
                String scope = ((BeanMetadata) meta).getScope();
                if (scope != null) {
                    return BeanMetadata.SCOPE_SINGLETON.equals(scope);
                }
View Full Code Here

Examples of org.osgi.service.blueprint.reflect.ComponentMetadata

                new Object[] { satisfiable.getName(), bundle.getSymbolicName(), satisfiable.isSatisfied() });
        if (state == State.Create || state == State.Created ) {
            Map<String, List<SatisfiableRecipe>> dependencies = getSatisfiableDependenciesMap();
            for (Map.Entry<String, List<SatisfiableRecipe>> entry : dependencies.entrySet()) {
                String name = entry.getKey();
                ComponentMetadata metadata = componentDefinitionRegistry.getComponentDefinition(name);
                if (metadata instanceof ServiceMetadata) {
                    ServiceRecipe reg = (ServiceRecipe) repository.getRecipe(name);
                    synchronized (reg) {
                        boolean satisfied = true;
                        for (SatisfiableRecipe recipe : entry.getValue()) {
View Full Code Here

Examples of org.osgi.service.blueprint.reflect.ComponentMetadata

    }

    private void instantiateEagerComponents() {
        List<String> components = new ArrayList<String>();
        for (String name : componentDefinitionRegistry.getComponentDefinitionNames()) {
            ComponentMetadata component = componentDefinitionRegistry.getComponentDefinition(name);
            boolean eager = component.getActivation() == ComponentMetadata.ACTIVATION_EAGER;
            if (component instanceof BeanMetadata) {
                BeanMetadata local = (BeanMetadata) component;
                eager &= MetadataUtil.isSingletonScope(local);
            }
            if (eager) {
View Full Code Here

Examples of org.osgi.service.blueprint.reflect.ComponentMetadata

            throw new ComponentDefinitionException("Cound not create component instance for " + id, t);
        }
    }

    public ComponentMetadata getComponentMetadata(String id) {
        ComponentMetadata metadata = componentDefinitionRegistry.getComponentDefinition(id);
        if (metadata == null) {
            throw new NoSuchComponentException(id);
        }
        return metadata;
    }
View Full Code Here

Examples of org.osgi.service.blueprint.reflect.ComponentMetadata

    }

    public <T extends ComponentMetadata> Collection<T> getMetadata(Class<T> clazz) {
        Collection<T> metadatas = new ArrayList<T>();
        for (String name : componentDefinitionRegistry.getComponentDefinitionNames()) {
            ComponentMetadata component = componentDefinitionRegistry.getComponentDefinition(name);
            getMetadata(clazz, component, metadatas);
        }
        metadatas = Collections.unmodifiableCollection(metadatas);
        return metadatas;
    }
View Full Code Here

Examples of org.osgi.service.blueprint.reflect.ComponentMetadata

    public void injectBeanInstance(BeanMetadata bmd, Object o)
        throws IllegalArgumentException, ComponentDefinitionException {
        ExecutionContext origContext
            = ExecutionContext.Holder.setContext((ExecutionContext)getRepository());
        try {
            ComponentMetadata cmd = componentDefinitionRegistry.getComponentDefinition(bmd.getId());
            if (cmd == null || cmd != bmd) {
                throw new IllegalArgumentException(bmd.getId() + " not found in blueprint container");
            }
            Recipe r = this.getRepository().getRecipe(bmd.getId());
            if (r instanceof BeanRecipe) {
View Full Code Here

Examples of org.osgi.service.blueprint.reflect.ComponentMetadata

   
    public BlueprintRepository createRepository() {
        BlueprintRepository repository = new BlueprintRepository(blueprintContainer);
        // Create component recipes
        for (String name : registry.getComponentDefinitionNames()) {
            ComponentMetadata component = registry.getComponentDefinition(name);
            Recipe recipe = createRecipe(component);
            repository.putRecipe(recipe.getName(), recipe);
        }
        repository.validate();
        return repository;
View Full Code Here

Examples of org.osgi.service.blueprint.reflect.ComponentMetadata

        if (nodeNameEquals(element, DESCRIPTION_ELEMENT)) {
            // Ignore description
        } else if (nodeNameEquals(element, TYPE_CONVERTERS_ELEMENT)) {
            parseTypeConverters(element);
        } else if (nodeNameEquals(element, BEAN_ELEMENT)) {
            ComponentMetadata component = parseBeanMetadata(element, true);
            registry.registerComponentDefinition(component);
        } else if (nodeNameEquals(element, SERVICE_ELEMENT)) {
            ComponentMetadata service = parseService(element, true);
            registry.registerComponentDefinition(service);
        } else if (nodeNameEquals(element, REFERENCE_ELEMENT)) {
            ComponentMetadata reference = parseReference(element, true);
            registry.registerComponentDefinition(reference);
        } else if (nodeNameEquals(element, REFERENCE_LIST_ELEMENT) ) {
            ComponentMetadata references = parseRefList(element, true);
            registry.registerComponentDefinition(references);
        } else {
            throw new ComponentDefinitionException("Unknown element " + element.getNodeName() + " in namespace " + BLUEPRINT_NAMESPACE);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.