A common placeholder for issues related to the use of annotations with the Spring framework
The Spring Framework (spring) provides several annotation-driven configuration options from wiring beans to managing transaction.
Annotation types
- Annotation-based container configuration:
@Autowired
@Qualifier
@Required
@PostConstruct
@PreDestroy
- Java-based container configuration:
@Configuration
@Bean
@Scope
@Lazy
@Import
@ImportResource
- Web MVC configuration:
@Controller
@RestController
@RequestMapping
@RequestParam
@SessionAttributes
- Declarative transaction management:
@Transactional
- Task Execution and Scheduling:
@Async
@Scheduled
- Declarative annotation based caching:
@Cacheable
@CachePut
@CacheEvict
@CacheConfig
- Aspect oriented programming:
@Pointcut
@Aspect
@Around
@After
@AfterReturning
@AfterThrowing
@Before
@DeclareParents
- JMX support:
@ManagedResource
@ManagedAttribute
@ManagedNotification
@ManagedNotifications
@ManagedOperation
@ManagedOperationParameter
@ManagedOperationParameters
- Testing support:
@AfterTransaction
@BeforeTransaction
@ContextConfiguration
@DirtiesContext
@ExpectedException
@IfProfileValue
@NotTransactional
@ProfileValueSourceConfiguration
@Repeat
@Rollback
@TestExecutionListeners
@Timed
@TransactionConfiguration
:
JSR support
- JSR 107
@CacheResult
@CachePut
@CacheRemove
@CacheRemoveAll
@CacheDefaults
@CacheKey
@CacheValue
- JSR 250:
@Resource
- JSR 303:
@Valid
@NotNull
@Size
, etc
- JSR 330:
@Inject
@Named