001    
002    /*
003     * Copyright (C) 2011 Archie L. Cobbs. All rights reserved.
004     *
005     * $Id: VaadinConfigurable.java 184 2011-12-02 16:12:48Z archie.cobbs $
006     */
007    
008    package org.dellroad.stuff.vaadin;
009    
010    import java.lang.annotation.Documented;
011    import java.lang.annotation.ElementType;
012    import java.lang.annotation.Inherited;
013    import java.lang.annotation.Retention;
014    import java.lang.annotation.RetentionPolicy;
015    import java.lang.annotation.Target;
016    
017    import org.springframework.beans.factory.annotation.Autowire;
018    
019    /**
020     * Indicates that the class is a candidate for configuration using the {@code VaadinConfigurableAspect} aspect.
021     *
022     * <p>
023     * Analogous to Spring's {@link org.springframework.beans.factory.annotation.Configurable @Configurable} annotation,
024     * but causes beans to be autowired into the Spring application context associated with the current
025     * {@link SpringContextApplication} Vaadin application instead of the Spring application context associated
026     * with the servlet context.
027     * </p>
028     *
029     * @see org.dellroad.stuff.vaadin
030     */
031    @Retention(RetentionPolicy.RUNTIME)
032    @Target(ElementType.TYPE)
033    @Documented
034    @Inherited
035    public @interface VaadinConfigurable {
036    
037        /**
038         * Configuration bean definition template name, if any.
039         */
040        String value() default "";
041    
042        /**
043         * Whether and how to automatically autowire dependencies.
044         */
045        Autowire autowire() default Autowire.NO;
046    
047        /**
048         * Whether to enable dependency checking.
049         */
050        boolean dependencyCheck() default false;
051    
052        /**
053         * Whether to inject dependencies prior to constructor execution.
054         */
055        boolean preConstruction() default false;
056    }
057