Package org.osgi.service.blueprint.reflect

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


        }
        this.properties.add(property);
    }

    public BeanProperty addProperty(String name, Metadata value) {
        BeanProperty prop = new BeanPropertyImpl(name, value);
        addProperty(prop);
        return prop;
    }
View Full Code Here


            Node node = nl.item(i);
            if (node instanceof Element) {
                Element e = (Element) node;
                if (BLUEPRINT_CM_NAMESPACE.equals(e.getNamespaceURI())) {
                    if (nodeNameEquals(e, PROPERTY_ELEMENT)) {
                        BeanProperty prop = context.parseElement(BeanProperty.class, enclosingComponent, e);
                        props.addEntry(createValue(context, prop.getName(), String.class.getName()), prop.getValue());
                    }
                }
            }
        }
        return props;
View Full Code Here

  @Test
  public void testUnit() {
    Element e = getTestElement("unit");
    BeanMetadata bean =
      (BeanMetadata) sut.decorate(e, new BeanMetadataImpl(), parserCtx);
    BeanProperty property = (BeanProperty) bean.getProperties().get(0);
    ReferenceMetadata reference = (ReferenceMetadata) property.getValue();
   
    assertEquals("emf", property.getName());
    assertEquals(EntityManagerFactory.class.getName(), reference.getInterface());
    assertEquals("(&(!(org.apache.aries.jpa.proxy.factory=*))(osgi.unit.name=myUnit))", reference.getFilter());
   
    Skeleton.getSkeleton(manager).assertSkeletonNotCalled();
   
View Full Code Here

  @Test
  public void testUnitNoName() {
    Element e = getTestElement("unitNoName");
    BeanMetadata bean =
      (BeanMetadata) sut.decorate(e, new BeanMetadataImpl(), parserCtx);
    BeanProperty property = (BeanProperty) bean.getProperties().get(0);
    ReferenceMetadata reference = (ReferenceMetadata) property.getValue();
   
    assertEquals("emf2", property.getName());
    assertEquals("(&(!(org.apache.aries.jpa.proxy.factory=*))"+NSHandler.EMPTY_UNIT_NAME_FILTER+")",
        reference.getFilter());

    assertTrue(registeredComponents.isEmpty());
  }
View Full Code Here

  @Test
  public void testEmptyUnitName() {
    Element e = getTestElement("emptyUnitName");
    BeanMetadata bean =
      (BeanMetadata) sut.decorate(e, new BeanMetadataImpl(), parserCtx);
    BeanProperty property = (BeanProperty) bean.getProperties().get(0);
    ReferenceMetadata reference = (ReferenceMetadata) property.getValue();
   
    assertEquals("emf3", property.getName());
    assertEquals("(&(!(org.apache.aries.jpa.proxy.factory=*))"+NSHandler.EMPTY_UNIT_NAME_FILTER+")",
        reference.getFilter());
   
    assertTrue(registeredComponents.isEmpty());
  }
View Full Code Here

                            new Object[] { element.getLocalName() });
            throw new IllegalArgumentException();
        }

        // Create an injection point for the JPA resource (a blueprint property)
        final BeanProperty beanProperty = createInjectMetadata(element,
                TAG_UNIT.equals(element.getLocalName()), context);

        // If this is a persistence context then register it with the manager
        if (TAG_CONTEXT.equals(element.getLocalName())) {
            Bundle client = getBlueprintBundle(context);
View Full Code Here

        // 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 new BeanProperty() {
            public Metadata getValue() {
                return target;
            }

            public String getName() {
View Full Code Here

                Element e = (Element) node;
                if (BLUEPRINT_EXT_NAMESPACE_V1_0.equals(e.getNamespaceURI())
                        || BLUEPRINT_EXT_NAMESPACE_V1_1.equals(e.getNamespaceURI())
                        || BLUEPRINT_EXT_NAMESPACE_V1_2.equals(e.getNamespaceURI())) {
                    if (nodeNameEquals(e, PROPERTY_ELEMENT)) {
                        BeanProperty prop = context.parseElement(BeanProperty.class, enclosingComponent, e);
                        props.addEntry(createValue(context, prop.getName(), String.class.getName()), prop.getValue());
                    }
                }
            }
        }
        return props;
View Full Code Here

TOP

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

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.