Task Execution and Scheduling in Spring

spring

Spring 2.0 introduced abstractions for asynchronous execution and scheduling of tasks. The key interfaces for scheduling and task execution are as listed as TaskExecutor, TaskScheduler, Trigger, TriggerContext and ScheduledFuture. Let take a look at each of these interfaces. This article explores spring’s scheduler related APIs in detail. You can read the official explanation for this API’s here. follow us on @twitter and @facebook Spring […]

Cache Abstraction In Spring (Example for @Cacheable and @CacheEvict)

spring

Since Spring 3 a new abstraction layer for caching services has been introduced called Cache Abstraction. The idea is to provide a set of common features, mainly annotations, to activate and manage the caches. Cache Abstraction is nothing but applying caching to Java methods, reducing thus the number of executions based on the information available in […]

Resources API in Spring – Part 2 (ResourceLoaderAware)

spring

In the previous post I discussed about the external resource loading in Spring using Resource Loader interface, and setter methods. In this post I shall discuss about another form of resource loading through ResourceLoaderAware interface. Prior to release of Spring 2.5, this technique was used to load the external resources. Post Spring 2.5, you can […]

Resources API in Spring – Part 1

spring

At times we may need to read external resources (e.g., text files, XML files, properties file, or image files) into our application. These resources can be located different locations (e.g., a file system, classpath, or URL). Usually, you have to deal with different APIs for loading resources from different locations. To handle such file accessing […]

New Features in Spring 3.1

spring

This post will feature some of the major features and enhancements of Spring 3.1. Released in the year 2011, Spring 3.1 introduced many new exciting features as listed and described in this article. This article would provide very good idea on the new features introduced and how it is different from the previous versions. If […]

@Inject and @Named (JSR 330) Annotations Example

spring

Support for JSR-330 annotations was introduced in Spring 3. These annotations are scanned the same way as the Spring annotations, only requirement would be to have the relevant jars in your classpath. You can use the following annotations in Spring 3 applications: @Inject instead of Spring’s @Autowired to inject a bean. @Named instead of Spring’s […]

Spring Classpath Scanning & Managed Components

spring

In my previous articles I have explained about the some of the popular annotations in Spring @Required, @Autowired and @Qualifier. You could note from these posts that we declared all the beans or components in XML bean configuration file; this helps Spring container detect and register beans or components. In this post I shall discuss […]

@Resource, @PostConstruct and @PreDestroy Annotations Example

spring

In this post I shall cover the JSR250 annotations. Introduced in Spring 2.5, it added support for JSR-250 based annotations which include @Resource, @PostConstruct and @PreDestroy annotations. In my previous articles I have explained about the some of the popular annotations in Spring @Required, @Autowired and @Qualifier. Also please read about How to write Custom Spring Callback Methods? also read: follow […]

@Qualifier Annotation in Spring

spring

In this post I shall cover another annotation @Qualifier which helps fine-tune annotation-based autowiring. In the previous post we saw how we could use @Autowired annotation on setter methods, fields and constructors. There may be scenarios when we create more than one bean of the same type and want to wire only one of them […]

@Autowired Annotation in Spring

spring

In my previous post I mentioned about the use of @Required annotation for container configuration. In this post I shall cover the @Autowired annotation. Introduced in Spring 2.5, the @Autowired annotation can be applied to On setter methods On Properties On Constructors @Autowired with arguments also read: follow us on @twitter and @facebook Spring Tutorials ( Collection for Spring […]

Close
Please support the site
By clicking any of these buttons you help our site to get better