Lazy Initiation in Spring IOC As we know Spring’s bean factory is pre-initiate all the beans when first time creating the factory. This is good practice because if there is any dependency error everything can be resolved at the time of start up. This is not case in all the application scenarios. The following are the few drawbacks …
Spring Framework
How to write Interception Around Advice in Spring AOP?
Interception Around Advice Example In this tips we explore how to use the Interception Around Advice in Spring’s Aspect Oriented Programming(AOP). Interception Around Advice is fundamental advice type in the Spring framework. Also this advice type is derived from other frameworks like AspectJ. So it is interoporable with other frameworks, other advices in the Spring …
Simple example for Before advice and After Advice in Spring Framework
BeforeAdvice and AfterReturningAdvice This tips presents a very simple program for invoking the Before Advice and After Returning Advice in the Spring Framework. Thsese two methods are part of Spring’s AOP implementation and used as interceptor methods. the following program create spring beans using the standalone java program and invokes the business logic method. Business …
How to read xml file and inject bean reference using Spring Framework?
Introduction This article presents sample source code for creating the Bean instance using the Spring Framework. This is basic example to read configuration file from the file system and create the beans from the applicationContext.xml file. This xml file define two beans Employee and Address. Address bean is injected inside Employee bean using the ref …
How to integrate Spring with iBatis?
1) Introduction iBatis is an object-relational mapping tool (ORM) that simplifies access to database. This article details the steps needed for integrating Spring with iBatis. Through such an integration, objects that are specific to iBatis can utilise all the benefits given by Spring’s IOC Container. This is not an introductory article for both Spring and …
Life Cycle Management of a Spring Bean
1) Introduction to Spring Bean Life Cycle This article would brief about how a Spring Bean life cycle is managed in IOC (Inversion of Control) Container. Spring Beans exist within the Container as long as they are needed by the Application. There are various life-cycle interfaces and methods that will be called by the IOC Container. …
How to use EJB with Spring framework?
1) Introduction Enterprise Java Beans (EJB) can be used extensively in Spring’s environment. In this article, we will know about the transparent support available in Spring for using the Stateless and the Stateful Session Beans in Spring.The pre-requisite for this article is some basic knowledge in Spring which can be got by reading the article …
Accessing objects in JNDI using Spring
1) Introduction Spring provides support to access objects from the JNDI Repository. This article will begin with the JNDI concepts along with a sample JNDI Application. Then it will proceed with the various core supporting classes available in Spring for JNDI Integration. Following that, practical samples would be given to make things clear. The pre-requisite …