Examples of autowire()


Examples of com.tobedevoured.modelcitizen.spring.annotation.SpringBlueprint.autowire()

     * @throws RegisterBlueprintException
     */
    @Override
    public void registerBlueprint(Object blueprint) throws RegisterBlueprintException {
        SpringBlueprint springBlueprint = blueprint.getClass().getAnnotation(SpringBlueprint.class);
        if ( springBlueprint != null && springBlueprint.autowire() ) {
            logger.debug( "Autowiring blueprint {}", blueprint );
            beanFactory.autowireBean( blueprint );
        }
        super.registerBlueprint(blueprint);
    }
View Full Code Here

Examples of org.codehaus.plexus.PlexusContainer.autowire()

        catch (Exception e) {
            if (LOG.isDebugEnabled()) {
          LOG.debug("Can't load component (" + role + "/" + roleHint + ") with plexus, try now with struts.", e);
            }
            Object o = super.buildBean(super.getClassInstance(role), extraContext);
            pc.autowire(o);
            return o;
        }
    }
}
View Full Code Here

Examples of org.codehaus.plexus.PlexusContainer.autowire()

            return pc.lookup(role, roleHint);
        }
        catch (Exception e) {
            log.debug("Can't load component (" + role + "/" + roleHint + ") with plexus, try now with struts.", e);
            Object o = super.buildBean(super.getClassInstance(role), extraContext);
            pc.autowire(o);
            return o;
        }
    }
}
View Full Code Here

Examples of org.codehaus.plexus.PlexusContainer.autowire()

        catch (Exception e) {
            if (LOG.isDebugEnabled()) {
          LOG.debug("Can't load component (" + role + "/" + roleHint + ") with plexus, try now with struts.", e);
            }
            Object o = super.buildBean(super.getClassInstance(role), extraContext);
            pc.autowire(o);
            return o;
        }
    }
}
View Full Code Here

Examples of org.codehaus.plexus.PlexusContainer.autowire()

            return pc.lookup(role, roleHint);
        }
        catch (Exception e) {
            LOG.debug("Can't load component (" + role + "/" + roleHint + ") with plexus, try now with struts.", e);
            Object o = super.buildBean(super.getClassInstance(role), extraContext);
            pc.autowire(o);
            return o;
        }
    }
}
View Full Code Here

Examples of org.codehaus.plexus.PlexusContainer.autowire()

        catch (Exception e) {
            if (LOG.isDebugEnabled()) {
          LOG.debug("Can't load component (" + role + "/" + roleHint + ") with plexus, try now with struts.", e);
            }
            Object o = super.buildBean(super.getClassInstance(role), extraContext);
            pc.autowire(o);
            return o;
        }
    }
}
View Full Code Here

Examples of org.springframework.beans.factory.config.AutowireCapableBeanFactory.autowire()

        configurator.setTags(new ArrayList<ITemplate>());
      }
     
      final AutowireCapableBeanFactory factory = this.getApplicationContext().getAutowireCapableBeanFactory();
      for (final Class<? extends ITemplate> clazz: this.defaultTagClasses()){
        final Object tag = factory.autowire(
            clazz, AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR, false);
       
        configurator.getTags().add((ITemplate) tag);
      }
    }
View Full Code Here

Examples of org.springframework.beans.factory.support.DefaultListableBeanFactory.autowire()

  public void testAutowireWithNoDependencies() {
    DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
    RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, new MutablePropertyValues());
    lbf.registerBeanDefinition("rod", bd);
    assertEquals(1, lbf.getBeanDefinitionCount());
    Object registered = lbf.autowire(NoDependencies.class, AutowireCapableBeanFactory.AUTOWIRE_AUTODETECT, false);
    assertEquals(1, lbf.getBeanDefinitionCount());
    assertTrue(registered instanceof NoDependencies);
  }

  public void testAutowireWithSatisfiedJavaBeanDependency() {
View Full Code Here

Examples of org.springframework.beans.factory.support.DefaultListableBeanFactory.autowire()

    pvs.addPropertyValue("name", "Rod");
    RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, pvs);
    lbf.registerBeanDefinition("rod", bd);
    assertEquals(1, lbf.getBeanDefinitionCount());
    // Depends on age, name and spouse (TestBean)
    Object registered = lbf.autowire(DependenciesBean.class, AutowireCapableBeanFactory.AUTOWIRE_AUTODETECT, true);
    assertEquals(1, lbf.getBeanDefinitionCount());
    DependenciesBean kerry = (DependenciesBean) registered;
    TestBean rod = (TestBean) lbf.getBean("rod");
    assertSame(rod, kerry.getSpouse());
  }
View Full Code Here

Examples of org.springframework.beans.factory.support.DefaultListableBeanFactory.autowire()

    MutablePropertyValues pvs = new MutablePropertyValues();
    pvs.addPropertyValue("name", "Rod");
    RootBeanDefinition bd = new RootBeanDefinition(TestBean.class, pvs);
    lbf.registerBeanDefinition("rod", bd);
    assertEquals(1, lbf.getBeanDefinitionCount());
    Object registered = lbf.autowire(ConstructorDependency.class, AutowireCapableBeanFactory.AUTOWIRE_AUTODETECT, false);
    assertEquals(1, lbf.getBeanDefinitionCount());
    ConstructorDependency kerry = (ConstructorDependency) registered;
    TestBean rod = (TestBean) lbf.getBean("rod");
    assertSame(rod, kerry.spouse);
  }
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.