Package com.tobedevoured.modelcitizen.spring.annotation

Examples of com.tobedevoured.modelcitizen.spring.annotation.SpringBlueprint


     * @return Object
     * @throws BlueprintTemplateException
     */
    @Override
    protected Object createNewInstance(Erector erector) throws BlueprintTemplateException {
        SpringBlueprint springBlueprint = erector.getBlueprint().getClass().getAnnotation(SpringBlueprint.class);
        if ( springBlueprint != null && springBlueprint.bean() ) {
            Class beanClass = springBlueprint.beanClass();

            if ( beanClass.equals( NotSet.class) ) {
                beanClass = erector.getTarget();
            }

            try {
                if ( StringUtils.isNotBlank( springBlueprint.beanName() ) ) {
                    logger.debug( "Retrieving model from Spring [{},{}]", springBlueprint.beanName(), beanClass );
                    return applicationContext.getBean( springBlueprint.beanName(), beanClass );
                } else {
                    logger.debug( "Retrieving model from Spring [{}]", beanClass );
                    return applicationContext.getBean( beanClass );
                }
            } catch( NoSuchBeanDefinitionException e ) {
View Full Code Here


     * @param blueprint {@link Blueprint}
     * @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

TOP

Related Classes of com.tobedevoured.modelcitizen.spring.annotation.SpringBlueprint

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.