Package org.osgi.service.blueprint.reflect

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


  }
 
  @Test
  public void testUnitNoName() {
    Element e = getTestElement("unitNoName", root);
    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());
View Full Code Here


    }
   
    static Class<?> getClassForMetaData(BlueprintContainer container, ComponentMetadata cmd) {
        Class<?> cls = null;
        if (cmd instanceof BeanMetadata) {
            BeanMetadata bm = (BeanMetadata)cmd;
            if (bm instanceof ExtendedBeanMetadata) {
                cls = ((ExtendedBeanMetadata)bm).getRuntimeClass();
            }
            if (cls == null && container instanceof ExtendedBlueprintContainer && bm.getClassName() != null) {
                try {
                    cls = ((ExtendedBlueprintContainer)container).loadClass(bm.getClassName());
                } catch (ClassNotFoundException cnfe) {
                    //ignore
                }
            }
        }
View Full Code Here

    }

    public boolean hasConfiguredPropertyValue(String beanName, String propertyName, String value) {
        ComponentMetadata cmd = getComponentMetadata(beanName);
        if (cmd instanceof BeanMetadata) {
            BeanMetadata br = (BeanMetadata)cmd;
            for (BeanProperty s : br.getProperties()) {
                if (propertyName.equals(s.getName())) {
                    return true;
                }
            }
            return false;
View Full Code Here

        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) {
                components.add(name);
            }
View Full Code Here

        }  
    }
   
    private Object runBeanProcPreInit(Object obj){
        String beanName = getName();
        BeanMetadata beanData = (BeanMetadata) blueprintContainer
          .getComponentDefinitionRegistry().getComponentDefinition(beanName);       
        List<BeanProcessor> processors = blueprintContainer.getProcessors(BeanProcessor.class);
       
        //The start link of the chain, that provides the
        //original, unprocessed bean to the head of the chain.
View Full Code Here

        }  
    }
   
    private Object runBeanProcPostInit(Object obj){
        String beanName = getName();
        BeanMetadata beanData = (BeanMetadata) blueprintContainer
          .getComponentDefinitionRegistry().getComponentDefinition(beanName);       
        List<BeanProcessor> processors = blueprintContainer.getProcessors(BeanProcessor.class);
       
        //The start link of the chain, that provides the
        //original, unprocessed bean to the head of the chain.
View Full Code Here

    }
   
    static Class<?> getClassForMetaData(BlueprintContainer container, ComponentMetadata cmd) {
        Class<?> cls = null;
        if (cmd instanceof BeanMetadata) {
            BeanMetadata bm = (BeanMetadata)cmd;
            if (bm instanceof ExtendedBeanMetadata) {
                cls = ((ExtendedBeanMetadata)bm).getRuntimeClass();
            }
            if (cls == null) {
                try {
                    Method m = ReflectionUtil.findMethod(container.getClass(), "loadClass", String.class);
                    cls = (Class)ReflectionUtil.setAccessible(m).invoke(container, bm.getClassName());
                } catch (Exception e) {
                    //ignore
                }
            }
        }
View Full Code Here

    }

    public boolean hasConfiguredPropertyValue(String beanName, String propertyName, String value) {
        ComponentMetadata cmd = getComponentMetadata(beanName);
        if (cmd instanceof BeanMetadata) {
            BeanMetadata br = (BeanMetadata)cmd;
            for (BeanProperty s : br.getProperties()) {
                if (propertyName.equals(s.getName())) {
                    return true;
                }
            }
            return false;
View Full Code Here

      p.validate(nshandlers.getSchema());
     
      ComponentDefinitionRegistry cdr = new ComponentDefinitionRegistryImpl();
      p.populate(nshandlers, cdr);
     
      BeanMetadata comp = (BeanMetadata) cdr.getComponentDefinition("top");
     
      BeanMetadata anon = (BeanMetadata) ((BeanProperty) comp.getProperties().get(0)).getValue();
      BeanMetadata anonToo = (BeanMetadata) ((BeanProperty) comp.getProperties().get(1)).getValue();

      assertEquals("Required", txenhancer.getComponentMethodTxAttribute(anon, "doSomething"));
      assertEquals("Never", txenhancer.getComponentMethodTxAttribute(anonToo, "doSomething"));
       
    }
View Full Code Here

      p.validate(nshandlers.getSchema());
     
      ComponentDefinitionRegistry cdr = new ComponentDefinitionRegistryImpl();
      p.populate(nshandlers, cdr);
     
      BeanMetadata comp = (BeanMetadata) cdr.getComponentDefinition("top");
     
      BeanMetadata anon = (BeanMetadata) ((BeanProperty) comp.getProperties().get(0)).getValue();
      BeanMetadata anonToo = (BeanMetadata) ((BeanProperty) comp.getProperties().get(1)).getValue();

      assertEquals("Required", txenhancer.getComponentMethodTxAttribute(anon, "doSomething"));
      assertEquals("Never", txenhancer.getComponentMethodTxAttribute(anonToo, "doSomething"));
       
    }
View Full Code Here

TOP

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

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.