Package org.osgi.service.blueprint.reflect

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


        return map;
    }
   
    public RegistrationListener parseRegistrationListener(Element element, ComponentMetadata enclosingComponent) {
        RegistrationListenerImpl listener = new RegistrationListenerImpl();
        Metadata listenerComponent = null;
        // Parse attributes
        if (element.hasAttribute(REF_ATTRIBUTE)) {
            listenerComponent = new RefMetadataImpl(element.getAttribute(REF_ATTRIBUTE));
        }
        String registrationMethod = null;
View Full Code Here


        }
    }

    private ReferenceListener parseServiceListener(Element element, ComponentMetadata enclosingComponent) {
        ReferenceListenerImpl listener = new ReferenceListenerImpl();
        Metadata listenerComponent = null;
        // Parse attributes
        if (element.hasAttribute(REF_ATTRIBUTE)) {
            listenerComponent = new RefMetadataImpl(element.getAttribute(REF_ATTRIBUTE));
        }
        String bindMethodName = null;
View Full Code Here

                    break;
                }
            }
        }
       
        Metadata value = null;
        for (Metadata v : values) {
            if (v != null) {
                if (value == null) {
                    value = v;
                } else {
View Full Code Here

                        || BLUEPRINT_EXT_NAMESPACE_V1_2.equals(e.getNamespaceURI())) {
                    if (nodeNameEquals(e, DEFAULT_PROPERTIES_ELEMENT)) {
                        if (defaultsRef != null) {
                            throw new ComponentDefinitionException("Only one of " + DEFAULTS_REF_ATTRIBUTE + " attribute or " + DEFAULT_PROPERTIES_ELEMENT + " element is allowed");
                        }
                        Metadata props = parseDefaultProperties(context, metadata, e);
                        metadata.addProperty("defaultProperties", props);
                    } else if (nodeNameEquals(e, LOCATION_ELEMENT)) {
                        locations.add(getTextValue(e));
                    }
                }
View Full Code Here

                        || BLUEPRINT_EXT_NAMESPACE_V1_3.equals(e.getNamespaceURI())) {
                    if (nodeNameEquals(e, DEFAULT_PROPERTIES_ELEMENT)) {
                        if (defaultsRef != null) {
                            throw new ComponentDefinitionException("Only one of " + DEFAULTS_REF_ATTRIBUTE + " attribute or " + DEFAULT_PROPERTIES_ELEMENT + " element is allowed");
                        }
                        Metadata props = parseDefaultProperties(context, metadata, e);
                        metadata.addProperty("defaultProperties", props);
                    } else if (nodeNameEquals(e, LOCATION_ELEMENT)) {
                        locations.add(getTextValue(e));
                    }
                }
View Full Code Here

        assertTrue(metadata instanceof BeanMetadata);
        BeanMetadata comp2 = (BeanMetadata) metadata;
        assertEquals(1, comp2.getProperties().size());
        BeanProperty propertyMetadata = comp2.getProperties().get(0);
        assertEquals("localCache", propertyMetadata.getName());
        Metadata propertyValue = propertyMetadata.getValue();
        assertTrue(propertyValue instanceof BeanMetadata);
        BeanMetadata innerComp = (BeanMetadata) propertyValue;
        assertEquals("org.apache.aries.CacheProperty", innerComp.getClassName());
       
        metadata = registry.getComponentDefinition("myCache");
View Full Code Here

            else
                _logger.debug("Creating blueprint injection metadata to inject the context {} into bean property {}",
                                new Object[] { unitName, property });
        }

        final Metadata target = createTargetMetadata(isPersistenceUnit, ctx,
            unitName);

        return new BeanProperty() {
            public Metadata getValue() {
                return target;
View Full Code Here

            } catch (NumberFormatException nfe) {
                throw new IllegalArgumentException("The string " + index + " could not be parsed as an index.", nfe);
            }
        }
       
        final Metadata target = createTargetMetadata(isPersistenceUnit, ctx,
            unitName);

        return new BeanArgument() {
            public Metadata getValue() {
                return target;
View Full Code Here

      refMetadata.setDependsOn((List<String>) Collections.EMPTY_LIST);
      refMetadata.setId(ctx.generateId());

      // Finally, if this is a persistence context we need to create the
      // entity manager as the Target
      final Metadata target = isPersistenceUnit ? refMetadata
              : createInjectionBeanMetedata(ctx, refMetadata);
      return target;
    }
View Full Code Here

        }
        return action;
    }

    private Metadata parseOptionalCompleters(ParserContext context, ComponentMetadata enclosingComponent, Element element) {
        Metadata metadata = context.parseElement(MapMetadata.class, context.getEnclosingComponent(), (Element) element);
        return metadata;
    }
View Full Code Here

TOP

Related Classes of org.osgi.service.blueprint.reflect.Metadata

Copyright © 2018 www.massapicom. 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.