Spring Framework 4.0 Release Candidate 1 is released by Spring IO this week. Earlier they have announced that Spring 4.0 is due to the release in October 2014. However, in the latest blog post they have indicated that it will be available by December 2014. The last addition of new features with this release candidate …
How to create a Spring Bean of an Inner class?
In this tutorial I will explain how to declare bean definition for the Inner classes in Spring XML configuration. When you are using inner class as spring beans, you have to specify the binary class name of that inner or nested class to instantiate as a bean. If you have a class ExampleType and it …
Register Spring Beans to BeanFactory using registerSingleton
Spring’s strength lies on its core framework’s Inversion Of Control (IOC) and how the beans are instantiated and managed by the IOC container. All the beans in the spring’s IOC containers are managed as the singleton beans by default for the efficient and good performance. As a good practice, you should never create instance for …
Polymorphic Association Mapping with Any Relationship in Hibernate
Polymorphic association, supported by Hibernate, is the solution of such mapping requirement as an instance of entity needs to be associated with one of multiple possible entities. This can be implemented with Any relationship. In this relationship, the table holding the relationship would have two columns for relationship management. One to identify the primary key …
Creating Managed Threads Using ManagedThreadFactory in Java EE 7 – Part 3
So far we have seen: In Part-1: Creating ManagedExecutorService to submit a single task or a list of tasks where each task would be an implementation of either Callable or Runnable interface. In Part-2: Creating ManagedScheduledExecutorService for scheduling tasks to run at a later time or to schedule repeating tasks. In this post, which will …
ManagedScheduledExecutorService for Implementing Concurrency Utilities in Java EE 7 – Part 2
In my previous post you saw how to use the concurrency utilities in Java EE 7 by using the ManagedExecutorService. In this post we will have a look at a variant of this i.e the ManagedScheduledExecutorService. ManagedScheduledExecutorService is used to schedule tasks to be executed in future by specifying the delay in terms of SECONDS, …
ManagedExecutorService for Implementing Concurrency Utilities in Java EE 7 – Part 1
Prior to Java EE 7 one could make use of the concurrency utilities present in java.util.concurrent package or the java.lang.Thread or java.lang.Runnable. But it was not considered a best practice, not a standard and not safe for the application. This was because the Java EE web and EJB containers instantiate objects using container-managed thread pools …
@Import Annotation in Spring Framework
In my previous article I have explained about the JavaConfig in Spring 3.0. It is a new way of configuring the bean definitions without using the traditional XML files. Also I have listed the annotations defined as part of JavaConfig approach. If you are beginner in spring framework, we have huge collection of spring tutorials …