Package org.osgi.service.blueprint.reflect

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


        }  
    }
   
    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


        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

    }

    protected Metadata processMetadata(Metadata metadata) {
        try {
            if (metadata instanceof BeanMetadata) {
                BeanMetadata bmd = (BeanMetadata) metadata;
                processingStack.add("Bean named " + bmd.getId() + "->");
                return processBeanMetadata(bmd);
            } else if (metadata instanceof ReferenceListMetadata) {
                ReferenceListMetadata rlmd = (ReferenceListMetadata) metadata;
                processingStack.add("Reference List named " + rlmd.getId() + "->");
                return processRefCollectionMetadata(rlmd);
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

        for (String id : ids) {
            try {
                ComponentMetadata metadata = blueprintContainer.getComponentMetadata(id);
                Class cl = null;
                if (metadata instanceof BeanMetadata) {
                    BeanMetadata beanMetadata = (BeanMetadata)metadata;
                    cl = bundle.loadClass(beanMetadata.getClassName());
                } else if (metadata instanceof ReferenceMetadata) {
                    ReferenceMetadata referenceMetadata = (ReferenceMetadata)metadata;
                    cl = bundle.loadClass(referenceMetadata.getInterface());
                }
                if (cl != null && type.isAssignableFrom(cl)) {
View Full Code Here

        postConstructMethod = ResourceUtils.findPostConstructMethod(type);
        preDestroyMethod = ResourceUtils.findPreDestroyMethod(type);

        Object component = blueprintContainer.getComponentMetadata(beanId);
        if (component instanceof BeanMetadata) {
            BeanMetadata local = (BeanMetadata) component;
            isSingleton = MetadataUtil.isSingletonScope(local);
        }
    }
View Full Code Here

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

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

  }
 
  @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

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.